View Single Post
Old 10-02-2014, 07:48 PM   #82
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by JSWolf View Post
Speaking of embedded fonts, what would be the best way to get the reader (not the device, but the person) to know to turn on the publisher font on a Kindle? I'm thinking a note that says something like "This eBook contains embedded fonts, please turn on publisher fonts if your device has such an option.".
I did that on my books, but I took it one step farther. I created a special font called "blankfont":

https://www.gatwood.net/fonts/BlankF...nt-Regular.otf

that is exactly what the name implies: a blank font. On my fonts page, I have the following code:


PHP Code:
span.hidden {
        
font-family"BlankFont";
        
font-stylenormal;
        
font-weightnormal;
        
colorred;
}

...

<
p>... <span class="hidden"><span class="insidehidden">*** If you
can see this text
your reader is overriding the default
font. *** </span></span> ... </p

If memory serves, the inner span's bogus "insidehidden" class with no font declaration is deliberate, as it tickles certain bugs in certain readers, encouraging readers whose font override functionality is buggy to fall back to the paragraph font when they otherwise would not.

On readers that handle fonts correctly, the entire "hidden" span collapses into a zero-width inline element. On readers that abusively override the font selection, it shows up as red text in the reader's default paragraph font.

Note that this approach is entirely compatible with well-behaved readers that change only the body tag's font, because a reader stylesheet that overrides the font on the body tag (and only the body tag) won't cause that hidden text to appear. However, if you really need to force the body text to a particular font, declare a paragraph style with a font choice and !important. Then, odds are good that any reader that overrides the paragraph font will also get tripped up by the canary above, and any reader that doesn't won't be.
dgatwood is offline   Reply With Quote