Hello! For a long time now I strugle with support for bitmap fonts in GTK applications. Finally I''ve installed newer fontconfig library (version 2.32) and added link to /etc/fonts/conf.d/yes-bitmaps.conf. So now in font selection dialog I see family Fixed. There are various styles for it. But when I try to select style SemiCondensed I get bold font. In fact there''s style "Bold SemiCondensed", but they both appear to be the same. What could be the problem here? Also, I have cyrillic bitmap fonts in /usr/X11R6/lib/X11/fonts/cyrillic directory. For whatever reason the fonts.cache-1 file in it is empty, fc-cache -v says fc-cache: "/usr/X11R6/lib/X11/fonts/cyrillic": caching, 0 fonts, 0 dirs Why doesn''t it find any fonts in it, when regular xlsfont lists all fonts from that directory? Thank you -- Minds, like parachutes, function best when open
Hi, since nobody could help me in this I''ve tried to look into it myself :) On Thu, Mar 23, 2006 at 05:57:37PM +0100, Andrei A. Voropaev wrote:> Also, I have cyrillic bitmap fonts in /usr/X11R6/lib/X11/fonts/cyrillic > directory. For whatever reason the fonts.cache-1 file in it is empty, > fc-cache -v says > > fc-cache: "/usr/X11R6/lib/X11/fonts/cyrillic": caching, 0 fonts, 0 dirs > > Why doesn''t it find any fonts in it, when regular xlsfont lists all > fonts from that directory?This appears to be because of this chunk of code in fcfreetype.c:1556 /* * Skip over PCF fonts that have no encoded characters; they''re * usually just Unicode fonts transcoded to some legacy encoding */ if (FcCharSetCount (cs) == 0) { if (!strcmp(FT_MODULE_CLASS(&face->driver->root)->module_name, "pcf")) goto bail2; } So I guess this applies to cyrillic koi8-r fonts :) Or it could be that I have some "incorrect" version of freetype library.> > For a long time now I strugle with support for bitmap fonts in GTK > applications. Finally I''ve installed newer fontconfig library (version > 2.32) and added link to /etc/fonts/conf.d/yes-bitmaps.conf. So now in > font selection dialog I see family Fixed. There are various styles for > it. But when I try to select style SemiCondensed I get bold font. In > fact there''s style "Bold SemiCondensed", but they both appear to be the > same. What could be the problem here?I guess here, knowing of the correspondence between font name (Fixed 12) and the actual file from which this font comes would be of great help. Is there some debugging options that I could set to get this information? Or can I obtain it using fc-list for example? Thank you -- Minds, like parachutes, function best when open
Andrei A. Voropaev wrote:> On Thu, Mar 23, 2006 at 05:57:37PM +0100, Andrei A. Voropaev wrote: >> Also, I have cyrillic bitmap fonts in /usr/X11R6/lib/X11/fonts/cyrillic >> directory. For whatever reason the fonts.cache-1 file in it is empty, >> fc-cache -v says >> >> fc-cache: "/usr/X11R6/lib/X11/fonts/cyrillic": caching, 0 fonts, 0 dirs >> >> Why doesn''t it find any fonts in it, when regular xlsfont lists all >> fonts from that directory? > > This appears to be because of this chunk of code in fcfreetype.c:1556 > > /* > * Skip over PCF fonts that have no encoded characters; they''re > * usually just Unicode fonts transcoded to some legacy encoding > */ > if (FcCharSetCount (cs) == 0) > { > if (!strcmp(FT_MODULE_CLASS(&face->driver->root)->module_name, "pcf")) > goto bail2; > } > > So I guess this applies to cyrillic koi8-r fonts :) Or it could be that > I have some "incorrect" version of freetype library.It would seem that there''s something fishy with those fonts.>> For a long time now I strugle with support for bitmap fonts in GTK >> applications. Finally I''ve installed newer fontconfig library (version >> 2.32) and added link to /etc/fonts/conf.d/yes-bitmaps.conf. So now in >> font selection dialog I see family Fixed. There are various styles for >> it. But when I try to select style SemiCondensed I get bold font. In >> fact there''s style "Bold SemiCondensed", but they both appear to be the >> same. What could be the problem here? > > I guess here, knowing of the correspondence between font name (Fixed 12) > and the actual file from which this font comes would be of great help. > Is there some debugging options that I could set to get this > information? Or can I obtain it using fc-list for example?fc-list : family file might be what you want... pat
On Tue, Mar 28, 2006 at 10:22:54AM -0500, Patrick Lam wrote:> Andrei A. Voropaev wrote: > > > > /* > > * Skip over PCF fonts that have no encoded characters; they''re > > * usually just Unicode fonts transcoded to some legacy encoding > > */ > > > > So I guess this applies to cyrillic koi8-r fonts :) Or it could be that > > I have some "incorrect" version of freetype library. > > It would seem that there''s something fishy with those fonts.Well, I wouldn''t be able to tell what''s wrong with them. At least they appear to be working fine. Oh well, that''s not as important.> > >> For a long time now I strugle with support for bitmap fonts in GTK > >> applications. Finally I''ve installed newer fontconfig library (version > > > > I guess here, knowing of the correspondence between font name (Fixed 12) > > and the actual file from which this font comes would be of great help. > > fc-list : family file might be what you want...Thank you. With that I could find exactly the pattern for the font I''m using in non-GTK applications. It appears to be misc/6x13.pcf.gz: Fixed:style=SemiCondensed:spacing=110 So, I tried to specify exactly this pattern for my application, but I still didn''t get the font. Well, I tried to use FC_DEBUG=3, but got 5M of output, so I''m not sure if I can get thru it trying to figure out why some different font is used :) Maybe some other value would be of more help? :) Also, could the problem be because I''ve compiled GTK libraries against older version of fontconfig, though ldd reports that the binary uses the current one (libfontconfig.so.1.0.4)? -- Minds, like parachutes, function best when open
Patrick Lam <plam@MIT.EDU> ????????:> Andrei A. Voropaev wrote: >> On Thu, Mar 23, 2006 at 05:57:37PM +0100, Andrei A. Voropaev wrote: >>> Also, I have cyrillic bitmap fonts in /usr/X11R6/lib/X11/fonts/cyrillic >>> directory. For whatever reason the fonts.cache-1 file in it is empty, >>> fc-cache -v says >>> >>> fc-cache: "/usr/X11R6/lib/X11/fonts/cyrillic": caching, 0 fonts, 0 dirs >>> >>> Why doesn''t it find any fonts in it, when regular xlsfont lists all >>> fonts from that directory? >> >> This appears to be because of this chunk of code in fcfreetype.c:1556 >> >> /* >> * Skip over PCF fonts that have no encoded characters; they''re >> * usually just Unicode fonts transcoded to some legacy encoding >> */ >> if (FcCharSetCount (cs) == 0) >> { >> if (!strcmp(FT_MODULE_CLASS(&face->driver->root)->module_name, "pcf")) >> goto bail2; >> } >> >> So I guess this applies to cyrillic koi8-r fonts :) Or it could be that >> I have some "incorrect" version of freetype library. > > It would seem that there''s something fishy with those fonts.They are koi8-r encoded. They cannot work with fontconfig as fontconfig supports only ISO-8859-1 and Unicode fonts. Therefore they are skipped using the above code. -- Mike FABIAN <mfabian@suse.de> http://www.suse.de/~mfabian ?????????????
On Tue, Mar 28, 2006 at 10:22:54AM -0500, Patrick Lam wrote:> Andrei A. Voropaev wrote:[...]> >> For a long time now I strugle with support for bitmap fonts in GTK > >> applications. Finally I''ve installed newer fontconfig library (version > >> 2.32) and added link to /etc/fonts/conf.d/yes-bitmaps.conf. So now in > >> font selection dialog I see family Fixed. There are various styles for > >> it. But when I try to select style SemiCondensed I get bold font. In > >> fact there''s style "Bold SemiCondensed", but they both appear to be the > >> same. What could be the problem here? > > > > I guess here, knowing of the correspondence between font name (Fixed 12) > > and the actual file from which this font comes would be of great help. > > Is there some debugging options that I could set to get this > > information? Or can I obtain it using fc-list for example? > > fc-list : family file might be what you want...Ok. Finally I was able to resolve the issue. Most likely it''s not as elegant as it could be, but here''s what I did for the record or when someone else has similar problem. In local.conf <match target="font"> <test qual="all" name="family" compare="eq"> <string>Fixed</string> </test> <test qual="all" target="pattern" name="size" compare="not_eq"> <int>12</int> </test> <edit name="file" binding="strong"> <string>/usr/X11R6/lib/X11/fonts/misc/6x13.pcf.gz</string> </edit> <edit name="style" binding="strong"> <const>87</const> </edit> <edit name="scalable" binding="strong"> <bool>false</bool> </edit> </match> This allows me to get exactly the font I like. The uglienness of this is that to edit some text containing Japanese I can''t use semicondensed font, so to get the regular width I have to request the font as "Fixed 12". But it works. Now some philosophical conclusions. As far as I can see, GTK + fontconfig do very good job in guessing which font would be the best, when there''s no input from the user. But after application is started, the user usually knows which available font is better, than the guessed one and definetely he wants to be able to select this specific font. At this point GTK+fontconfig fail miserably. It''s pretty much impossible to select the font the user wants. Even in MS Windows I can select the font that I want in one click. In this respect old system of XLFD worked much better. There at least, after identifying font in xfontsel, I know for sure that I''ll get it in the application. No, I don''t complain. Just wonder, why things go such an inefficient way. Is it that GTK font selector is so limited, or is it because fontconfig does not allow such an obvious action as selecting specific font? -- Minds, like parachutes, function best when open