arizuu / ttf2ugui Goto Github PK
View Code? Open in Web Editor NEWSimple utility to convert TTF fonts into uGUI bitmap fonts.
Simple utility to convert TTF fonts into uGUI bitmap fonts.
I've compiled it for windows, it might be a good idea to add it, not everybody knows how to setup a cygwin envirnment, also it's time-consuming.
https://github.com/deividAlfa/ST7789-STM32-uGUI/blob/master/ttf2ugui-win.zip
The utility runs on Mac (surprise!), but one needs to install freetype:
brew install freetype
When running, use the full path to the font ttf, e.g.:
./ttf2ugui --font /System/Library/Fonts/Supplemental/Arial.ttf --dpi 140 --size 14 --dump
Dear AriZuu,
you've done a great job in this project; I 've just wanted to ask you how to make this project work for Arabic or Persian fonts?
I'm trying to use the tool to convert fonts, but get errors when I include them.
In uGUI v0.3, the structure definition for a font is:
typedef struct { unsigned char* p; UG_S16 char_width; UG_S16 char_height; } UG_FONT;
But ttf2ugui creates a structure definition with the following format:
const UG_FONT font_NAME_SIZE = { (unsigned char*)pointer_to_font, FONT_TYPE_1BPP, charWidth, charHeight, startChar, endChar, Name };
Did you modify ugui to use the extra parameters or do I have the wrong version?
Many thanks.
uint8_t b = bits[(i*bpp_mul+i_idx) * face->glyph->bitmap.pitch + ((j*bpp_mul+j_idx) / 8)];
The logic is hard to understand. i_idx, j_idx is possible in the range [0, 16), the first part i_idx* pitch, the second part j_idx/8 , I feel it is strange.
Is it possible to explain the meaning of the code? I feel it tries to change the pixel pitch from 16bit to 8bit bpp. the i_idx, j_idx is [0, 16) loop, the b value got from the buffer is not understandable.
Dear AriZuu,
When I use ugui, I can't support simplified Chinese. I try to use ttf2ugui to convert font, and I can't convert Chinese to C array. Do you have any good suggestions?
Thank You。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.