Re: [Tuxpaint-devel] Per-locale default font
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
From: Bill K. <nb...@so...> - 2023-06-13 04:18:07
|
On Sat, Jun 10, 2023 at 06:26:13PM -0400, Mark Kim wrote: > Hi, > > Tux Paint Config on macOS is also unable to list fonts bundled with Tux > Paint. This happens, at least on macOS, because the bundled fonts are not > installed but stays bundled with Tux Paint, outside the purview of Tux > Paint Config. Yeah, I think that's what's happening for me on Linux as well. Ever since switching from SDL_ttf and attempting to load "<locale>.ttf" files, to SDL_Pango (now SDL2_Pango), we basically lost the ability to use those fonts, and have been shipping them meaninglessly. :-D Oops! > I've made this commit > <https://sourceforge.net/p/tuxpaint/tuxpaint-config/ci/4cfd3155c5282ffa3f260af05d2a30fa1027da95/> > to ensure fonts bundled with Tux Paint are always listed in UI Fonts > section of Tux Paint Config. This is done by hard-coding the list of > bundled fonts. The change affects all OS in hope that it'll be beneficial > to other OS, but let me know if it should be made into a macOS-specific > change. I think this is okay (though we'll need to make sure it stays sync'd up with Tux Paint, if/when we ever change anything!) Way back in the day (literally 20 years ago, +/- a few months!) we packaged up various fonts that were too big to include directly inside Tux Paint, three of which are still available here: https://tuxpaint.org/download/fonts/ They include: * Korean (~10MB) The "ko.ttf" font file is a copy of "gulim.ttf" from the "Baekmuk" collection of Korean TrueType fonts, (c) 1986-2000, Baekmuk Font 21 Inc. (Came from Debian package "ttf-baekmuk", at the time.) * Chinese Traditional (~14MB) HanWangKaiMediumChuIn is a registered trademark of HtWang Graphics Laboratory (C)Copyright Dr. Hann-Tzong Wang, 2004. (GPL v2+) [Note: What we ship directly inside Tux Paint is a subset of another GPL font, "wp010-05.ttf", containing only the characters used by Tux Paint; it weighs in at 1.1MB. Unfortunately, the Python script that generates it doesn't run under Python3. Fortunately, I refreshed it back in early 2022.] * Chinese Simplified (~5MB) The "zh_cn.ttf" font file is a copy of "AR PL SungtiL GB", a high-quality Chinese TrueType font (gbsn00lp.ttf) generously provided by Arphic Technology to the Free Software community under the "Arphic Public License". We used to have others available for download as well, but eventually rolled them into Tux Paint itself. I wonder if in this day & age it'd be fine to simply include these last tree fonts directly inside Tux Paint, too. (It looks like it'd add about 28MB to the install size.) I have no clue whether the Windows installers or macOS DMG from way back in 2002 & 2004 still work properly with current Tux Paint!!! I'd rather not continue maintaining these separate downloads. :-) Of course, going back to the beginning of this email, the main issue at hand is Tux Paint, via SDL2_Pango, doesn't KNOW about these fonts yet. At least, not for me, not on Linux! I'll poke around. -bill! > > Thanks, > Mark > > > On Sat, Jun 10, 2023 at 9:33 AM Shin-ichi TOYAMA < > dol...@wm...> wrote: > > > Hi! > > > > The behavior of the font seartch methods seem to work differently on > > Linux and Windows. > > > > On linux, Tux Paint and Tux Paint Config seems not be able to find a > > locale font shipped with Tux Paint. > > > > On the other hand, they *can* find the locale font on windows. > > > > > > I think "noto sans" (pango's default on Rocky9?) looks good, but MS > > Gothic (default on Windows) looks quite bad. > > > > Please see some examples I wrapped up. > > > > https://z1.plala.jp/tuxpaint/tmp/uifonts2.html > > > > I confirmed pango's default (noto sans) on Rocky9 is good enough and > > guess TkaoPGothick also would not be bad. Therefore, just specifing > > "GJGothicPNSubset" as a default for Japanese would be O.K. at least > > for Japanese. > > > > However, how is it on other distro's? How is it for other languages? > > > > I think it would be better if we could find a way to use locale fonts > > also on Linux. > > > > Thanks! > > > > On Thu, 8 Jun 2023 00:52:07 -0700, Bill Kendrick wrote: > > > > > >For a long while now, Tux Paint has used "DejaVu Sans" as the > > >preferred font for the UI (requested via Pango, though based on what I > > >see in screenshots on Twitter, some folks don't have that font and > > >some alternatives are used). > > > > > >Recently, Shin-ichi noted that we have a font tucked away in > > >"fonts/locale/" that looks much better for use with Japanese text, > > >but we're not using it (we no longer load TTF files directly and use > > >SDL_ttf to render strings, it's all SDL2_Pango now). > > > > > >Therefore, I've added the ability for us (the Tux Paint developers) > > >to specify a preferred font on a per-locale basis. It's simply > > >a language code (from our `src/i18n.h` file, e.g., "LANG_DE" for > > >German, "LANG_ZH_CN" for Chinese (Simplified), etc.) and a string > > >describing the font family we want Pango to load. > > >(If left unspecified, we'll continue to ask for "DejaVu Sans".) > > > > > >This is now in the Git master branch over in the SourceForge project, > > >and will be part of Tux Paint 0.9.31. > > > > > >I'm about to try to set fonts, as best I can, based on the collection > > >of TTF files we have been shipping with Tux Paint. Those files seem > > >to be useless now, unless I'm mistaken! However, I wonder if we could > > >install them into the system where Pango can find them, when installing > > >Tux Paint? Or perhaps we could somehow point Pango to our directory > > >of locale fonts as an extra place to look when scanning for fonts...? > > > > > >Thoughts? > > > > > >And also, if you have a preferred font for your favorite locale, > > >please share and I can add it to the list! > > > > > > > > > -- > > Shin-ichi TOYAMA <dol...@wm...> > > > > > > _______________________________________________ > > Tuxpaint-devel mailing list > > Tux...@li... > > https://lists.sourceforge.net/lists/listinfo/tuxpaint-devel > > -- -bill! Sent from my computer |