Bin Chen
2008-Feb-18 11:17 UTC
[Fontconfig] code coverage problem when using fontconfig/freetype
Hi, I am curious about a problem of code coverage and font using fontconfig. I know in fontconfig you can specify many font file of one ''family'', take a example of Chinese, I see many internet articles to tell people to configure their fonts using two or more fonts for a family, usually the first one is only cover the English characters, and the second can cover both English and Chinese characters. It seems that program(not sure the fontconfig or the user application) can use the English font first if it only display English, but will change to Chinese font once the English font can''t have enough coverage... Can anyone tell me how to do this? Personally I wrote a program but can''t do this, I don''t know whats the problem. Thanks. Bin
Pat Suwalski
2008-Feb-18 20:49 UTC
[Fontconfig] code coverage problem when using fontconfig/freetype
Bin Chen wrote:> It seems that program(not sure the fontconfig or the user application) > can use the English font first if it only display English, but will > change to Chinese font once the English font can''t have enough > coverage...Typically, the font doesn''t "change" over, but uses the characters out of a different font. For example, if a Chinese font is added to the "Sans" match, then a Chinese web page will latin characters from DejaVu, and Chinese characters from whatever font was added. For programs that don''t use the functionality properly (like IceWM), you have to specify the entire list of fonts that it should try. If you''re writing the program, I believe it''s up to your program to keep trying to match fonts until a character is found. --Pat
Bin Chen
2008-Feb-18 23:48 UTC
[Fontconfig] code coverage problem when using fontconfig/freetype
On Tue, Feb 19, 2008 at 4:49 AM, Pat Suwalski <pat at suwalski.net> wrote:> Bin Chen wrote: > > It seems that program(not sure the fontconfig or the user application) > > can use the English font first if it only display English, but will > > change to Chinese font once the English font can''t have enough > > coverage... > > Typically, the font doesn''t "change" over, but uses the characters out > of a different font. For example, if a Chinese font is added to the > "Sans" match, then a Chinese web page will latin characters from DejaVu, > and Chinese characters from whatever font was added. > > For programs that don''t use the functionality properly (like IceWM), you > have to specify the entire list of fonts that it should try. > > If you''re writing the program, I believe it''s up to your program to keep > trying to match fonts until a character is found.Thanks Pat, Can you point me to some sample code that I can modify the program then fix this? Bin