![]() |
Locking Fonts?
Hey guys,
I'm back. I am formatting an author's book into both an e-book and a print book. For the e-book, anywhere one specific font is used, I would like to make it where the e-reader cannot change the font to the reader's desire. The other fonts I don't care about. If I have to lock all of them, not an issue.
|
OK. I think what I am looking for is Embedding a font.
|
Embedding is still no guarantee an ereader, or an ereading app won't override your font choice. Outright prevention is not a worthy pursuit. Nor is it very feasible.
|
Edit: Disregard. Got my wires crossed!
|
Quote:
What you can do is embed a font, then hope readers allow "Publisher CSS". But users can always override with their own selected fonts, font sizes, line spacing, etc. That's one of the fantastic advantages of ebooks! Quote:
To learn how to do font embedding/subsetting, check out the step-by-step tutorial I wrote a few months ago: 2021: "Japanese characters not showing up on some devices" (Post #4) It deals with marking up specific languages in a different font, but the same exact logic applies. Usage Note: I only use embedded fonts in very select cases when dealing with very rarer/obscure Unicode characters (like Polytonic Greek, Maths Symbols, Gibbous Moons 🌔🌖). |
Quote:
|
Quote:
|
Quote:
You can't. MOBI/Kindles You can just hope users select that option, but 99% probably don't. Or maybe leaving a little note in the frontmatter (or a very first footnote) saying: "Please enable Publisher Fonts on your Kindle to get the best experience" but not many people even look there either. The good thing about Kindles though is they have fallback fonts. So as long as you're using the proper Unicode characters, it has a very high likelihood of displaying. If you try to embed fonts covering the entire ebook though... (applying to <body> or <p>)... there's a very high likelihood Amazon will strip them on upload. Again, see the Hitch link above. EPUB EPUB may be a little bit better on the Publisher CSS front, since the majority of devices/reading-programs follow the standards. If you design your ebook well, and use the embedded fonts sparingly:
then the embedded font will probably work (and not piss off the user). But even in EPUB, a portion of users use non-standards compliant readers that completely override everything (Moon+, etc. etc.). Again, there's no solution. And you definitely can't force a font on the user (this would be disastrous). * * * It would be nice if Amazon had some sort of checkbox during upload to say: "Hey, this book has some rare scientific symbols. Default enable Publisher Fonts when the book is downloaded." ... but I could see that being completely abused by 99% of the authors, especially big publishers. Maybe heuristics would be able to minimize that damage though (maybe only allow it if <10% of the book is in that font). Side Note: You + me + Hitch even discussed Amazon Publisher Font enabling later in that very same Japanese thread, talking about the B-hat symbol. Most fonts DO NOT display those accents properly, so that's where an embedded mathematical font would be the correct choice. * * * Great ebook design though: KISS (Keep It Simple Stupid) + get the hell out of the way of the user's preferences. Don't force the constraints of the Print design onto the Ebook. :) |
Quote:
But as for fonts, on older versions of RMSDK, you could not change the font so the embedded fonts were what you got like it or not. This was the way it was on Sony Readers pre-T series. |
I think there is only one way you can do this.
create the image of characters you use, and replace all characters with link to the image. by this way, you can force person who read your ebook use you font |
I've found that some "popular" Android apps totally ignore embedded fonts, some CAN'T use them at all.
I embed fonts and then check that the book is readable with very limited default fonts. |
Quote:
Font size selection to suit eyesight won't work either. |
What I ended up doing was setting the CCS for this text to san-serif. I couldn't find an .otf file for the text I wanted anyway. So I passed on embedding and went that direction.
. What I was dealing with, was representing text on an older computer terminal. It has a very distinctive look. San-serif and mono-spaced. . I do appreciate the feedback.:cool: |
Quote:
Free + open source + SIL license. They also have Source Serif Pro + Source Sans Pro if you need similar-style matching fonts. (These 2 are now called "Source Serif" + "Source Sans".) A lot of this monospace + font stuff was also discussed in: 2019: "Font Best Practices" |
Quote:
Try font-family: monospace; That will probably give you a courier-like font. Also try making it bold. Or, just try <pre> instead of <p> tags, which should give monospaced text. Or, if there isn't much text, make and place images. That's what I usually do for a few Chinese characters, as embedding a Chinese font adds like 6MB to a file, even for a few characters, subsetting doesn't seem to work for them. If your desired font isn't too large, you could specify it and have monospace, or sans-serif, be the fall back if publisher's fonts aren't allowed .terminal {font-family: MyTerminal-font, monospace; text-align: left; } Quote:
e.g. https://www.fontspace.com/category/pixel You can use ttf or otf in ebooks. |
Do not use <pre>. If the lines are long enough, and the font large enough, the text will not wrap in some cases.
|
Quote:
Hitch |
Quote:
It's not for paragraphs of prose. It's for PRE-formatted text: where you explicitly put in every linebreak. The use here is probably for a few words of "output": Enter password:_ and the like. But if you might use longer lines, you can also allow wrapping by defining: pre {white-space: pre-wrap;} |
I agree with JSWolf in this case.
I wouldn't rely on <pre>. Too many readers overflow off the edge of the screen (don't linebreak properly), especially when raising font sizes or reading on skinny screens, etc. Just rely on simple <p> or <span>, then apply the monospace font to them: Code:
<p class="terminal">I AM A HUMAN.</p>Code:
<pre>I AM A HUMAN.Note: In ebooks, the only place <pre> + <code> might be acceptable is actual code blocks (like pasting actual C++ or Java code)... but even there, if I was creating the ebook, I'd likely rely on <p> or images for better compatibility. (Luckily, I haven't had to do that often. The SINGLE programming book I did create code blocks for, I generated PDFs + SVGs + PNGs of the entire syntax-highlighted code block, inserted in the ebook as an image, then linked to the actual github code. It's a formatting mess that I wouldn't wish on anybody.) |
Quote:
That was just the simplest way to do it. He ignored the rest of my post, which is his SOP. |
Quote:
|
I'd not use <pre>; I'd use an explicit paragraph style.
|
Quote:
At least, that's my experience with it. FWIW. I'm sure that there's some mad CSS out there that would prove me wrong. Hitch |
| All times are GMT -4. The time now is 09:18 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.