Documentation
TrueType
There have been rumors and discussions that w3c will no longer suggest or allow TrueType fonts in ePubs. At the moment this isn't an issue and doesn't fail validation so we will continue to allow TrueType fonts.
If you need a font from UTC most TrueType fonts are stored under the Speciality/TT/Web/Epub directory. You can drag and drop a font on your Desktop but you will get an error if a font is dragged with My Fonts highlighted.
- SBL Greek is stored under Greek
- SBL Hebrew is stored under Hebrew
CSS
Any font added to the font
directory should be referenced in the CSS, example:
css1@font-face {2font-family: 'Gentium';3font-style: normal;4font-weight: normal;5src: url('../font/Gentium.ttf') format('truetype');6}
by default the format is not included and should be added, regex:
bash1## Find:2(?<=\.ttf"\));$34## Replace:5format('truetype');
If a font comes in italic it should be coded with a font style of italic
and oblique
, example:
css1@font-face {2font-family: 'Gentium';3font-style: italic;4font-weight: normal;5src: url('../font/Gentium-Italic.ttf') format('truetype');6}7@font-face {8font-family: 'Gentium';9font-style: oblique;10font-weight: normal;11src: url('../font/AGaramondPro-Italic.otf') format('opentype');12}
OPF
All TrueType fonts have to be included in the OPF Manifest, example:
html1<item id="GentiumPlus.ttf" href="font/GentiumPlus.ttf" media-type="application/x-font-ttf" />
Order in which doesn't matter but order scripted from the app OPF Builder reads the font directory with a top down approach.
If a font has whitespace in the name it's likely the font wasn't from UTC. If this is the case the font should be pulled from UTC and the file replaced. By default OPF builder will pull any font located in the font directory even if the name has whitespace and if this is added when you go to validate it will fail validation.