快速簡單的插件包裝字體 - 靜止。
“字體藏匿處可以在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。