Hi all
As part of some work I'm doing with fop (1.0) at the moment I need to
select a condensed face for a font. This is proving harder than expected
and I thought I'd seek some advice here.
This is /not/ a question about the creation of "fake condensed" faces to
support the font-stretch property. That's not what I'm after. I have a
full set of condensed and regular faces and don't need to fake a
condensed face.
The problem is that fop appears to be misclassifying the font faces I
have, and that there's no apparent way to tell fop "I want a condensed
face" even if they were classified correctly.
I'm loading the fonts by having fop scan the directory they're in using
the <fonts><directory> config param and it's finding them fine. However,
Fop doesn't seem to be able to tell the difference between the condensed
and non-condensed faces of these fonts. It also seems to think they all
have the same weight (400) as per the log excerpts below.
So:
- Any idea why fop might think all the fonts its examining have the same
weight and slant?
- If I have both condensed and non-condensed variants of a font, how can
I select which face to use? The font-stretch property is what I'd expect
to be able to use, but fop doesn't seem to be aware of font stretch. Is
there any way I can do this?
Here's an excerpt of the log output from fop where it detects the fonts.
The full log is at http://pastebin.com/91u9bW10 . You can see that it
seems unable to distinguish the weights or how condensed they are:
Registering: HelveticaNeueLT Std Cn,normal,400 under F17
HelveticaNeueLT Std Cn,normal,400: Replacing HelveticaNeueLTStd-BdCn
(priority=23) by HelveticaNeueLTStd-Cn (priority=21)
Registering: HelveticaNeueLTStd-BlkCn,normal,400 under F18
Registering: Helvetica Neue LT Std,normal,400 under F18
Helvetica Neue LT Std,normal,400: Not replacing HelveticaNeueLTStd-Cn
(priority=21) by HelveticaNeueLTStd-BlkCn (priority=24)
Registering: HelveticaNeueLT Std Blk Cn,normal,400 under F18
By contrast, fontconfig identifies them as I'd expect:
$ fc-list | grep Neue
Helvetica Neue LT Std:style=55 Roman,Regular
Helvetica Neue LT Std,HelveticaNeueLT Std Cn:style=57 Condensed,Regular
Helvetica Neue LT Std,HelveticaNeueLT Std Blk Cn:style=97 Black
Condensed,Regular
Helvetica Neue LT Std,HelveticaNeueLT Std Cn:style=77 Bold Condensed,Bold
These were originally OpenType fonts with CFF outlines; they were
converted to TrueType using FontForge. They behave as expected with
other tools including FontConfig and can be used normally in apps.
Ideas?
Will I have to manually register these fonts via the Java API
one-by-one, coming up with a fake family name for the condensed variants
so I can select them by family name?
--
Craig Ringer
POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088 Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/