Hi Nancy,

nancy_b wrote:
> Hi all,
> 
> My environment: Docbook stylesheets, XSLTPROC, FOP 0.95
> I would like to produce some headings in allcaps. So I've added the
> following in my customization layer:
> <xsl:template match="emphas...@role = 'smallcaps']">
> <fo:inline font-variant="small-caps">
>   <xsl:apply-templates/>
> </fo:inline>
> </xsl:template>
> 
> In my source file I entered:
> <emphasis role="smallcaps">Example</emphasis>
> 
> After compiling a PDF, guess what happened? Nothing :-(

The font-variant property is not supported by FOP. All you can do is
implement tricks to work around that missing feature.

You could fake small capitals by transforming the piece of text into
capitals and reducing the font size to, e.g., 70%:
    <fo:block>E<fo:inline font-size="70%">XAMPLE</fo:inline>...</fo:block>
Probably the easiest, but the result will look ugly.

If you know which font you are going to use, know that that font has
glyphs for small capitals, know the Unicode code points of those
glyphs, then you could replace every letter with the appropriate
codepoint and you will get the true small capitals. Much less easy, but
the result will look good.

For example, the Junicode font [1] has glyphs for small capitals. Those
glyphs are stored in the ‘Private Use Area’ range of the Unicode
standard, from U+F761 to U+F77A (non-accented versions only...). So you
would have to produce the following:
    <fo:block
font-family="Junicode">E&#xF778;&#xF761;&#xF76D;&#xF770;&#xF76C;&#xF765;
    and the rest of the text...</fo:block>

Who said cryptic? :-)

This is more or less how the font-variant property would work.

[1] http://junicode.sourceforge.net/


> Do you have any idea how to solve this, folks?
> 
> Thanks a lot in advance!!!


HTH,
Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to