I’ve attached a diff that adds a new feature to Image.FreeType. I’ve not committed this because some additional work will be required to properly integrate this feature with Image.Fonts. As it stands, the diff should not break compatibility, but it seems possible that proper support in Image.Fonts *might*.
Background: Certain font types supported by FreeType can contain multiple faces (be they varying weights or altogether unrelated typefaces) within a single font file. Currently, Image.FreeType and Image.Fonts will simply load the first face in the font file. I’ve noticed that, at least on MacOS X, the first font isn’t always a good default; for example, sometimes it might be a Bold-Oblique variant or whatever. It’d be nice to be able to access the others.
The diff makes 2 changes: first, it adds a new field, “face_count”, to the results of Font->info(). The second change is the addition of a second, optional parameter to Font->create(), which allows the face number within the font to be specified.
As I mentioned, it’d be nice to include support for this within Image.Fonts, though I’m not sure the best way to handle that. Any suggestions to that end would be welcome.
As always, comments and suggestions are welcome. If there are no objections after a time, I’ll commit this change to 8.0.
Bill
pike-devel@lists.lysator.liu.se