OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] embedding fonts in epub? (and docbook for publishers -- hurrah!)


Oh, right, there is also the 'manifest.fonts' template specifically for that.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net

On 11/30/2015 8:41 AM, Martin Doucha wrote:
Dne 30.11.2015 v 09:32 Robert Nagle napsal(a):
I'm at the final stages of making an epub file, and I was wondering
if there's an easy way to declare a font file for embedding.

Simply add a template like this to your custom XSL file for epub:

<xsl:template name="manifest.fonts">
<xsl:element name="item" namespace="{$opf.namespace}">
<xsl:attribute name="id">some-unique-id</xsl:attribute>
<xsl:attribute name="href">path/to/font.ttf</xsl:attribute>
<xsl:attribute name="media-type">application/x-font-ttf</xsl:attribute>
</xsl:element>
<xsl:element name="item" namespace="{$opf.namespace}">
<xsl:attribute name="id">some-unique-id2</xsl:attribute>
<xsl:attribute name="href">path/to/font2.otf</xsl:attribute>
<xsl:attribute name="media-type">application/x-font-ttf</xsl:attribute>
</xsl:element>
</xsl:template>

Attribute "id" can contain any string you like, it just needs to be
unique within the manifest file. Attribute "href" is the path to the
font file relative to the manifest file. Attribute "media-type" is MIME
type of the font file. Make sure to set the value correctly if you use
other font formats than TTF.

If you'd like to see an example of Epub with embedded fonts:
https://swarmwise.pirati.cz/swarmwise.epub

Regards,
Martin Doucha



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]