Answers.Body: <p>To extend on Tom's answer I have to disagree with how the media type is written for Truetype and I would also like to show how its written for Opentype.</p>
  <p>In the <code>.opf</code> file <code>&lt;manifest&gt;</code>:</p>
  <h2>Truetype fonts</h2>
  <pre><code>&lt;item id=&quot;Roboto_Regular&quot; href=&quot;fonts/Roboto_Regular.ttf&quot; media-type=&quot;application/x-font-ttf&quot; /&gt;
  </code></pre>
  <p>media type for Truetype is: <code>&quot;application/x-font-ttf&quot;</code>.</p>
  <h2>Opentype fonts</h2>
  <p><code>&lt;item id=&quot;Roboto_Regular&quot; href=&quot;fonts/Roboto_Regular.otf&quot; media-type=&quot;application/vnd.ms-opentype&quot; /&gt;</code></p>
  <p>media type for Opentype should be: <code>&quot;application/vnd.ms-opentype&quot;</code> but I have seen <code>&quot;application/x-font-opentype&quot;</code> used and pass validation.</p>
  <p>Prior versions of Epubcheck I want to say used to check for this but I haven't tested it within <code>EpubCheck-3.0.1</code></p>
  <p>Be careful on how you code your paths when declaring the <code>src:url</code> in the <code>.css</code> file for the font.  I have seen some people use absolute paths when they should have used a relative path and it throw a validation error of an unused font.</p>
  <p>Note you cannot just include a master <code>.css</code> file that calls for a ton of fonts.  If you code for a font to be used in the <code>.css</code> file and include it in the package it must be used and declared in the <code>.opf</code> file or you will throw a:</p>
  <pre><code>&lt;Error&gt;
  &lt;Message&gt;'fonts/foobar.ttf': referenced resource missing in the package.&lt;/Message&gt;
  &lt;Line&gt;2&lt;/Line&gt;
  &lt;Column&gt;71&lt;/Column&gt;
  &lt;Resource&gt;foobar.css&lt;/Resource&gt;
  &lt;Class&gt;com.adobe.common.ReportElement&lt;/Class&gt;
  &lt;/Error&gt;
  </code></pre>
  <p>If you are not going to use the font you should remove it from the package and comment it out in the <code>.css</code> file</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-05T18:12:58.090Z
Answers.Text: Thanks for the expansion on my answer. I wouldn't have thought to try including a master font list in each CSS file, so I didn't know it would error like that. For the mimetype for truetype, I've been using that declaration for at least 3 years, and haven't had it return invalid or cause any problems in any reading systems. Do you have a reference for why `application/x-font-ttf` is better?
Answers.UserDisplayName: Tom
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-05T18:22:30.330Z
Answers.Text: From experience beyond iBooks I have found past issues with other platforms, devices and validation tools if it is not written with `media-type="application/x-font-ttf"`.
Answers.UserDisplayName: DᴀʀᴛʜVᴀᴅᴇʀ
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-05T18:27:23.793Z
Answers.Text: Interesting, thanks. I'll keep my eyes open for any errors that come back from any of the other retailers we deal with.
Answers.UserDisplayName: Tom
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-05T15:52:21.393Z
Answers.LastActivityDate: 2014-03-05T16:00:47.660Z
Answers.LastEditDate: 2020-06-18T08:36:04.683Z
Answers.UserDisplayName: DᴀʀᴛʜVᴀᴅᴇʀ
Answers.Body: <p>It is certainly possible to embed custom fonts and have them be used in iBooks, as well as on other <code>EPUB</code> reading systems. The process is known as embedding. Embedded fonts are simply included in the <code>.zip</code> archive that comprises the <code>EPUB</code> file, and then referenced properly in all the relevant content files. Places you will need to reference them include:</p>
  
  <h2>CSS file</h2>
  
  <p>This is just like using fonts on the web: the first thing you need to do is define <code>@font-face</code>:</p>
  
  <pre><code>@font-face {
    font-family: roboto;
    src: url('fonts/Roboto/Roboto-Regular.ttf')
  }
  </code></pre>
  
  <p>and then use that declaration in for whichever styles you'd like to use that font:</p>
  
  <pre><code>p.intro {
    font-family: roboto;
    font-weight: normal;
    font-style: normal;
  }
  </code></pre>
  
  <h2>content.opf file</h2>
  
  <p>Just like all the other files in your <code>EPUB</code>, you'll need to include any font files you're embedding in the <code>&lt;manifest&gt;</code> of your <code>.opf</code> file:</p>
  
  <pre><code>&lt;item id="Roboto-Regular_ttf" href="fonts/Roboto-Regular.ttf" media-type="application/x-font-truetype" /&gt;
  </code></pre>
  
  <p>The above steps are sufficient for most reading systems, but iBooks has one more hoop to jump through:</p>
  
  <h2>com.apple.ibooks.display-options.xml</h2>
  
  <p>This is a file that goes in the <code>META-INF</code> folder of the <code>EPUB</code>, rather than the OEBPS folder, and as the name suggests it's iBooks-specific. Neither this file nor the <code>container.xml</code> file need to be declared in the <code>&lt;manifest&gt;</code>, so don't worry about that. Here is the file in its entirety:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt;
  &lt;display_options&gt;
  &lt;platform name="*"&gt;
  &lt;option name="specified-fonts"&gt;true&lt;/option&gt;
  &lt;/platform&gt;
  &lt;/display_options&gt;
  </code></pre>
  
  <p>A more <a href="http://www.pigsgourdsandwikis.com/2011/04/embedding-fonts-in-epub-ipad-iphone-and.html" rel="nofollow noreferrer">in-depth writeup</a> can be found on Liz Castro's excellent blog. <a href="https://ebooks.stackexchange.com/a/866/349">As noted elsewhere</a>, be aware that there are some potential hurdles, both legal and practical, to embedding fonts.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-03-04T17:58:30.613Z
Answers.LastActivityDate: 2014-03-05T16:35:19.913Z
Answers.LastEditDate: 2017-04-13T13:00:05.480Z
Answers.UserDisplayName: Tom
Body: <p>Is it possible to include custom fonts in an ebook and have them show up in iBooks, or can you only use the various default fonts listed on the device?</p>
  
Tags: <epub><creation><fonts><production><apple-books>
Title: Can I make custom fonts show up in iBooks?
UserDisplayName: Tom
ThreadText: # Can I make custom fonts show up in iBooks?
  
  (Asked by: username_0 on 2014-03-04)
  
  Is it possible to include custom fonts in an ebook and have them show up in iBooks, or can you only use the various default fonts listed on the device?
  
  **Tags:** epub, creation, fonts, production, apple-books
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2014-03-04. Score: 7 | Accepted answer
  
  It is certainly possible to embed custom fonts and have them be used in iBooks, as well as on other `EPUB` reading systems. The process is known as embedding. Embedded fonts are simply included in the `.zip` archive that comprises the `EPUB` file, and then referenced properly in all the relevant content files. Places you will need to reference them include:
  
  ## CSS file
  
  This is just like using fonts on the web: the first thing you need to do is define `@font-face`:
  
  ```
  @font-face {
    font-family: roboto;
    src: url('fonts/Roboto/Roboto-Regular.ttf')
  }
  
  ```
  
  and then use that declaration in for whichever styles you'd like to use that font:
  
  ```
  p.intro {
    font-family: roboto;
    font-weight: normal;
    font-style: normal;
  }
  
  ```
  
  ## content.opf file
  
  Just like all the other files in your `EPUB`, you'll need to include any font files you're embedding in the `<manifest>` of your `.opf` file:
  
  ```
  <item id="Roboto-Regular_ttf" href="fonts/Roboto-Regular.ttf" media-type="application/x-font-truetype" />
  
  ```
  
  The above steps are sufficient for most reading systems, but iBooks has one more hoop to jump through:
  
  ## com.apple.ibooks.display-options.xml
  
  This is a file that goes in the `META-INF` folder of the `EPUB`, rather than the OEBPS folder, and as the name suggests it's iBooks-specific. Neither this file nor the `container.xml` file need to be declared in the `<manifest>`, so don't worry about that. Here is the file in its entirety:
  
  ```
  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  <display_options>
  <platform name="*">
  <option name="specified-fonts">true</option>
  </platform>
  </display_options>
  
  ```
  
  A more [in-depth writeup](http://www.pigsgourdsandwikis.com/2011/04/embedding-fonts-in-epub-ipad-iphone-and.html) can be found on Liz Castro's excellent blog. [As noted elsewhere](https://ebooks.stackexchange.com/a/866/349), be aware that there are some potential hurdles, both legal and practical, to embedding fonts.
  
  
  ---
  
  ### Answer by username_1 on 2014-03-05. Score: 3
  
  To extend on Tom's answer I have to disagree with how the media type is written for Truetype and I would also like to show how its written for Opentype.
  
  In the `.opf` file `<manifest>`:
  
  ## Truetype fonts
  
  ```
  <item id="Roboto_Regular" href="fonts/Roboto_Regular.ttf" media-type="application/x-font-ttf" />
  
  ```
  
  media type for Truetype is: `"application/x-font-ttf"`.
  
  ## Opentype fonts
  
  `<item id="Roboto_Regular" href="fonts/Roboto_Regular.otf" media-type="application/vnd.ms-opentype" />`
  
  media type for Opentype should be: `"application/vnd.ms-opentype"` but I have seen `"application/x-font-opentype"` used and pass validation.
  
  Prior versions of Epubcheck I want to say used to check for this but I haven't tested it within `EpubCheck-3.0.1`
  
  Be careful on how you code your paths when declaring the `src:url` in the `.css` file for the font. I have seen some people use absolute paths when they should have used a relative path and it throw a validation error of an unused font.
  
  Note you cannot just include a master `.css` file that calls for a ton of fonts. If you code for a font to be used in the `.css` file and include it in the package it must be used and declared in the `.opf` file or you will throw a:
  
  ```
  <Error>
  <Message>'fonts/foobar.ttf': referenced resource missing in the package.</Message>
  <Line>2</Line>
  <Column>71</Column>
  <Resource>foobar.css</Resource>
  <Class>com.adobe.common.ReportElement</Class>
  </Error>
  
  ```
  
  If you are not going to use the font you should remove it from the package and comment it out in the `.css` file
  
  > **Comments:**
  > **username_0**: Thanks for the expansion on my answer. I wouldn't have thought to try including a master font list in each CSS file, so I didn't know it would error like that. For the mimetype for truetype, I've been using that declaration for at least 3 years, and haven't had it return invalid or cause any problems in any reading systems. Do you have a reference for why `application/x-font-ttf` is better?  
  > **username_1**: From experience beyond iBooks I have found past issues with other platforms, devices and validation tools if it is not written with `media-type="application/x-font-ttf"`.  
  > **username_0**: Interesting, thanks. I'll keep my eyes open for any errors that come back from any of the other retailers we deal with.  
  
  ---
  
  