Haakon Riiser
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
I have a collection of old bitmap fonts (BDF format) that I''d like to use with fontconfig. The problem is that the fonts'' glyphs are replaced with some other system font when CHARSET_REGISTRY and CHARSET_ENCODING is not equal to "ISO8859" and "1". I tried setting LC_ALL to all sorts of things, but that didn''t have any effect. The fonts in question are in IBM codepage 437; in this particular case, I could just edit the fonts and specify ISO8859-1, but I don''t understand why I have to lie about the charset to please fontconfig. Is this a bug, or can I fix it by editing ~/.fonts.conf or something like that? Btw, my OS is Slackware Linux 10.1, which uses X.org 6.8.1. -- Haakon
On Fri, 2005-02-25 at 16:19 +0100, Haakon Riiser wrote:> [Owen Taylor] > > > Haakon Riiser wrote: > > >I have a collection of old bitmap fonts (BDF format) that I''d like > > >to use with fontconfig. The problem is that the fonts'' glyphs > > >are replaced with some other system font when CHARSET_REGISTRY > > >and CHARSET_ENCODING is not equal to "ISO8859" and "1". I tried > > >setting LC_ALL to all sorts of things, but that didn''t have > > >any effect. The fonts in question are in IBM codepage 437; in > > >this particular case, I could just edit the fonts and specify > > >ISO8859-1, but I don''t understand why I have to lie about the > > >charset to please fontconfig. > > > > > >Is this a bug, or can I fix it by editing ~/.fonts.conf or > > >something like that? Btw, my OS is Slackware Linux 10.1, which > > >uses X.org 6.8.1. > > > > Neither a bug nor something you can fix without reencoding the > > fonts to Unicode (ISO10646-1). fontconfig only supports a couple of > > encodings other than Unicode. > > > > The complexity and overhead to support all the encodings that BDF fonts > > are found in just doesn''t make sense considering their legacy > > status. > > Just using the font as if it were ISO10646-1 would be good enough. > Should''t that be a trivial patch? It is, at least, much better than > the current behavior, which I don''t see any use for.To this I can only reply: Noooooooooooooooooooooooooooooooo. If an input stream has a ? in it, then that should come out as a ? or nothing. It should never come out as a ?. Misencoding input text in order to match a misencoded (or misinterpreted) font is one of the ultimate evils of the font and text handling world. Regards, Owen
On Fri, 2005-02-25 at 22:22 +0100, Haakon Riiser wrote:> > Misencoding input text in order to match a misencoded (or > > misinterpreted) font is one of the ultimate evils of the font > > and text handling world. > > I don''t see it as a problem, but OK. Here''s another idea: how > about making it possible to define aliases for font encodings in > fonts.conf? Then I could tell fontconfig that IBM cp437 is another > name for ISO8859-1; there would be no side effect for people who > don''t specifically ask for it, and everyone is happy. :-)cp-437 and iso-8859-1 are *not* the same. If you don''t care, munge your font, just don''t give it to anybody else. Regards, Owen
Haakon Riiser
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
[Owen Taylor]> Haakon Riiser wrote: > >I have a collection of old bitmap fonts (BDF format) that I''d like > >to use with fontconfig. The problem is that the fonts'' glyphs > >are replaced with some other system font when CHARSET_REGISTRY > >and CHARSET_ENCODING is not equal to "ISO8859" and "1". I tried > >setting LC_ALL to all sorts of things, but that didn''t have > >any effect. The fonts in question are in IBM codepage 437; in > >this particular case, I could just edit the fonts and specify > >ISO8859-1, but I don''t understand why I have to lie about the > >charset to please fontconfig. > > > >Is this a bug, or can I fix it by editing ~/.fonts.conf or > >something like that? Btw, my OS is Slackware Linux 10.1, which > >uses X.org 6.8.1. > > Neither a bug nor something you can fix without reencoding the > fonts to Unicode (ISO10646-1). fontconfig only supports a couple of > encodings other than Unicode. > > The complexity and overhead to support all the encodings that BDF fonts > are found in just doesn''t make sense considering their legacy > status.Just using the font as if it were ISO10646-1 would be good enough. Should''t that be a trivial patch? It is, at least, much better than the current behavior, which I don''t see any use for. -- Haakon
Haakon Riiser
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
[Owen Taylor]> On Fri, 2005-02-25 at 16:19 +0100, Haakon Riiser wrote:>> Just using the font as if it were ISO10646-1 would be good >> enough. Should''t that be a trivial patch? It is, at least, >> much better than the current behavior, which I don''t see any >> use for.> To this I can only reply: > > Noooooooooooooooooooooooooooooooo. > > If an input stream has a ? in it, then that should come out as > a ? or nothing. It should never come out as a ???. > > Misencoding input text in order to match a misencoded (or > misinterpreted) font is one of the ultimate evils of the font > and text handling world.I don''t see it as a problem, but OK. Here''s another idea: how about making it possible to define aliases for font encodings in fonts.conf? Then I could tell fontconfig that IBM cp437 is another name for ISO8859-1; there would be no side effect for people who don''t specifically ask for it, and everyone is happy. :-) -- Haakon
Keith Packard
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
Around 22 o''clock on Feb 25, Haakon Riiser wrote:> I don''t see it as a problem, but OK. Here''s another idea: how > about making it possible to define aliases for font encodings in > fonts.conf?Transcoding BDF fonts is not rocket science; if you want fontconfig to know what codepoints are covered by a font, you''ll just need to present it with some way to get correct Unicode encoding tables for the font. The problem here is not in fontconfig, but (maybe) Freetype which is missing any kind of support for non-Unicode (or Latin-1) encodings for BDF fonts. As BDF fonts have so many other troubles, it''s not exactly encouraging anyone to go try to fix this; I''m pushing to eliminate BDF/PCF fonts and replace them with bitmap glyphs encoded in true type files (SFNT), which seems better in all ways to me. -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/20050225/ed2c1e69/attachment.pgp
Haakon Riiser
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
> I have a collection of old bitmap fonts (BDF format) that I''d like > to use with fontconfig. The problem is that the fonts'' glyphs > are replaced with some other system font when CHARSET_REGISTRY > and CHARSET_ENCODING is not equal to "ISO8859" and "1".Here''s what happens when I view the font with gnome-font-viewer: ISO8859-1: http://folk.uio.no/hakonrk/tmp/bdf-iso8859-1.png Any other encoding (ISO8859-2 was used in this example): http://folk.uio.no/hakonrk/tmp/bdf-iso8859-2.png -- Haakon
Haakon Riiser wrote:> I have a collection of old bitmap fonts (BDF format) that I''d like > to use with fontconfig. The problem is that the fonts'' glyphs > are replaced with some other system font when CHARSET_REGISTRY > and CHARSET_ENCODING is not equal to "ISO8859" and "1". I tried > setting LC_ALL to all sorts of things, but that didn''t have > any effect. The fonts in question are in IBM codepage 437; in > this particular case, I could just edit the fonts and specify > ISO8859-1, but I don''t understand why I have to lie about the > charset to please fontconfig. > > Is this a bug, or can I fix it by editing ~/.fonts.conf or > something like that? Btw, my OS is Slackware Linux 10.1, which > uses X.org 6.8.1.Neither a bug nor something you can fix without reencoding the fonts to Unicode (ISO10646-1). fontconfig only supports a couple of encodings other than Unicode. The complexity and overhead to support all the encodings that BDF fonts are found in just doesn''t make sense considering their legacy status. Regards, Owen
Keith Packard
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
Around 21 o''clock on Feb 28, Dmitry Karasik wrote:> Please don''t, at least for iso-8859-1 and iso-10646-1 encodings. I see > where the new font layout would shine brighter, but probably it''s better to not > fix what ain''t broken?For 10646, PCF is a really bad idea -- it uses an uncompressed array for the codepoint->glyph mapping table, which means you cannot spread glyphs across the unicode range without exploding file sizes. Even for Latin-1, using TTF is a win as we can ship all of the bitmap sizes in a single file, saving significant space and effort. Fewer files, less disk space, better i18n support, better performance. There is no downside here, only a bit of code to ensure all of the legacy XLFD properties are translated appropriately. -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/20050228/191d7b2c/attachment.pgp
Dmitry Karasik
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
Keith> As BDF fonts have so many other troubles, it''s not exactly Keith> encouraging anyone to go try to fix this; I''m pushing to eliminate Keith> BDF/PCF fonts and replace them with bitmap glyphs encoded in true Keith> type files (SFNT), which seems better in all ways to me. Please don''t, at least for iso-8859-1 and iso-10646-1 encodings. I see where the new font layout would shine brighter, but probably it''s better to not fix what ain''t broken? -- Sincerely, Dmitry Karasik
Dmitry Karasik
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
Hi Keith! On 28 Feb 05 at 22:02, "Keith" (Keith Packard) wrote: Keith> --==_Exmh_41322760P Content-Type: text/plain; charset=utf-8 Keith> Around 21 o''clock on Feb 28, Dmitry Karasik wrote: >> Please don''t, at least for iso-8859-1 and iso-10646-1 encodings. I see >> where the new font layout would shine brighter, but probably it''s >> better to not fix what ain''t broken? Keith> For 10646, PCF is a really bad idea -- it uses an uncompressed Keith> array for the codepoint->glyph mapping table, which means you Keith> cannot spread glyphs across the unicode range without exploding Keith> file sizes. Keith> Even for Latin-1, using TTF is a win as we can ship all of the Keith> bitmap sizes in a single file, saving significant space and effort. Wait, when you used word ''eliminate'' in the previous message does that mean that PCF/BDF fonts simply wouldn''t be shipped in the future, or, in the contrary, wouldn''t be recognized any longer? I thought that it is the latter, because I''ve had at least one problem with newer fontconfig, when it displayed first 128 glyphs only out of my non-latin PCF files. If it is just about shipping, well, the request is cancelled. -- Sincerely, Dmitry Karasik
Keith Packard
2005-Nov-21 08:51 UTC
[Fontconfig] fontconfig 2.2.3 only works with iso8859-1
Around 23 o''clock on Feb 28, Dmitry Karasik wrote:> Wait, when you used word ''eliminate'' in the previous message does that > mean that PCF/BDF fonts simply wouldn''t be shipped in the future, or, > in the contrary, wouldn''t be recognized any longer?Just that we''d take the existing BDF fonts and convert them to TTF wrapped bitmaps and then discarding the BDF files. With that done, we won''t ever need to ''compile'' the fonts again. The piece missing here is an application that takes a single TTF file and generates the dozens of BDF files it represents so that we can still get BDF files when needed, and so we can validate that the conversion process is at least round-trippable. I doubt the FreeType project is planning on discarding BDF/PCF support, but I also doubt they''re planning on making it work a whole lot better than it does today, and it''s pretty minimal at present (not supporting anything other than Latin-1 and Unicode encoded fonts). -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/20050228/24698cd6/attachment.pgp