Closed ChauncyZhang closed 4 weeks ago
maxwidth=11 height=13 And I saw that is very small
maxwidth=11 height=13
It sounds like you have not configured your system to use Freetype, which is required to use TTF fonts. When a font is requested that is not available, usually the "WinFreeSansSerif11x13" font is returned which seems to be what you are getting.
You must ensure that your config file has something like:
####################################################################
# Truetype fonts - .ttf and .otf loadable fonts thru Freetype 2.x
####################################################################
HAVE_FREETYPE_2_SUPPORT = Y
INCFT2LIB = /usr/include
LIBFT2LIB = -lfreetype
FREETYPE_FONT_DIR = "fonts/truetype"
And that the freetype library is compiled and installed on your system.
That's ok, thank you!
Hi, I tested the nano-x to draw font, but I found the font size can't be changed whether I set the size. Can you tell me how to set the font size? best wish!@ghaerr
code below: const char* font_path = "microwindows/src/fonts/em-fonts/arial.ttf"; printf("Loading custom font from %s\n", font_path); GR_FONT_ID font = GrCreateFontEx(font_path, 100, 100, NULL); if (font == 0) { fprintf(stderr, "Error loading font: %s\n", font_path); return; } GrSetFontSizeEx(font, 72, 72); GrSetGCFont(gc, font);