> The easy fix is to figure out why all of these proportional faces are > getting added to the pattern; you''ll have to examine your configuration to > figure that out.My configuration is unchanged from what fontconfig 2.2.0 shipped with (on Debian testing, but I don''t think Debian changed anything important). All I have is /etc/fonts/fonts.conf and /etc/fonts/local.conf, and they are untouched. Isn''t it more likely that this is something to do with KDE, seeing that GNOME applications get it right on my system? Or do you mean I should try to add something to my default fontconfig configuration to make it impossible for misbehaving KDE to get the fonts that it requests but that I don''t want? S. -- Stefan Baums Asian Languages and Literature University of Washington
> This does appear to be the fault of Qt or KDE -- it''s asking for > ''bitstream vera sans mono'' and if that''s not available, use ''sans'' instead.I reported this as KDE bug no. 57928: http://bugs.kde.org/show_bug.cgi?id=57928 Feel free to vote for this bug, or add additions or corrections to the bug report. Many thanks for your help, Stefan -- Stefan Baums Asian Languages and Literature University of Washington
> You can debug this with: > > $ FC_DEBUG=1 keditOK, I attach the output of that, and yes, it is cryptic. (What I did is, I started kedit, entered exactly one, Cyrillic character, and exited kedit.) Maybe you can see what''s going on. The Cyrillic font in question seems to be the last one in the debug output, Nimbus Sans L, clearly not a monospace font to begin with. Stefan -- Stefan Baums Asian Languages and Literature University of Washington -------------- next part -------------- FC_DEBUG=1 Match Pattern 19 of 32 antialias: FcTrue(s) autohint: FcFalse(s) dpi: 106.017(f)(s) family: "bitstream vera sans"(s) "Bitstream Vera Sans"(w) "Verdana"(w) "Nimbus Sans L"(w) "Luxi Sans"(w) "Arial"(w) "Helvetica"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "Baekmuk Dotum"(w) "SimSun"(w) "sans-serif"(w) "sans-serif"(w) fontversion: 2147483647(i)(s) globaladvance: FcTrue(s) hinting: FcTrue(s) lang: "zh-TW"(s) maxglyphmemory: 1048576(i)(s) minspace: FcFalse(s) pixelsize: 17.6696(f)(s) render: FcTrue(s) rgba: 2(i)(s) scale: 1(f)(s) size: 12(f)(s) slant: 0(i)(s) verticallayout: FcFalse(s) weight: 100(i)(s) width: 100(i)(s) Best score 0 0 0 200 1 0 0 0 0 2000 0 0 0 0 2.14735e+11Pattern 13 of 13 charset: set(s) family: "Bitstream Vera Sans"(s) file: "/home/stefan/.fonts/Vera.ttf"(s) fontversion: 131072(i)(s) foundry: "bitsteam"(s) index: 0(i)(s) lang: aa|ast|ay|bi|br|ch|co|da|de|en|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|ia|id|ie|io|is|it|lb|mg|nb|nl|nn|no|oc|om|pt|rm|sma|smj|so|sq|sv|sw|tn|tr|ts|vo|vot|wa|xh|yap|zu(s) outline: FcTrue(s) scalable: FcTrue(s) slant: 0(i)(s) style: "Roman"(s) weight: 80(i)(s) width: 100(i)(s) Match Pattern 19 of 32 antialias: FcTrue(s) autohint: FcFalse(s) dpi: 106.017(f)(s) family: "bitstream vera sans"(s) "Bitstream Vera Sans"(w) "Verdana"(w) "Nimbus Sans L"(w) "Luxi Sans"(w) "Arial"(w) "Helvetica"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "Baekmuk Dotum"(w) "SimSun"(w) "sans-serif"(w) "sans-serif"(w) fontversion: 2147483647(i)(s) globaladvance: FcTrue(s) hinting: FcTrue(s) lang: "zh-TW"(s) maxglyphmemory: 1048576(i)(s) minspace: FcFalse(s) pixelsize: 17.6696(f)(s) render: FcTrue(s) rgba: 2(i)(s) scale: 1(f)(s) size: 12(f)(s) slant: 0(i)(s) verticallayout: FcFalse(s) weight: 100(i)(s) width: 100(i)(s) Best score 0 0 0 200 1 0 0 0 0 2000 0 0 0 0 2.14735e+11Pattern 13 of 13 charset: set(s) family: "Bitstream Vera Sans"(s) file: "/home/stefan/.fonts/Vera.ttf"(s) fontversion: 131072(i)(s) foundry: "bitsteam"(s) index: 0(i)(s) lang: aa|ast|ay|bi|br|ch|co|da|de|en|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|ia|id|ie|io|is|it|lb|mg|nb|nl|nn|no|oc|om|pt|rm|sma|smj|so|sq|sv|sw|tn|tr|ts|vo|vot|wa|xh|yap|zu(s) outline: FcTrue(s) scalable: FcTrue(s) slant: 0(i)(s) style: "Roman"(s) weight: 80(i)(s) width: 100(i)(s) Match Pattern 20 of 32 antialias: FcTrue(s) autohint: FcFalse(s) dpi: 106.017(f)(s) family: "bitstream vera sans mono"(s) "Bitstream Vera Sans"(w) "Verdana"(w) "Nimbus Sans L"(w) "Luxi Sans"(w) "Arial"(w) "Helvetica"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "Baekmuk Dotum"(w) "SimSun"(w) "sans-serif"(w) "Bitstream Vera Sans Mono"(w) "Andale Mono"(w) "Courier New"(w) "Luxi Mono"(w) "Nimbus Mono L"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "Baekmuk Dotum"(w) "monospace"(w) fontversion: 2147483647(i)(s) globaladvance: FcTrue(s) hinting: FcTrue(s) lang: "zh-TW"(s) maxglyphmemory: 1048576(i)(s) minspace: FcFalse(s) pixelsize: 23.5594(f)(s) render: FcTrue(s) rgba: 2(i)(s) scale: 1(f)(s) size: 16(f)(s) slant: 0(i)(s) spacing: 100(i)(s) verticallayout: FcFalse(s) weight: 100(i)(s) width: 100(i)(s) Best score 0 0 0 200 13 0 0 0 0 2000 0 0 0 0 2.14735e+11Pattern 14 of 14 charset: set(s) family: "Bitstream Vera Sans Mono"(s) file: "/home/stefan/.fonts/VeraMono.ttf"(s) fontversion: 131072(i)(s) foundry: "bitsteam"(s) index: 0(i)(s) lang: aa|ast|ay|bi|br|ch|co|da|de|en|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|ia|id|ie|io|is|it|lb|mg|nb|nl|nn|no|oc|om|pt|rm|sma|smj|so|sq|sv|sw|tn|tr|ts|vo|vot|wa|xh|yap|zu(s) outline: FcTrue(s) scalable: FcTrue(s) slant: 0(i)(s) spacing: 100(i)(s) style: "Roman"(s) weight: 80(i)(s) width: 100(i)(s) Match Pattern 21 of 32 antialias: FcTrue(s) autohint: FcFalse(s) charset: set(s) dpi: 106.017(f)(s) family: "bitstream vera sans mono"(s) "Bitstream Vera Sans"(w) "Verdana"(w) "Nimbus Sans L"(w) "Luxi Sans"(w) "Arial"(w) "Helvetica"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "Baekmuk Dotum"(w) "SimSun"(w) "sans-serif"(w) "Bitstream Vera Sans Mono"(w) "Andale Mono"(w) "Courier New"(w) "Luxi Mono"(w) "Nimbus Mono L"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "Baekmuk Dotum"(w) "monospace"(w) fontversion: 2147483647(i)(s) globaladvance: FcTrue(s) hinting: FcTrue(s) lang: "zh-TW"(s) maxglyphmemory: 1048576(i)(s) minspace: FcFalse(s) pixelsize: 23.5594(f)(s) render: FcTrue(s) rgba: 2(i)(s) scale: 1(f)(s) size: 16(f)(s) slant: 0(i)(s) spacing: 100(i)(s) verticallayout: FcFalse(s) weight: 100(i)(s) width: 100(i)(s) Best score 0 0 100 200 3 0 0 0 0 0 0 0 0 0 2.14748e+11Pattern 12 of 12 charset: set(s) family: "Nimbus Sans L"(s) file: "/usr/share/fonts/type1/scalable-cyrfonts/n019003d.pfb"(s) fontversion: 0(i)(s) foundry: "urw"(s) index: 0(i)(s) lang: aa|ab|af|ast|ava|ay|ba|be|bg|bi|br|bs|bua|ca|ce|ch|chm|co|cs|cv|da|de|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|ik|io|is|it|kaa|ki|kk|kl|ku|kum|kv|ky|la|lb|lez|lt|lv|mg|mh|mk|mt|nb|nl|nn|no|ny|oc|om|os|pl|pt|rm|ru|sah|se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|sv|sw|tg|tk|tn|tr|ts|tt|tyv|uk|uz|vo|vot|wa|wen|wo|xh|yap|zu(s) outline: FcTrue(s) scalable: FcTrue(s) slant: 0(i)(s) style: "Regular"(s) weight: 100(i)(s)
OK, I also got the verbose and even more cryptic debug output for the same kedit actions and put it up on http://staff.washington.edu/baums/debug-long.txt That''s 1.6 megabytes. S. -- Stefan Baums Asian Languages and Literature University of Washington
> Let''s try to get > that information out of the application: > > $ FC_DEBUG=5 keditOK, did that and put the output on http://staff.washington.edu/baums/debug-5.txt (37 kilobytes). S. -- Stefan Baums Asian Languages and Literature University of Washington
Around 21 o''clock on Apr 29, Stefan Baums wrote:> the KDE application (tested kedit and konsole) gets a proportional font and > apparently tries to force monospacing onto it, which results in glyphs that > are spaced so far apart that they end up taking much more space than the > Latin-script glyphs (and being so ugly that this has to be considered a bug > for aesthetic reasons alone)You can debug this with: $ FC_DEBUG=1 kedit That should spew copious cryptic output about what font patterns are presented to fontconfig to select fonts, and what fonts those patterns end up matching. Even more copious output can be had with FC_DEBUG=3. It''s hard to say why kedit ended up with a hideous non-fixed font for cyrillic, most likely it didn''t specify monospaced in it''s pattern or may have overspecified the font name in some other way. -keith
Around 22 o''clock on Apr 29, Stefan Baums wrote:> family: "bitstream vera sans mono"(s) "Bitstream Vera Sans"(w) "Verdana"(w) "Nimbus Sans L"(w) "Luxi Sans"(w) "Arial"(w) "Helvetica"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "AR PL KaitiM Big5"(w) "Baekmuk Dotum"(w) "SimSun"(w) "sans-serif"(w) "Bitstream Vera Sans Mono"(w) "Andale Mono"(w) "Courier New"(w) "Luxi Mono"(w) "Nimbus Mono L"(w) "Kochi Gothic"(w) "AR PL KaitiM GB"(w) "Baekmuk Dotum"(w) "monospace"(w)Applications present a list of family names to fontconfig for matching. This list is amended in various ways by the match/edit rules in the configuration. Your configuration is adding all of the proportional sans-serif faces before the monospaced faces for some reason, so they are preferred in the match which is why you''re getting the wrong result. The easy fix is to figure out why all of these proportional faces are getting added to the pattern; you''ll have to examine your configuration to figure that out. Another possibility is to reconsider the precedence of various attributes used in matching fonts by fontconfig. Family names are placed in two classes before matching; ''strong'' values ((s) above) are more important than language bindings while ''weak'' values ((w) above) are less important. Both kinds of family names are more important than spacing values, and perhaps that should be reconsidered. -keith
Around 8 o''clock on Apr 30, Stefan Baums wrote:> All I have is /etc/fonts/fonts.conf and /etc/fonts/local.conf, and they are > untouched. Isn''t it more likely that this is something to do with KDE, > seeing that GNOME applications get it right on my system?This problem clearly has something to do with the difference between patterns presented by KDE and those presented by Gnome, but fontconfig should be able to get the right answer in both cases unless the KDE application is sending something wrong to the library. Let''s try to get that information out of the application: $ FC_DEBUG=5 kedit should show both the original pattern presented by the application and the edits applied by the configuration before matching occurs. That''ll tell whether KDE is doing something unexpected or whether the Debian fontconfig package has some ''improvements'' which generate the wrong result in this case. -keith
Around 11 o''clock on Apr 30, Stefan Baums wrote:> FcConfigSubstitute Pattern 5 of 16 > family: "bitstream vera sans mono"(s) "sans"(s) > size: 16(f)(s) > slant: 0(i)(s) > spacing: 100(i)(s) > weight: 100(i)(s)This does appear to be the fault of Qt or KDE -- it''s asking for ''bitstream vera sans mono'' and if that''s not available, use ''sans'' instead. It should be using ''monospace'' instead of ''sans'' for that second entry, or alternatively not including that second entry at all. To kludge around this, you might try: <match target="pattern"> <test name="family"> <string>sans-serif</string> </test> <test name="family"> <string>monospace</string> </test> <edit name="family"> <string>monospace</string> </edit> </match> in ~/.fonts.conf This will switch patterns using sans-serif and monospace to prefer monospace instead of sans-serif. -keith
Dear list, I am using fontconfig 2.2.0, GNOME 2.2 and KDE 3.1. When I set the display font in a GNOME application on the one hand and in a KDE application on the other hand to the exact same setting (e.g., Bitstream Vera Mono), the two applications exhibit different strategies for supplying monospace Cyrillic characters that are not contained in the selected display font. The GNOME application (gedit for test purposes) will take Cyrillic characters from a monospace font (in this case, some Courier-like font that looks quite different from Bistream Vera Mono): http://staff.washington.edu/baums/gnome.png which is fine, while the KDE application (tested kedit and konsole) gets a proportional font and apparently tries to force monospacing onto it, which results in glyphs that are spaced so far apart that they end up taking much more space than the Latin-script glyphs (and being so ugly that this has to be considered a bug for aesthetic reasons alone): http://staff.washington.edu/baums/kedit.png The result is especially gruesome in konsole, where we get some weird overlap making the Cyrillic text illegible: http://staff.washington.edu/baums/konsole-1.png and where scrolling down will lead to screen corruption: http://staff.washington.edu/baums/konsole-2.png Is this something that should or can be fixed at the fontconfig level, or does the bug lie with QT / KDE and should be brought to those good people''s attention? Regards, Stefan -- Stefan Baums Asian Languages and Literature University of Washington