快速简单的插件包装字体 - 静止。
“字体藏匿处可以在OpenGL应用程序中轻松呈现渲染。它支持TRUETYPE字体和UTF-8编码的局部字符串。所有字形都以OpenGL纹理图谱进行缓存。字体rasterization使用Sean Barrett的STB_TRUETYPE.H进行了字体rasterization。”
主要功能:
我进行了微小的修改,以使FontStash呈现垂直翻转的文本,从而在OpenFrameworks Universe中演奏更好的文本。每当创建新纹理时,它也会报告。已经进行了其他修改,以支持MIPMAP,角色间距,Kerning和Retina支持。
OfXfontStash支持基于“ n”的基本单行文本图,线条,多行文本渲染,以及单词包裹以绘制限制在一定宽度的段落。它还在所有绘图选项上都提供了Bbox计算。它需要Xunicode的特定分支。
我对fontStash进行了一些进一步的修改,以允许创建MIPMAP,并启用了字体指定的Kerning信息,因此角色对之间的间距显示为其设计师的意图。
ofxfontstash绘制文本的速度非常快。如果您需要绘制一定宽度的左对齐的文本列,则OfxFontStash的速度可能比OfxftGl快〜10倍。
字体藏匿处最初是由Mikko Mononen创建和出版的。
为了使其在Raspberry Pi上使用,您需要从 *.c到 *.cpp重命名“ libs/fontstash/src/fontstash.c”和“ libs/fontstash/fontstash/src/src/stb_truetype.c”。
Ofxfontstash.cpp和ofxfontstash.h是由Oriol FerrerMesià创建的,并根据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.
文件fontstash.c,fontstash.h和main.c是根据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.
对于UTF-8解码,字体储藏室使用BjörnHöhrmann的灵活且经济的UTF-8解码器(包括在fontstash.c中)。他的代码已根据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.
最后,字体藏匿处使用肖恩·巴雷特(Sean Barrett)的公共域trueType font rasterizer stb_truetype.h。