View Single Post
Old 07-02-2025, 08:43 PM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,801
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by ElMiko View Post
I would like to simulate the effect of overwritten text, as one might seen on a typewriter where two (or more) characters have been struck over the other(s). Do existing epub2 and epub3 e-reader allow for this effect?

my current idea is to use "letter-spacing" like this:

Code:
.ow {
	letter-spacing: -0.65em;
 	margin: 0 0.25em;
	}
.ow2 {
	margin: 0 0.25em;
	}
Code:
<p>I have <span class="ow">tx</span><span class="ow">ox</span><span class="ow2"> </span>go.</p>
which produces text that reads "I have to go" with the "to" overlapped by "xx" in Preview and PageEdit. Obviously, the spacing is going to be sensitive to different font-families and kerning within the font-family itself (if it isn't monospace), but would this even render as desired in actual e-reading software/hardware in theory?

Alternately, is there a better CSS solution?
The easiest way, that is supported by epub2/epub3, is by employing the property "display: inline-block". For example:

Code:
<p>This text is<span class="over">overwritten</span> and this is not overwritten.</p>
Code:
.over {
   display: inline-block;
   margin-left: -5em; /* or what you wish */
}

Last edited by RbnJrg; 07-02-2025 at 08:45 PM.
RbnJrg is offline   Reply With Quote