Answers.Body: <p>You can definitely embed fonts, yes. There are a few issues to watch out for when doing so, however:</p>
  
  <ul>
  <li>You may not have a license to use the font in ebooks. The font needs to be licensed in such a way as to not just allow use, but also distribution. There are a number of open source fonts available that do permit redistribution--make sure you read the license, though, before using any of them. Many of them will also require that the license be included; it's easy enough to just throw that into the font's directory, but be sure to actually do it if the license requires it.</li>
  <li>Many reading systems (I'm looking at you, Nook) will by default override publisher CSS and use their own instead. If you use fonts as the sole differentiator for different types of information, you'll lose that info when publisher CSS is turned off. If you're using a different font in place of bold for emphasis, consider markup up the text as <code>&lt;b class="exclamation"&gt; ... &lt;/b&gt;</code> instead of <code>&lt;span class="exclamation"&gt; ... &lt;/span&gt;</code>. Then you can define <code>b.exclamation { Font-weight: normal; font-family: awesome_font; }</code> in your CSS. That will make the text bold if publisher CSS is off, but put it in your awesome font if publisher CSS is working.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-10T14:00:24.610Z
Answers.Text: Do you know whether some/all ereaders honor `!important`? That would be a good way to overrule the device setting in specific places. (I appreciate your solution for the gracious fallback.)
Answers.UserDisplayName: Raphael
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-10T17:31:34.997Z
Answers.Text: Many readers do support `!important`, but I haven't done testing to see whether this overrides the publisher styles setting. My impression is that the readers that ignore publisher styles effectively ignore the whole stylesheet, meaning that the `!important` tag would never be seen. As I said, though, I've done no testing on that and could be totally off base.
Answers.UserDisplayName: Tom
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-10T17:32:53.327Z
Answers.Text: I guess I'll click something together and have a try with my Kobo later.
Answers.UserDisplayName: Raphael
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-10T17:33:45.697Z
Answers.Text: I'd be interested to hear what you find!
Answers.UserDisplayName: Tom
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-06T00:33:20.490Z
Answers.LastActivityDate: 2014-02-06T00:33:20.490Z
Answers.UserDisplayName: Tom
Answers.Body: <p>I think that every device has its own behaviour, so I don't know if there is some setting that can be used as a general solution.</p>
  
  <p>In example, I have a Kobo ereader, and it is capable to do what you ask; if there is a custom font inside the ebook, and it is used only for titles or some paragraphs (i.e. to format code in computer science books), for the rest of text without any particular formatting it falls back to the default settings.<br>
  Kobo ereaders also have many customization setting for the ebook typography.</p>
  
  <p><img src="https://i.sstatic.net/GEKAv.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.sstatic.net/daAbk.jpg" alt="enter image description here"></p>
  
  <p>In my experience, if I change them (expecially by selecting a non-default font), they will take the precedence over any formatting inside the ebook. Thus the order of precedence is like that:<br>
  <code>custom font settings</code> > <code>ebook internal formatting</code> > <code>default ereader settings</code>.  </p>
  
  <p>In example, for books containing code usually it is displayed with a fixed width font, and if this font is included in the ebook and the relative text is correctly styled, it is displayed like that, overriding the default settings; but if I change my own visualizations settings, it will override also any particular styling declared in the book itself, for every bit of text. If in the "justification" setting I choose "aligned to left", it will do so not only on the main text body but also in titles and every other bit of text.</p>
  
  <p>But this is the how Kobo readers work, I don't know if other devices have the same behaviour. Your best bet is to test your ebook in as many devices as possible.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-02-07T10:46:12.110Z
Answers.LastActivityDate: 2014-02-07T10:46:12.110Z
Answers.UserDisplayName: Sekhemty
Body: <p>Assuming that I am targeting non-tablet eBook readers such as Kindle and nook, is it possible to layout a book with some text in the default font of the device and some paragraphs in a special font embedded in the book? I know some HTML5 and CSS features are supported, but is font embeding going to be widely usable or will this currently get me into a miserable mess?</p>
  
  <p>I specifically do not want to override the default font family preferences of the device, only that of some text blocks so any solutions that effect the entire work would not work for me.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-07T11:07:52.323Z
Comments.Text: I feel like such things *should* be covered by the EPUB standard. I take it they are not?
Comments.UserDisplayName: Raphael
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-02-10T17:29:18.787Z
Comments.Text: Many aspects of the epub spec (like support for fonts, multimedia, and JavaScript) are optional. It makes sense, because epub is built to be device-agnostic, but it's still frustrating and the cause of much of the fragmentation in the epub ecosystem.
Comments.UserDisplayName: Tom
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-03-18T02:13:22.770Z
Comments.Text: Can someone explain how to embed fonts (not if it will work) [How Can i read hebrew .docx files with there original fonts on a kindle paperwhite](http://ebooks.stackexchange.com/questions/1090/How_can_i_read_hebrew_.docx_files_with_there_original_fonts_on_a_kindle_paperwhite/)
Comments.UserDisplayName: Arye Eidelman
Tags: <epub><mobi><html><fonts><css>
Title: Can custom fonts be embedded in mobi or epub books targeting eink readers?
UserDisplayName: Caleb
ThreadText: # Can custom fonts be embedded in mobi or epub books targeting eink readers?
  
  (Asked by: username_0 on 2014-02-05)
  
  Assuming that I am targeting non-tablet eBook readers such as Kindle and nook, is it possible to layout a book with some text in the default font of the device and some paragraphs in a special font embedded in the book? I know some HTML5 and CSS features are supported, but is font embeding going to be widely usable or will this currently get me into a miserable mess?
  
  I specifically do not want to override the default font family preferences of the device, only that of some text blocks so any solutions that effect the entire work would not work for me.
  
  **Tags:** epub, mobi, html, fonts, css
  
  > **Comments:**
  > **username_1**: I feel like such things *should* be covered by the EPUB standard. I take it they are not?  
  > **username_2**: Many aspects of the epub spec (like support for fonts, multimedia, and JavaScript) are optional. It makes sense, because epub is built to be device-agnostic, but it's still frustrating and the cause of much of the fragmentation in the epub ecosystem.  
  > **username_3**: Can someone explain how to embed fonts (not if it will work) [How Can i read hebrew .docx files with there original fonts on a kindle paperwhite](http://ebooks.stackexchange.com/questions/1090/How_can_i_read_hebrew_.docx_files_with_there_original_fonts_on_a_kindle_paperwhite/)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-02-06. Score: 9
  
  You can definitely embed fonts, yes. There are a few issues to watch out for when doing so, however:
  
  * You may not have a license to use the font in ebooks. The font needs to be licensed in such a way as to not just allow use, but also distribution. There are a number of open source fonts available that do permit redistribution--make sure you read the license, though, before using any of them. Many of them will also require that the license be included; it's easy enough to just throw that into the font's directory, but be sure to actually do it if the license requires it.
  * Many reading systems (I'm looking at you, Nook) will by default override publisher CSS and use their own instead. If you use fonts as the sole differentiator for different types of information, you'll lose that info when publisher CSS is turned off. If you're using a different font in place of bold for emphasis, consider markup up the text as `<b class="exclamation"> ... </b>` instead of `<span class="exclamation"> ... </span>`. Then you can define `b.exclamation { Font-weight: normal; font-family: awesome_font; }` in your CSS. That will make the text bold if publisher CSS is off, but put it in your awesome font if publisher CSS is working.
  
  > **Comments:**
  > **username_1**: Do you know whether some/all ereaders honor `!important`? That would be a good way to overrule the device setting in specific places. (I appreciate your solution for the gracious fallback.)  
  > **username_2**: Many readers do support `!important`, but I haven't done testing to see whether this overrides the publisher styles setting. My impression is that the readers that ignore publisher styles effectively ignore the whole stylesheet, meaning that the `!important` tag would never be seen. As I said, though, I've done no testing on that and could be totally off base.  
  > **username_1**: I guess I'll click something together and have a try with my Kobo later.  
  > **username_2**: I'd be interested to hear what you find!  
  
  ---
  
  ### Answer by username_4 on 2014-02-07. Score: 5
  
  I think that every device has its own behaviour, so I don't know if there is some setting that can be used as a general solution.
  
  In example, I have a Kobo ereader, and it is capable to do what you ask; if there is a custom font inside the ebook, and it is used only for titles or some paragraphs (i.e. to format code in computer science books), for the rest of text without any particular formatting it falls back to the default settings.  
  Kobo ereaders also have many customization setting for the ebook typography.
  
  ![enter image description here](https://i.sstatic.net/GEKAv.jpg)
  
  ![enter image description here](https://i.sstatic.net/daAbk.jpg)
  
  In my experience, if I change them (expecially by selecting a non-default font), they will take the precedence over any formatting inside the ebook. Thus the order of precedence is like that:  
  `custom font settings` > `ebook internal formatting` > `default ereader settings`.
  
  In example, for books containing code usually it is displayed with a fixed width font, and if this font is included in the ebook and the relative text is correctly styled, it is displayed like that, overriding the default settings; but if I change my own visualizations settings, it will override also any particular styling declared in the book itself, for every bit of text. If in the "justification" setting I choose "aligned to left", it will do so not only on the main text body but also in titles and every other bit of text.
  
  But this is the how Kobo readers work, I don't know if other devices have the same behaviour. Your best bet is to test your ebook in as many devices as possible.
  
  
  ---
  
  