summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Rackham <srackham@methods.co.nz>2011-03-23 16:03:59 +1300
committerStuart Rackham <srackham@methods.co.nz>2011-03-23 16:03:59 +1300
commitbec1dd2ead5f47d01248767f1ddfc5833b912772 (patch)
treefce639f9c52040521cdb57ca9a648daa76b652b1
parent070ed60c2657f80715e7b799ca9dd0294e33447b (diff)
downloadasciidoc-bec1dd2ead5f47d01248767f1ddfc5833b912772.tar.gz
Documented how to include embedded fonts in an EPUB document.
-rw-r--r--doc/faq.txt50
-rw-r--r--doc/publishing-ebooks-with-asciidoc.txt8
-rw-r--r--docbook-xsl/epub.xsl3
3 files changed, 58 insertions, 3 deletions
diff --git a/doc/faq.txt b/doc/faq.txt
index ba8bc5d..0ef38b6 100644
--- a/doc/faq.txt
+++ b/doc/faq.txt
@@ -9,6 +9,54 @@ AsciiDoc Frequently Asked Questions
newer FAQs may apply to the trunk and not the current release.
======
+[[X5]]
+== How can I include embedded fonts in an EPUB document
+This is a two step process:
+
+1. Declare the font files and their use in your document's CSS
+ stylesheet. For example:
++
+[listing]
+.........................................
+@font-face {
+ font-family : LiberationSerif-Regular;
+ font-weight : normal;
+ font-style: normal;
+ src : url(LiberationSerif-Regular.ttf);
+}
+
+body {
+ font-family: LiberationSerif-Regular, serif;
+}
+.........................................
+
+2. Declare the the font file as resource when you use `a2x(1)` to
+ compile the EPUB. For example:
+
+ a2x -f epub -d book --epubcheck --stylesheet epubtest.css --resource .ttf=application/x-font-ttf --resource LiberationSerif-Regular.ttf epubtest.txt
+
+[NOTE]
+======
+- Requires AsciiDoc 8.6.5 or better.
+- The True Type Font mimetype had to be declared explicitly with the
+ `--resource .ttf=application/x-font-ttf` option because it wasn't
+ registered on my Linux system.
+- In the above example the font file is in the same directory as the
+ AsciiDoc source file and is installed to the same relative location
+ in the EPUB archive OEBPS directory -- if your font file resides in
+ a different location you'll need to adjust the `--resource` option
+ accordingly (see the 'RESOURCES' section in the `a2x(1)` man page
+ for details).
+- The URL value of the CSS 'src' property is set to the destination
+ font file relative the the CSS file.
+- The `--resource` option allows you to inject any file (not just font
+ files) into the EPUB output document.
+- Using the CSS '@font-face' rule is a complex subject and is outside
+ the scope of the FAQ.
+- Many EPUB readers do not process embedded fonts.
+======
+
+
== What's the difference between + quoted text and ` quoted monospaced text?
`+` (plus) quoted text is implemented as an AsciiDoc 'quotes' whereas
+`+ (grave accent or backtick) quoted text is implemented as an
@@ -36,7 +84,7 @@ This line works as expected:
The `++i` and `++j` auto-increments.
Paths `~/.vim` and `~/docs`.
The `__init__` method.
- The `{id}` attribute.
+ The `{id}` attribute.
== Why is the generated HTML title element text invalid?
diff --git a/doc/publishing-ebooks-with-asciidoc.txt b/doc/publishing-ebooks-with-asciidoc.txt
index 62f6918..6c84b77 100644
--- a/doc/publishing-ebooks-with-asciidoc.txt
+++ b/doc/publishing-ebooks-with-asciidoc.txt
@@ -51,7 +51,8 @@ the ePub problem with Docbook-XSL/A2X/Asciidoc] blog post.
[[X1]]
-== Minimal Book
+Minimal Book
+------------
This didactic example contains a title and two chapters. The AsciiDoc
source is a plain text file named `minimal-book.txt`:
@@ -364,6 +365,11 @@ There are some great examples of EPUB book styles at
http://epubzengarden.com/[ePub Zen Garden].
+Including embedded fonts
+------------------------
+See link:faq.html#X5[this FAQ].
+
+
Reading EPUB documents
----------------------
My current favorite software epub reader is the
diff --git a/docbook-xsl/epub.xsl b/docbook-xsl/epub.xsl
index 15ccdf3..ad22134 100644
--- a/docbook-xsl/epub.xsl
+++ b/docbook-xsl/epub.xsl
@@ -13,7 +13,8 @@
<xsl:import href="common.xsl"/>
<!--
-DocBook XSL 1.75.2: Nav headers are invalid XHTML (table width element)
+DocBook XSL 1.75.2: Nav headers are invalid XHTML (table width element).
+Suppressed by default in Docbook XSL 1.76.1 epub.xsl.
-->
<xsl:param name="suppress.navigation" select="1"/>