https://fontstruct.github.io/fonthx/
โคลน repo นี้ด้วย git ไปยังโฟลเดอร์บนเครื่องของคุณ
git clone [email protected]:FontStruct/fonthx.git
ติดตั้ง haxe เช่น https://haxe.org/download/
ปัจจุบันรองรับ Haxe 4.2 (ถ้าบน Haxe 3.4 ใช้แท็ก 0.04)
ติดตั้งการพึ่งพา haxe
ด้วย lix (ต้องการ):
lix download
ด้วย haxelib (ใครก็ตามที่ติดตั้งด้วย Haxelib ควรตรวจสอบปัญหานี้ก่อน)
haxelib install haxelib.json
สร้าง:
haxe build/examples/pixelfonter/pixelfonter-node.hxml
สิ่งนี้จะสร้างตัวอย่าง Pixelfonter ซึ่งจะสร้างแบบอักษร Truetype จากภาพ PNG
ตอนนี้วิ่ง:
node dist/examples/pixelfonter/node/PixelFonterApp.js -i build/examples/pixelfonter/pixel-font-5x5.png -c65-91 -o tmp/pixelfont.ttf
สร้าง:
haxe build/examples/pixelfonter/pixelfonter-java.hxml
วิ่ง:
java -jar dist/examples/pixelfonter/java/PixelFonterApp.jar -i build/examples/pixelfonter/pixel-font-5x5.png -c65-91 -o tmp/pixelfont.ttf
หรือสำหรับตัวอักษรที่มีเค้าโครง CFF:
java -jar dist/examples/pixelfonter/java/PixelFonterApp.jar -i build/examples/pixelfonter/pixel-font-5x5.png -c65-91 -o tmp/pixelfont.otf -f otf
สร้าง:
haxe build/examples/pixelfonter/pixelfonter-cpp.hxml
วิ่ง:
dist/examples/pixelfonter/cpp/PixelFonterApp -i build/examples/pixelfonter/pixel-font-5x5.png -c65-91 -o tmp/pixelfont.ttf
ในการสร้างและเรียกใช้ตัวอย่างนี้บน OSX หรือ Linux คุณจะต้องติดตั้งโมโนเช่นผ่านการติดตั้ง Mono Brew
สร้าง:
haxe build/examples/pixelfonter/pixelfonter-cs.hxml
วิ่ง:
mono dist/examples/pixelfonter/cs/bin/PixelFonterApp.exe -i build/examples/pixelfonter/pixel-font-5x5.png -c65-91 -o tmp/pixelfont.ttf
haxe build/examples/pixelfonter/pixelfonter-js.hxml
- ในการดูตัวอย่างนี้คุณจะต้องชี้เว็บเซิร์ฟเวอร์ที่ dist/ตัวอย่าง/pixelfonter/js/index.html
สิ่งนี้ซับซ้อนและไม่มั่นคง - การผจญภัย
HXCWD=`pwd` haxe build/examples/pixelfonter/pixelfonter-wasm.hxml
- คุณจะต้องตั้งค่า emscripten เพื่อรวบรวมอันนี้ คุณจะต้องชี้เว็บเซิร์ฟเวอร์ที่ DIST/ตัวอย่าง/Pixelfonter/Wasm/index.html วิธีที่ง่ายที่สุดคือ Emrun EG
emrun --no_emrun_detect --browser chrome dist/examples/pixelfonter/wasm/PixelFonterBrowserApp-debug.html
(อาจใช้เวลาสักครู่ในการเริ่มต้น)
ตั้งค่าเครื่องมือ dev (gulp):
npm install gulp-cli -g
npm install
เรียกใช้รายละเอียด:
gulp specs
หรือพัฒนาและเรียกใช้ข้อมูลจำเพาะ:
gulp specs-watch
พัฒนาโดยใช้แอพตัวอย่าง PixelFonter (เป้าหมายโหนด):
gulp pixelfonter-watch
แสดงงานอึกที่มีอยู่ทั้งหมด:
gulp --tasks
ดูตัวอย่าง Pixelfonter สำหรับคำแนะนำโดยเฉพาะ Pixelfonter
คุณต้องทำ: