View Single Post
Old 10-02-2014, 07:23 PM   #84
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by dgatwood View Post
I did that on my books, but I took it one step farther. I created a special font called "blankfont":
<see original message for the bit snipped out>

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.
That is brilliant! I'll have to try it.
JSWolf is offline   Reply With Quote