Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 05-16-2014, 04:55 AM   #1
Abekonge
Scripler Project Lead
Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.
 
Abekonge's Avatar
 
Posts: 19
Karma: 19304
Join Date: May 2014
Location: Copenhagen, Denmark.
Device: Gameboy Color
Post DIY Guide: Using and embedding fonts in EPUB

I’ve written a comprehensive DIY guide to using and embedding fonts in epubs. You might find it useful:

Quote:
Fonts are an important part of book design and production. A good use of fonts is central in making readable and good looking books. And fonts are fun. Coming from typewriters, one of the coolest things about the early word processors was the ability to easily and quickly change the looks of your documents by applying different fonts to it. I remember spending hours changing fonts for the sake of it. It was a defining feature of the desktop publishing revolution.

But today, most ebooks look the same, typography-wise. Some say that since users can change fonts in most reader systems, why bother? I say, you are still responsible for first impressions, and first impressions will reflect upon how readers perceive your work. So if your book looks like all the other books, well…

Two real issues stand in the way of using fonts in ebooks:
  1. It is complex and technical to add and use fonts in ebooks.
  2. The licensing required can be complex and in many cases obstructively expensive.
In the following guide I’m showing you how to add and use fonts in ebooks using just an EPUB file and a few common software tools. How to handle licenses and where to find great open fonts are also covered.

--Read the rest--

Last edited by Abekonge; 05-16-2014 at 05:06 AM.
Abekonge is offline   Reply With Quote
Old 05-16-2014, 01:03 PM   #2
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
You're missing one part when embedding fonts in iBooks:

Adding meta property:
Quote:
<meta property="ibooks:specified-fonts">true</meta>
Adding package attribute:
Quote:
prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"
Great guide nevertheless!
odedta is offline   Reply With Quote
Advert
Old 05-16-2014, 03:54 PM   #3
Abekonge
Scripler Project Lead
Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.
 
Abekonge's Avatar
 
Posts: 19
Karma: 19304
Join Date: May 2014
Location: Copenhagen, Denmark.
Device: Gameboy Color
You are correct that it can be done that way. But fonts are working in iBooks with this guide, I'm obtaining the same effect adding specified fonts true to the file com.apple.ibooks.display-options.xml to the META-INF folder.

That is the older way, but I don't know of any differences. Do you?
Abekonge is offline   Reply With Quote
Old 05-16-2014, 04:24 PM   #4
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
From Liz Castro's blog (http://www.pigsgourdsandwikis.com/2012/11/versioning-in-ibooks-3.html)
Quote:
To make sure my fonts are recognized, Apple now requires this line instead of the com.apple.ibooks.metadata.plist file:

<meta property="ibooks:specified-fonts">true</meta>
In any case, if you like to be iBooks compatible I think it's better to add the meta tag and the package prefix
Code:
prefix="rendition: http://www.idpf.org/vocab/rendition/# ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"
since there are other meta tags iBooks needs like:

Code:
<meta property="ibooks:iphone-orientation-lock">none</meta>
<meta property="ibooks:ipad-orientation-lock">none</meta>
<meta property="ibooks:binding">false</meta>
<meta property="rendition:layout">pre-paginated</meta>
<meta property="rendition:spread">auto</meta>
<meta property="rendition:orientation">auto</meta>

Last edited by odedta; 05-16-2014 at 04:26 PM.
odedta is offline   Reply With Quote
Old 05-17-2014, 10:03 AM   #5
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Using the Calibre's Editor, I just open this new file: com.apple.ibooks.display-options.xml
This file contains:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
<platform name="*">
<option name="specified-fonts">true</option>
</platform>
</display_options>
And that's it, my fonts (and CSS) work in ibooks.
JLius is offline   Reply With Quote
Advert
Old 05-17-2014, 11:01 AM   #6
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
If you plan to move with the times and conform to the ePub3 standard, then do NOT add the above file at all.

In any case, for maximum compatibility I always do both just in case there is absolutely no harm done by doing so, it passes validation and the files works as intended.
odedta is offline   Reply With Quote
Old 05-17-2014, 11:40 AM   #7
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Okay, I'm willing to move with the times, although I don't use epub3.

So you're saying you include the com.apple.ibooks.display-options.xml, and also prefix="rendition: http://www.idpf.org/vocab/rendition/# ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"

Where and how do you add the latter? I'm new to all of this, so please explain to me as you would a twelve year old.
JLius is offline   Reply With Quote
Old 05-17-2014, 12:18 PM   #8
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
For some meta tags such as:
Code:
<meta property="ibooks:iphone-orientation-lock">none</meta>
<meta property="ibooks:ipad-orientation-lock">none</meta>
You must include the ibooks prefix
Quote:
prefix="ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"
in the package so your file will pass validation, if it works with or without the prefix I have no clue and I don't intend to try, just stick with the ePub standard and you should be fine.

If you are working with Fixed-Layout ePubs you will have to use the meta tags:
Code:
<meta property="rendition:layout">pre-paginated</meta>
<meta property="rendition:orientation">portrait</meta>
<meta property="rendition:spread">landscape</meta>
AND include the prefix:
Quote:
prefix="rendition: http://www.idpf.org/vocab/rendition/#"
to the package.opf

Now, if you have both fixed layout and embedded fonts the correct form of declaring the package prefixes are as follows:
Quote:
prefix="rendition: http://www.idpf.org/vocab/rendition/# ibooks: http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0/"
Meaning, just add a space between them.

Everything I said so far is ePub 3 standards requirements. In order to be backwards compatible, meaning, conforming to ePub 2 standards you must include the com.apple.ibooks.display-options.xml file in order to have embedded fonts or fixed layout.

Here is a template I use:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
	<platform name="*">	 <!-- all devices -->
		<option name="fixed-layout">true</option> <!-- fixes the layout -->
		<option name="specified-fonts">false</option>	 <!-- set to "true" when embedding fonts -->
		<option name="open-to-spread">true</option>	 <!-- single page or full spread on open -->
		<!--<option name="orientation-lock">landscape-only</option>	 "landscape-only" or "portrait-only" or leave this line commented -->
		<option name="interactive">false</option>	 <!-- set to "true" when using javascript or canvas -->
	</platform>
</display_options>
To summarize, in my opinion, it's best to include both the tags you need and the com.apple.ibooks.display-options.xml file to have backwards compatibility, now, we also want our files to be validated to know they are well-formed, so we declare the prefixes we used in the package tags.
odedta is offline   Reply With Quote
Old 05-17-2014, 01:55 PM   #9
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
Maybe I should have asked for the six-year-old explanation, but thanks

I don't use fixed layout, just the embedded fonts. For the meta tags you mention, I think I have no use. For now, until I get as smart as a twelve-year-old, I'll stick to the .xml.
JLius is offline   Reply With Quote
Old 05-17-2014, 02:22 PM   #10
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Your forum rank suits you just fine it seems
odedta is offline   Reply With Quote
Old 05-17-2014, 02:55 PM   #11
JLius
Village idiot
JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.JLius ought to be getting tired of karma fortunes by now.
 
JLius's Avatar
 
Posts: 157
Karma: 519566
Join Date: Mar 2014
Location: Belgium
Device: sony PRS T-1
For someone that hadn't even heard about html and css before February '14, I'm doing alright I guess. For a computer specialist as yourself, I guess I do look like a village idiot. But I'm grateful for all the info I get, so K for you.
JLius is offline   Reply With Quote
Old 05-17-2014, 03:00 PM   #12
odedta
Addict
odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.odedta read the news today, oh boy.
 
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
Hah! I was messin with you, chill hehe, you're nothing like the village idiot, the village idiot never asks any questions
odedta is offline   Reply With Quote
Old 05-19-2014, 03:45 AM   #13
Abekonge
Scripler Project Lead
Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.
 
Abekonge's Avatar
 
Posts: 19
Karma: 19304
Join Date: May 2014
Location: Copenhagen, Denmark.
Device: Gameboy Color
Quote:
Originally Posted by odedta View Post
In any case, if you like to be iBooks compatible I think it's better to add the meta tag and the package prefix
Ah yes ok. I agree that it makes sense to add the xml file AND the content.opf. I will update my guide. Thanks.

Anywho that iBooks needs to be told in three different ways to use embeded fonts is insane. It's already specified in the epub without these extra vendor-specific add-ons...(but yeah so many examples like this ...)
Abekonge is offline   Reply With Quote
Old 11-16-2017, 10:27 PM   #14
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Abekonge View Post
I’ve written a comprehensive DIY guide to using and embedding fonts in epubs. You might find it useful:
The link is a 404. Wayback has it here: https://web.archive.org/web/20160329...ts-ebooks.html

Last edited by AlanHK; 11-16-2017 at 10:34 PM.
AlanHK is offline   Reply With Quote
Old 11-17-2017, 06:07 AM   #15
Abekonge
Scripler Project Lead
Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.Abekonge has met Morla.
 
Abekonge's Avatar
 
Posts: 19
Karma: 19304
Join Date: May 2014
Location: Copenhagen, Denmark.
Device: Gameboy Color
Quote:
Originally Posted by AlanHK View Post
The link is a 404. Wayback has it here: https://web.archive.org/web/20160329...ts-ebooks.html
Yeah sorry. The scripler project was closed down - and I have not really followed the epub scene in the last couple of years. But the css at least should still be good ...
Abekonge is offline   Reply With Quote
Reply

Tags
embed fonts, embed multiple fonts, epub, fonts

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedding fonts in ePub using Sigil yaip Sigil 26 07-19-2013 09:23 AM
Embedding fonts in ePub/Kindle NoEarthlyReason Workshop 3 05-27-2013 09:01 PM
Embedding Fonts in EPUB- iPad matteino10 Apple Devices 0 03-15-2012 09:32 AM
Embedding fonts in EPUB? Acey Calibre 19 11-06-2011 10:01 AM


All times are GMT -4. The time now is 07:12 PM.


MobileRead.com is a privately owned, operated and funded community.