Re: [Tuxpaint-devel] Locale font selection
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Mark K. K. <mar...@gm...> - 2022-12-09 05:08:31
|
Oh, and... no, I don't think there exists today a way to call TTF_FontFaceFamilyName() with the locale-based font facename, so that needs to be localized. Mark On Thu, Dec 8, 2022 at 11:57 PM Mark K. Kim <mar...@gm...> wrote: > Hi Shin-ichi, > > > How do I know which font is used, and how can I force "ja.ttf" to be > > used on ja_JP locale ? > > If you are using SDL Pango, the font folder needs to be listed in > Fontconfig's configuration file ("fonts.conf" on Linux and macOS) for > Pango to find it. The file is named /opt/local/etc/fonts/fonts.conf on > macOS using MacPorts. > > Then the font is loaded based on the font's *face*name (not its *file*name) > passed to TuxPaint_Font_OpenFont(). The filename passed to > TuxPaint_Font_OpenFont() is not used by SDL Pango; the filename is used > by SDL_ttf only when SDL Pango is disabled. > > To get the facename from a filename, use TTF_FontFaceFamilyName() that > comes with SDL_ttf (see fonts.c line ~369). It looks like the font > facename of ja.ttf is "Sazanami Gothic". > > To confirm fonts.conf is configured correctly and SDL Pango sees > this font, enable DEBUG and VERBOSE in debug.h, recompile, start Tux > Paint, then look for this line: > > ## src/tuxpaint.c, line 31079 in main() @ Thu Dec 8 22:06:09 2022 > pango ft2 fontmap[6] = '*Sazanami Gothic*' > > > Mark > > On Thu, Dec 8, 2022 at 8:31 PM Shin-ichi TOYAMA < > dol...@wm...> wrote: > >> Hi! >> >> Inspired from recent discussion about fonts, I tried to test a modern >> font for Japanese based on the Universal Design, and noticed that the >> locale font "ja.ttf" is not used. >> >> How do I know which font is used, and how can I force "ja.ttf" to be >> used on ja_JP locale ? >> >> I feel the default Japanese fonts (both on Linux and Windows) are not >> very bad but not the best. >> >> Thanks! >> >> -- >> Shin-ichi TOYAMA <dol...@wm...> >> >> >> _______________________________________________ >> Tuxpaint-devel mailing list >> Tux...@li... >> https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel >> > |