On 12/05/2011 08:37 PM, Craig Ringer wrote:
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.
Just by way of a follow-up, it appears that the issue can be worked
around - albeit clumsily - by registering each font manually in the
config file, specifying a different family name for condensed and
non-condensed variants. I can then select the condensed face by asking
for "Helvetica Neue LT Condensed" as the family. It's clunky and clumsy
to set up, but it does work. See the generated config file snippet below
for an example.
I recently stopped using Fop's Java API to configure my embedded fop
instance; now I generate a temporary config file and have fop read that
in. It's verbose and roundabout, but gives access to features like the
<fonts><directory> directive and now the <fonts><font> directive that
aren't exposed via the Java API. Given that, it's not too hard to
generate these font-info directives and clone them for both renderers,
it's just going to be a real hassle to maintain the font list.
Any idea how big a job it'd be to get fop to recognise condensed and
expanded fonts, track that info alongside the weight and slant, and use
font-stretch to select fonts based on it? I'm not asking someone to do
the work for me, I'm just looking for an idea of what sort of scale the
job would be. Major restructure throughout fop? Changes flowing
throughout fop but not particularly complex ones except for the font
classifier enhancements? Relatively trivial?
Here's the config file snippet I'm using to get my fonts to work in the
mean time. In reality there are plenty more fonts, but here's how it works:
<fonts>
<font
embed-url="file:/opt/jboss/classads/fonts/HelveticaNeueLTStd-Roman.ttf">
<font-triplet name="Helvetica Neue LT" style="normal" weight="400"/>
</font>
<font embed-url="file:/opt/jboss/classads/fonts/HelveticaNeueLTStd-Cn.ttf">
<font-triplet name="Helvetica Neue LT Condensed" style="normal"
weight="400"/>
</font>
<font
embed-url="file:/opt/jboss/classads/fonts/HelveticaNeueLTStd-BdCn.ttf">
<font-triplet name="Helvetica Neue LT Condensed" style="normal"
weight="700"/>
</font>
<font
embed-url="file:/opt/jboss/classads/fonts/HelveticaNeueLTStd-BlkCn.ttf">
<font-triplet name="Helvetica Neue LT Condensed" style="normal"
weight="900"/>
</font>
</fonts>
--
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/