View Single Post
Old 10-02-2014, 07:12 PM   #83
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
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":

<snippage>

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, my friend, is very, very clever. Well done, that!

Hitch
Hitch is offline   Reply With Quote