Addon Wrapping Font-Stash ที่ง่ายและรวดเร็ว
"Font Stash ช่วยให้การเรนเดอร์สตริงง่ายในแอปพลิเคชัน OpenGL รองรับ Fonts Truetype และ utf-8 encoded strings localized glyphs ทั้งหมดจะถูกแคชใน OpenGL Texture Atlases Font Rasterization ทำได้
คุณสมบัติหลัก:
ฉันทำการดัดแปลงเล็ก ๆ น้อย ๆ กับ FontStash เพื่อแสดงข้อความพลิกในแนวตั้งเพื่อเล่นได้ดีกว่าในจักรวาล OpenFrameworks โดยทั่วไป นอกจากนี้ยังจะรายงานทุกครั้งที่มีการสร้างพื้นผิวใหม่ มีการปรับเปลี่ยนอื่น ๆ เพื่อรองรับ mipmaps ระยะห่างของตัวละคร kerning และการสนับสนุนเรตินา
OFXFontStash รองรับการวาดข้อความแบบบรรทัดเดียวขั้นพื้นฐาน, lineHeight, การแสดงข้อความหลายข้อความตาม ' n' และยังเขียนคำเพื่อวาดย่อหน้าที่ จำกัด ไว้ที่ความกว้างที่แน่นอน นอกจากนี้ยังมีการคำนวณ BBOX สำหรับตัวเลือกการวาดทั้งหมด มันต้องใช้สาขาเฉพาะของ Ofxunicode
ฉันทำการปรับเปลี่ยนเพิ่มเติมเพื่อให้ FontStash อนุญาตให้สร้าง MIPMAPs และเพื่อเปิดใช้งานการใช้ข้อมูล kerning ที่ระบุแบบอักษรดังนั้นระยะห่างระหว่างคู่อักขระจะแสดงเป็นนักออกแบบที่ตั้งใจไว้
Ofxfontstash ค่อนข้างเร็วในการวาดข้อความ หากคุณต้องการวาดคอลัมน์ข้อความที่อยู่ในแนวซ้ายของความกว้างที่แน่นอน OFXFONTSTASH สามารถเร็วกว่า OFXFTGL ~ 10 เท่า
Font Stash ถูกสร้างขึ้นและเผยแพร่โดย Mikko Mononen
ในการทำให้สิ่งนี้ทำงานบน Raspberry Pi คุณต้องเปลี่ยนชื่อ "Libs/FontStash/Src/Fontstash.c" และ "Libs/FontStash/Src/SRC/STB_TRUETYPE.C" จาก *.C ถึง *.CPP
OFXFONTSTASH.CPP และ OFXFONTSTASH.H ถูกสร้างขึ้นโดย Oriol Ferrer Mesiàและเปิดตัวภายใต้ใบอนุญาต 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 Font Stash ใช้ตัวถอดรหัส UTF-8 ที่ยืดหยุ่นและประหยัดของBjörnHöhrmann (รวมอยู่ใน 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.
ในที่สุด Font Stash ใช้โดเมนสาธารณะของ Sean Barrett Truetype Font Rasterizer STB_TRUETYPE.H