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 13:20:07
|
Hi Shin-ichi, > but does not change the UI font. The UI font can be changed by changing PANGO_DEFAULT_FONT in fonts.h. This will change the font for all locales, however. It would be nice to be able to localize it. Mark On Fri, Dec 9, 2022 at 1:38 AM Shin-ichi TOYAMA <dol...@wm...> wrote: > Thanks Mark, > > Seeing your commit "3849480fd490bc7bf705a20b908b2201cbd22013", I added the > locations of locale fonts on top of the directory list in the "fonts.conf" > as follows and found the expected localized fontname for "ja.ttf" in the > debug message. > > <dir prefix="cwd">data/fonts/locale</dir> > <dir prefix="cwd">data/fonts</dir> > > This changes the locale font when using "text" or "label" tools, but does > not > change the UI font. > > I will see more. > > > On Fri, 9 Dec 2022 00:08:11 -0500, Mark K. Kim wrote: > >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 > >>> > >> > > > -- > Shin-ichi TOYAMA <dol...@wm...> > > > _______________________________________________ > Tuxpaint-devel mailing list > Tux...@li... > https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel > |