From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830 Description of problem: fc-cache doesn't create entries in fonts.cache-1 for all .pcf files in the directory. It also doesn't give any error messages saying why this is. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.mkdir ~/.fonts 2.cd ~/.fonts 3.gunzip -c /usr/X11R6/lib/X11/fonts/misc/clB6x10.pcf.gz > clB6x10.pcf 4.fc-cache -v Actual Results: An empty fonts-cache.1 file in ~/.fonts Expected Results: A fonts-cache.1 file describing the 6x10 bold font in the Clean family that's in clB6x10.pcf Additional info:
I initially filed this bug: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=75436 Then I learned about the new font system, and tried to get the schumacher-clean fonts in the manner suggested, and came across this problem.
It's skipping them because of this bit of code at fontconfig/src/fcfreetype.c:519: /* * 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; }
This happens because it doesn't understand the encoding ISO646.1991-IRV. I think ISO646 is straight 7 bit ASCII. If I comment out that test, I end up with a font that has no glyphs. The X server and xfs understand this encoding, so I don't know why fc-cache doesn't seem to be able to.
Fixed the problem. First: mkdir ~/.fonts cd /usr/X11R6/lib/X11/fonts/misc for file in cl*; do gunzip -c "$file" >~/.fonts/I"${file%.gz}"; done cd ~/.fonts ------------------- Then I ran this python script: #!/usr/bin/python import mmap import os def fixfile(fname): f = open(fname, 'r+') a = mmap.mmap(f.fileno(), os.fstat(f.fileno())[6], access = mmap.ACCESS_WRITE) i = a.find('CHARSET_REGISTRY\0ISO646.1991\0CHARSET_ENCODING\0IRV\0') replace = 'CHARSET_REGISTRY\0ISO8859\0\0\0\0\0CHARSET_ENCODING\0001\0\0\0' if i != -1: a[i:i+len(replace)] = replace a.flush() flist = os.listdir() for fname in flist: if fname[0] = 'I': fixfile(fname) -------------------- Then I ran fc-cache. It create a nice fonts.cache-1 file for me in which all of the .pcf files have a reasonable correct entry. fc-cache still should more reasonably handle the ISO646.1991-IRV registry, and any other weird registry that might show up in a .pcf file.
The problem is that to handle most of the interesting encodings requires a whole recoding framework, which isn't a direction that Keith Packard is interested in for fontconfig. The general direction that people are discussing is getting rid of .pcf files for storing bitmap fonts and using bitmaps stored TrueType font file format instead.
This sounds wonderful, but there then needs to be some sort of conversion utility to convert old pcf fonts to TrueType bitmap fonts. The recoding framework will be nicely isolated there, but it needs to be there. I can't live without the schumacher-clean family. At least, not until 3200x2400 displays are standard so I can get tiny text that has enough dots to be rendered well. Of course, my ugly hack handles the schumacher-clean family well. So my personal irritation is gone.