Dear list, I have Fontconfig 2.2.2, Xfree86 4.3.0, QT 3.2.3 and KDE 3.2.0 on Debian testing in an en_US.UTF-8 locale. My problem is that when the specified font does not contain Cyrillic characters, then Cyrillic characters get displayed with atrocious-looking, overspaced glyphs from a Chinese font that happens to contain some Cyrillic glyphs (see attached image), in spite of the fact that perfectly good Cyrillic fonts are installed on the system. The offending Chinese font seems to be either "AR PL SungtiL GB:style=Regular" or "AR PL KaitiM GB:style=Regular". Now since GTK behaves properly, this could maybe be considered a QT/KDE problem. Or alternatively, one could argue that the ugly Cyrillic glyphs have no business being in the Chinese font in the first place. But while waiting for this to be fixed on the QT/KDE or font side, I want to tell fontconfig one simple thing: "For Cyrillic, do not even consider using these Chinese fonts." Can this be accomplished in .fonts.conf, and could some kind soul tell me how? Further puzzling aspects of this: The same problem does not occur with Greek, even though the situation seems to be parallel to the Cyrillic case, with the two Chinese fonts containing some Greek glyphs. And neither "fc-list :lang=ru" nor "fc-list :lang=el" actually lists the Chinese fonts that based on visual appearance I identified as likely culprits. Thanks for your help, Stefan PS. What is the current official email address of the fontconfig mailing list: "fontconfig AT fontconfig DOT org" or "fontconfig AT freedesktop DOT org"? If both addresses are active, will posts sent to the one be visible to those subscribed to the other? -- Stefan Baums Asian Languages and Literature University of Washington -------------- next part -------------- A non-text attachment was scrubbed... Name: kedit.png Type: image/png Size: 25842 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040422/3e2a709f/kedit-0001.png
A non-text attachment was scrubbed... Name: konqueror.jpg Type: image/jpeg Size: 30138 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040422/ba446e97/konqueror.jpg
> 2.2.92 had issues with FreeType header syntax; that''s been fixed > in 2.2.93Okay, I uninstalled the Fontconfig 2.2.2 Debian packages, compiled and installed Fontconfig 2.2.93 and ran fc-match --sort ''sans\-serif'' with the attached result. Sure enough, "AR PL SungtiL GB" and "AR PL Mingti2L Big5" do appear in the list (by the way, note the wrong spelling "Reguler" with the latter). "Free Helvetian" for some strange reason does not (nor is it in the lists for ''serif'' and ''monospace''). Nonetheless, the list would suggest that the Chinese font should _not_ be used for Cyrillic, since "Free Avant Garde" and "Free Times" are much higher up the list. All this was from the console. X wouldn''t start up at all with Fontconfig 2.2.93, so I don''t know what KDE would have looked like with it. Stefan -- Stefan Baums Asian Languages and Literature University of Washington -------------- next part -------------- ~> fc-match --sort ''sans\-serif'' Fontconfig error: Cannot load default config file a010013d.pfb: "Free Avant Garde" "Book" n021003d.pfb: "Free Times" "Roman" b018012l.pfb: "URW Bookman L" "Light" mikachan.ttf: "mikachan" "Regular" Garuda.ttf: "Garuda" "Regular" thryn___.ttf: "Thryomanes" "Regular" TAMu_Kalyani.ttf: "TAMu_Kalyani" "Regular" TSCu_Paranar.ttf: "TSCu_Paranar" "Regular" TSCu_Times.ttf: "TSCu_Times" "Normal" TSCu_Comic.ttf: "TSCu_Comic" "Normal" TSCu_paranarb.ttf: "TSCu_Paranar" "Bold" z003034d.pfb: "Free Chancery" "Italic" TSCu_paranari.ttf: "TSCu_Paranar" "Italic" DBThaiText.ttf: "DBThaiText" "Medium" KacstDecorative.ttf: "KacstDecorative" "KacstDecorative" KacstQurn.ttf: "KacstQurn" "KacstQurn" AkaashNormal.ttf: "Akaash" "Normal" batang.ttf: "Baekmuk Batang" "Regular" gbsn00lp.ttf: "AR PL SungtiL GB" "Regular" bsmi00lp.ttf: "AR PL Mingti2L Big5" "Reguler" opens___.ttf: "OpenSymbol" "Regular" MalOtf.ttf: "MalOtf" "Book" ani.ttf: "Ani" "Regular" malayalam.ttf: "malayalam" "Regular" d050000l.pfb: "Dingbats" "Regular" s050000l.pfb: "Standard Symbols L" "Regular" KacstQuraFixed.ttf: "KacstQuraFixed" "Regular" DBThaiTextBold.ttf: "DBThaiText" "Bold"
> Next question: Which version of Qt ?In my original post, I give version numbers for some of the relevant software I have installed. QT is 3.2.3, which is the most recent version available from Debian. Not even the unstable or experimental distributions seem to have 3.3.2 yet. Compiling QT 3.3.2 from source sounds daunting, and I''m not sure whether Debian''s KDE will work with it, but I can try.> IIRC 3.3.1 has fixes for fontconfig. See doc.trolltech.com for > detailed changes.I couldn''t find the relevant information at that address. The only changelog I found anywhere was at http://www.trolltech.com/products/qt/whatsnew.html and that does not mention fontconfig. Stefan -- Stefan Baums Asian Languages and Literature University of Washington
Around 14 o''clock on Apr 22, Stefan Baums wrote:> The most recent development snapshot (2.2.92) fails to build with > the attached error message. The CVS version fails to configure > with the other attached error message.2.2.92 had issues with FreeType header syntax; that''s been fixed in 2.2.93 which is available at http://freedesktop.org/~fontconfig/release Checking bits out from CVS requires quite recent versions of the autotools, including automake. You should be able to get things to build with the included ''autogen.sh'' script if you have recent enough versions of automake, libtool and autoconf. The tarballs have generated versions of the configure script which obviates the need for running autogen.sh -keith -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 228 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040422/4ef61435/attachment.pgp
> It probably is. Qt 3, can synthesize a missing font on the fly.That is actually another problem of QT that I wasn?t planning to go into here and now, but since you bring it up... Apparently, QT can substitute whole scripts that are missing in font X from font Y, but not individual characters. Have a look at the attached screenshot of one of my directories in Konqueror. The words with the empty boxes are ?br?hm?? and ?????????. The font used for the former (Bitstream Vera Sans) has some coverage of the Latin script, but is lacking glyphs for the two characters ? and ?, and QT seems incapable of recognising this and getting those glyphs from another font. Similarly, the font used for ????????? (the ugly Chinese one) has some coverage of Cyrillic, but does not include a glyph for the character ?, which QT fails to supply from another font. So the overall impression is that QT 3 uses Fontconfig superficially and incorrectly. This probably has to be fixed at the QT end, but in the meantime I would like to configure Fontconfig so I can sidestep QT?s most egregious mistakes.> You can adjust Qt font settings in qtconfig, which may or may > not be installed with with Debian''s packaging.It is in the package qt3-qtconfig, but all it allows you to do is to substitute one whole font for another. But I don?t want to replace the whole of the Chinese fonts with some other fonts, just the Cyrillic part of them. Also, even after I did specify in qtconfig a substitution of ?Free Helvetian? for both ?AR PL KaitiM GB? and ?AR SungtiL GB?, that didn''t have the slightest effect when typing Cyrillic in kedit - it still uses the Cyrillic glyphs from the Chinese font. Stefan -- Stefan Baums Asian Languages and Literature University of Washington -------------- next part -------------- A non-text attachment was scrubbed... Name: glyph-substitution.jpg Type: image/jpeg Size: 22577 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040422/d288da21/glyph-substitution.jpg
> Make the fonts you prefer appear before the fonts you dislike > and fontconfig will happily provide them first in the list to > the application.Sorry, that doesn''t have any effect here. I attach my .fonts.conf file. Putting your lines into /etc/fonts/local.conf didn''t change anything either. Maybe it does have something to do with the seeming Greek non-parallelism and fc-list strangeness that I described? What is the current preferred email address for the fontconfig list? Cheers, Stefan -- Stefan Baums Asian Languages and Literature University of Washington -------------- next part -------------- <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <match target="font" > <edit mode="assign" name="rgba" > <const> rgb </const> </edit> </match> <dir>~/.fonts</dir> <!-- This is here to prevent QT/KDE fetching Cyrillic glyphs from the Arphic Chinese fonts. Doesn''t work, though. --> <alias> <family>sans-serif</family> <prefer> <family>Free Helvetian</family> </prefer> </alias> <alias> <family>serif</family> <prefer> <family>Free Times</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>Free Courier</family> </prefer> </alias> </fontconfig>
On Thursday 22 April 2004 05:05 pm, Keith Packard wrote:> Around 13 o''clock on Apr 22, Stefan Baums wrote: > > Sorry, that doesn''t have any effect here. I attach my .fonts.conf > > file. Putting your lines into /etc/fonts/local.conf didn''t change > > anything either. > > That''s disturbing. Perhaps Qt is doing something weird.It probably is. Qt 3, can synthesize a missing font on the fly.> > One way to test would be to install fontconfig 2.2.93 and use the (new) > ''fc-match'' application to see how the configuration is affecting the list > of fonts provided back to the application. > > $ fc-match --sort ''sans\-serif'' > > will show precisely the order in which fontconfig suggest that fonts be > used by the application to satisfy various character requests. > > > What is the current preferred email address for the fontconfig > > list? > > fontconfig.org is hosted on the same machine as freedesktop.org, so > you can use either address and it will end up in precisely the same place. > > -keithYou can adjust Qt font settings in qtconfig, which may or may not be installed with with Debian''s packaging. We have fought the same issues with Scribus, but it is now rare if fc-cache is re-run when adding/subtracting fonts. Hope that helps, Peter
Around 12 o''clock on Apr 22, Stefan Baums wrote:> My problem is that when the specified font does not contain Cyrillic > characters, then Cyrillic characters get displayed with atrocious-looking, > overspaced glyphs from a Chinese font that happens to contain some Cyrillic > glyphs (see attached image), in spite of the fact that perfectly good > Cyrillic fonts are installed on the system.That''s easily fixed by ammending the list of fonts included in the sans-serif, serif and monospace lists. Make the fonts you prefer appear before the fonts you dislike and fontconfig will happily provide them first in the list to the application. in your ~/.fonts.conf, you can add: <alias> <family>sans-serif</family> <prefer> <family>Favorite Sans-Serif Cyrillic Font Name Here</family> </prefer> </alias> <alias> <family>serif</family> <prefer> <family>Favorite Serif Cyrillic Font Name Here</family> </prefer> </alias> <alias> <family>monospace</family> <prefer> <family>Favorite Monospace Cyrillic Font Name Here</family> </prefer> </alias> -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 228 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040422/58b2ad29/attachment-0001.pgp
Around 13 o''clock on Apr 22, Stefan Baums wrote:> Sorry, that doesn''t have any effect here. I attach my .fonts.conf > file. Putting your lines into /etc/fonts/local.conf didn''t change > anything either.That''s disturbing. Perhaps Qt is doing something weird. One way to test would be to install fontconfig 2.2.93 and use the (new) ''fc-match'' application to see how the configuration is affecting the list of fonts provided back to the application. $ fc-match --sort ''sans\-serif'' will show precisely the order in which fontconfig suggest that fonts be used by the application to satisfy various character requests.> What is the current preferred email address for the fontconfig > list?fontconfig.org is hosted on the same machine as freedesktop.org, so you can use either address and it will end up in precisely the same place. -keith -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 228 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040422/bc3d3694/attachment-0001.pgp
> That''s disturbing. Perhaps Qt is doing something weird.You bet. Other bits of weirdness: - I specify the non-Cyrillic font "Bistream Vera Sans" (bold, 11 point) for window titles, and KDE supplies Cyrillic characters from a serif instead of a sans-serif font (see attached screenshot). - I specify "Bistream Vera Serif" (12 point) as my default font in Konqueror, and for non-bold text KDE supplies ugly spaced-out Cyrillic glyphs from one of the Chinese fonts, whereas glyphs for bold Cyrillic text are apparently fetched from the same source as in Window titles (screenshot in separate email due to the list''s message size restriction).> One way to test would be to install fontconfig 2.2.93 and use > the (new) ''fc-match'' application to see how the configuration is > affecting the list of fonts provided back to the application.The most recent development snapshot (2.2.92) fails to build with the attached error message. The CVS version fails to configure with the other attached error message. Stefan -- Stefan Baums Asian Languages and Literature University of Washington -------------- next part -------------- A non-text attachment was scrubbed... Name: window-title.png Type: image/png Size: 14144 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040422/612501e7/window-title.png -------------- next part -------------- /tmp/fontconfig-2.2.92> make make all-recursive make[1]: Entering directory `/home/tmp/fontconfig-2.2.92'' Making all in fontconfig make[2]: Entering directory `/home/tmp/fontconfig-2.2.92/fontconfig'' make[2]: Nothing to be done for `all''. make[2]: Leaving directory `/home/tmp/fontconfig-2.2.92/fontconfig'' Making all in fc-lang make[2]: Entering directory `/home/tmp/fontconfig-2.2.92/fc-lang'' if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../src -I.. -I/usr/include/freetype2 -g -O2 -MT fc-lang.o -MD -MP -MF ".deps/fc-lang.Tpo" \ -c -o fc-lang.o `test -f ''fc-lang.c'' || echo ''./''`fc-lang.c; \ then mv -f ".deps/fc-lang.Tpo" ".deps/fc-lang.Po"; \ else rm -f ".deps/fc-lang.Tpo"; exit 1; \ fi In file included from ../fontconfig/fcfreetype.h:27, from ../src/fcint.h:39, from fc-lang.c:25: /usr/include/freetype2/freetype/freetype.h:20:2: #error "`ft2build.h'' hasn''t been included yet!" /usr/include/freetype2/freetype/freetype.h:21:2: #error "Please always use macros to include FreeType header files." /usr/include/freetype2/freetype/freetype.h:22:2: #error "Example:" /usr/include/freetype2/freetype/freetype.h:23:2: #error " #include <ft2build.h>" /usr/include/freetype2/freetype/freetype.h:24:2: #error " #include FT_FREETYPE_H" make[2]: *** [fc-lang.o] Error 1 make[2]: Leaving directory `/home/tmp/fontconfig-2.2.92/fc-lang'' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/tmp/fontconfig-2.2.92'' make: *** [all] Error 2 -------------- next part -------------- /tmp/fontconfig> autoconf configure.in:36: error: possibly undefined macro: AM_INIT_AUTOMAKE If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.in:37: error: possibly undefined macro: AM_MAINTAINER_MODE configure.in:55: error: possibly undefined macro: AM_CONFIG_HEADER configure.in:60: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL configure.in:61: error: possibly undefined macro: AM_PROG_LIBTOOL configure.in:73: error: possibly undefined macro: AM_CONDITIONAL /tmp/fontconfig> ./configure ./configure: line 1306: syntax error near unexpected token `fontconfig,'' ./configure: line 1306: `AM_INIT_AUTOMAKE(fontconfig, 2.2.93)''
> I think you are not using qtconfig correctly. Maybe my examples > here helpVery nice. I now use the font substitutions Bitstream Vera Sans -> Free Helvetian Bitstream Vera Sans Mono -> Free Courier Bitstream Vera Serif -> Free Times with QT 3.2.3, and everything looks the way I want it to (with the exception that single-glyph substitutions just don''t work with this version of QT). I uninstalled the superior QT 3.3.1 again because there was an incompatibility with Debian''s packaged KDE styles. Cheers, Stefan -- Stefan Baums Asian Languages and Literature University of Washington
On Thu, 2004-04-22 at 21:41, Stefan Baums wrote:> > Next question: Which version of Qt ? > > In my original post, I give version numbers for some of the > relevant software I have installed. QT is 3.2.3, which is the > most recent version available from Debian. Not even the unstable > or experimental distributions seem to have 3.3.2 yet. Compiling > QT 3.3.2 from source sounds daunting, and I''m not sure whether > Debian''s KDE will work with it, but I can try.It is a bit daunting and long. It should be backward compatible though.> > > IIRC 3.3.1 has fixes for fontconfig. See doc.trolltech.com for > > detailed changes. > > I couldn''t find the relevant information at that address. The > only changelog I found anywhere was at > > http://www.trolltech.com/products/qt/whatsnew.html > > and that does not mention fontconfig. > > StefanRelated: http://www.trolltech.com/developer/changes/changes-3.2.2.html QFont Load the correct font for characters that have the ''Unicode'' script assigned to them (e.g. the em-dash). Fix exact match for raw mode fonts. Fix conversion from Unicode to GB2312 to make Chinese appear correctly again when using xlfd fonts. http://www.trolltech.com/developer/changes/changes-3.3.0.html Added support for Xft2 client side fonts on X servers without the RENDER extension. http://www.trolltech.com/developer/changes/changes-3.3.1.html Fixed skipping of certain (bitmap) fonts for Xft2 when building up the font database. Peter
Stefan Baums <baums@u.washington.edu> ????????:> So the overall impression is that QT 3 uses Fontconfig > superficially and incorrectly.Yes.> This probably has to be fixed at > the QT end,Yes.> but in the meantime I would like to configure Fontconfig so I can > sidestep QT?s most egregious mistakes.I think the only way to work around your problem is to use qtconfig.>> You can adjust Qt font settings in qtconfig, which may or may >> not be installed with with Debian''s packaging. > > It is in the package qt3-qtconfig, but all it allows you to do is > to substitute one whole font for another. But I don?t want to > replace the whole of the Chinese fonts with some other fonts, just > the Cyrillic part of them. Also, even after I did specify in > qtconfig a substitution of ?Free Helvetian? for both ?AR PL KaitiM > GB? and ?AR SungtiL GB?, that didn''t have the slightest effect > when typing Cyrillic in kedit - it still uses the Cyrillic glyphs > from the Chinese font.I think you are not using qtconfig correctly. Maybe my examples here help: http://www.suse.de/~mfabian/suse-cjk/kde-font-setup.html qtconfig writes the setup to ~/.qt/qtrc. After using qtconfig, you should have some line like the following in qtrc: [Font Substitutions] Luxi Sans=Free Helvetian^eAR PL Mingti2L Big5^eAR PL SungtiL GB^eBaekmuk Gulim^eKochi Gothic^e "Luxi Sans" is the font you select in the user interface of your KDE application as the main font (Of course "Luxi Sans" is just an example here). In the substitution list, make sure that a font with nice Cyrillic glyphs comes before the Chinese fonts with the ugly Cyrillic glyphs. -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????
Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040424/3b277825/attachment.pgp
On Thu, 2004-04-22 at 20:36, Stefan Baums wrote:> > It probably is. Qt 3, can synthesize a missing font on the fly. > > That is actually another problem of QT that I wasn?t planning to > go into here and now, but since you bring it up... Apparently, QT > can substitute whole scripts that are missing in font X from font > Y, but not individual characters. Have a look at the attached > screenshot of one of my directories in Konqueror. The words with > the empty boxes are ?br?hm?? and ?????????. The font used for the > former (Bitstream Vera Sans) has some coverage of the Latin > script, but is lacking glyphs for the two characters ? and ?, and > QT seems incapable of recognising this and getting those glyphs > from another font. Similarly, the font used for ????????? (the > ugly Chinese one) has some coverage of Cyrillic, but does not > include a glyph for the character ?, which QT fails to supply from > another font. > > So the overall impression is that QT 3 uses Fontconfig > superficially and incorrectly. This probably has to be fixed at > the QT end, but in the meantime I would like to configure > Fontconfig so I can sidestep QT?s most egregious mistakes. > > > You can adjust Qt font settings in qtconfig, which may or may > > not be installed with with Debian''s packaging. > > It is in the package qt3-qtconfig, but all it allows you to do is > to substitute one whole font for another. But I don?t want to > replace the whole of the Chinese fonts with some other fonts, just > the Cyrillic part of them. Also, even after I did specify in > qtconfig a substitution of ?Free Helvetian? for both ?AR PL KaitiM > GB? and ?AR SungtiL GB?, that didn''t have the slightest effect > when typing Cyrillic in kedit - it still uses the Cyrillic glyphs > from the Chinese font. > > StefanNext question: Which version of Qt ? IIRC 3.3.1 has fixes for fontconfig. See doc.trolltech.com for detailed changes. We are investigating Indic script support for Scribus and 3.3 now can optionally support Tamil, but the application needs to have the correct headers inlcuded to support it. Hope that helps, Peter
I compiled and installed QT 3.3.1, and that improves things quite a bit. A suitable Cyrillic font is now selected, even without adding the .fonts.conf lines that Keith suggested. There are still some minor issues (for instance: a serifed Cyrillic font is chosen in the sans-serif context of the Quickbrowser menu), but the Chinese fonts definitely do not rear their Cyrillic heads any more. Another remaining problem is that QT still doesn?t fetch single glyphs from other fonts, so ?br?hm?? still has its empty boxes. But I?m quite happy with the overall improvement, thanks for suggesting the QT upgrade. Stefan -- Stefan Baums Asian Languages and Literature University of Washington
Stefan Baums <baums@u.washington.edu> ????????:> Further puzzling aspects of this: The same problem does not occur > with Greek, even though the situation seems to be parallel to the > Cyrillic case, with the two Chinese fonts containing some Greek > glyphs. And neither "fc-list :lang=ru" nor "fc-list :lang=el" > actually lists the Chinese fonts that based on visual appearance I > identified as likely culprits.These Chinese fonts are not complete enough neither for Russian nor for Greek. But Qt doesn''t notice because Qt only checks U+0410 for Cyrillic and U+0390 for Greek. If U+0410 is there, Qt assumes the font supports Cyrillic, if U+0390 is there, Qt assumes the font supports Greek. As Qt doesn''t check any other characters and doesn''t ask fontconfig whether the fonts really supports Russian or Greek, Qt will not notice if important characters for Greek or Russian are missing. -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????