Rápido e simples Addon embrulhando a fonte da fonte.
"O Stoh de fonte permite uma fácil renderização de cordas em aplicativos OpenGL. Ele suporta fontes TrueType e Strings localizados codificados UTF-8. Todos os glifos são armazenados em cache em atlas de textura OpenGL. Rasterização de fontes é feita usando o STB_TRUETYPETYPETIPE de Sean Barret."
Principais recursos:
Fiz pequenas modificações para o Fontstash para renderizar o texto invertido verticalmente, para jogar melhor no universo do OpenFrameworks em geral. Ele também relatará toda vez que uma nova textura é criada. Outras modificações foram feitas para apoiar o suporte a MIPMAPs, espaçamento de personagens, kerning e retina.
O OFXFONTSTASH suporta o desenho de texto de uma linha básico, a renderização de texto multilina básica com base em ' n' e também o envolvimento de palavras para desenhar um parágrafo restrito a uma certa largura. Ele também oferece cálculos do BBOX em todas as opções de desenho. Requer um ramo específico do Ofxunicode.
Fiz algumas modificações adicionais no Fontstash para permitir a criação de MIPMAPs e para permitir o uso das informações de kerning especificadas pela fonte; portanto, o espaçamento entre os pares de caracteres é mostrado como seu designer pretendido.
OFXFONTSTASH é bastante rápido em desenhar texto. Se você precisar desenhar uma coluna de texto alinhada à esquerda de uma certa largura, o OFXFONTSTASH pode ser ~ 10x mais rápido que o OFXFTGL.
A font Stash foi criada e publicada originalmente por Mikko Mononen.
Para fazer com que isso funcione em um Raspberry Pi, você precisa renomear "libs/fontstash/src/fontstash.c" e "libs/fontstash/src/stb_truetype.c" de *.c para *.cpp.
OFXFONTSTASH.CPP e OFXFONTSTASH.H foram criados por Oriol Ferrer Mesià e liberados sob licença do MIT.
Copyright (c) 2012 Oriol Ferrer Mesià
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Os arquivos Fontstash.c, Fontstash.h e Main.c são licenciados sob a licença do ZLIB:
Copyright (c) 2011 Andreas Krinke [email protected]
Copyright (c) 2009 Mikko Mononen [email protected]
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Para a decodificação da UTF-8, a font Stash usa o decodificador UTF-8 flexível e econômico de Björn Höhrmann (incluído no Fontstash.c). Seu código está licenciado sob a licença do MIT:
Copyright (c) 2008-2009 Bjoern Hoehrmann <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Finalmente, a font Stash usa o domínio público de Sean Barrett, TrueType Rasterizer Stb_truetype.h.