[Fontconfig] Simulating generic aliases with an empty font
nikulinpi at gmail.com
Tue Dec 29 23:00:01 PST 2009
2009/12/29 Qianqian Fang <fangq at nmr.mgh.harvard.edu>:
> Fontconfig only provides a limited number of generic aliases.
> I am experimenting simulating a "generic alias" using an
> empty font and a set of fontconfig rules.
> Here is what I have done: I created an empty font using fontforge,
> containing only a few invisible glyphs such as .notdef. The font
> family name is set to "WenQuanYi Ray Song". I want to use
> 3 fonts to synthesize this font: Dejavu Serif, WenQuanYi Bitmap Song
> and AR PL UMing CN. I created a fontconfig file to combine
> these fonts so that 1) when rendering glyphs in the range of 11px~16px,
> Dejavu Serif will be used for non-CJK and WQY Bitmap Song will
> be used for CJK; 2) out of that range, vector glyphs in AR PL
> UMing CN will be selected for CJK. The font file and the config
> are attached.
> I used the following command to test the rules, and it worked fine:
> pango-view --font='WenQuanYi Ray Song' --text='文泉驿锐宋 Ray Song' --waterfall
> However, I am seeing some wield stuff when I tried to set this
> font in the system appearance dialog. Under en_US locale, when
> I select "WenQuanYi Ray Song" from the gtk font selection dialog
> and click "regular" and "OK", "DejaVu Serif Book" will be shown
> as the font name instead. Because the font name is changed,
> the previous defined rules for Ray Song is no longer used.
> When I select this font under Chinese locale, the first available
> font style is not "Regular" anymore, it became the traditional
> Chinese family name of this font! (see attachment 3) Selecting
> it will also fall back to "DejaVu Serif Book".
> Finally, if you select the italic/bold/italicbold style, gtk font
> dialog is able to use "WenQuanYi Ray Song" as the font name.
> I am not sure which went wrong. The wrong font style may linked
> to fontconfig, while the font name changing may be related to
> Anyone want to comment on this? do you see a possible bug from
> these tests?
> Fontconfig mailing list
> Fontconfig at lists.freedesktop.org
I think having a synthetic fonts or faces to have embedded bitmap and
vector fonts separate would be quite useful and free people from doing
.fonts.conf stuff a little.
More information about the Fontconfig