Re: [Tuxpaint-devel] Windows & Android (& others?) FontConfig `fonts.conf` parsing
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Shin-ichi T. <dol...@wm...> - 2025-02-22 14:19:05
|
Hi! I added the specific code to load fonts stored in user's profile because I had thought like AI does that Windows does not use fontconfig to load fonts. However, On Sat, 22 Feb 2025 02:29:32 -0800, Bill Kendrick wrote: >Tux Paint actually SHIPS with its own "fonts.conf" file for Windows [*], >which includes these <dir> paths: > > <dir prefix="cwd">data/fonts/locale</dir> > <dir prefix="cwd">data/fonts</dir> > <dir>WINDOWSFONTDIR</dir> <dir>WINDOWSUSERFONTDIR</dir> > <dir prefix="xdg">fonts</dir> > <dir>~/.fonts</dir> > >Those "WINDOWSFONTDIR" and "WINDOWSUSERFONTDIR" values seem to be magic >strings used by FontConfig; see: > > https://gitlab.freedesktop.org/fontconfig/fontconfig/-/blob/main/src/fcxml.c#L1330 > >I think at the very least, one place the Windows version of Tux Paint >should look for "fonts.conf" is own one that ships with Tux Paint: >`etc/fonts/fonts.conf` (inside Tux Paint). > >If we were to mimick the behavior of FontConfig itself when >those two "WINDOWS...FONTDIR" values are seen, I think that might >actually remove the need for your user font dir scanning code >(added in `365ee3ea20af489996e045f97ae2d874e43f5591`). Wouldn't it? once reading this part, I thought you may be right. Therefore I pulled your hack and disabled the code to read user's font directory. Then, unfortunately, Tuxpaint does NOT load user's font ;-< Just a brief report so far. Thanks. |