Override User Selected Font in iBooks
Sometimes users change the font when reading ePubs in iBooks, and although I am all for that freedom, sometimes when a font is used for icons or another very specific reason, it becomes necessary to force it to render that way.
This can be achieved by placing the character in a samp as opposed to a span:
<samp class="some-icon">A</span>
Then in the stylesheet defining the font as normal:
@font-face {
font-family: 'SomeFont';
font-weight: normal;
font-style: normal;
src: url('SomeFont.ttf');
}
samp.some-icon { font-family:SomeFont; }
Be sure to have the font defined in the ePub manifest otherwise you'll have a bad time:
Written by Andrew Bigger
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#