Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-02-2025, 08:36 PM   #1
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 450
Karma: 65460
Join Date: Jun 2011
Device: Kindle
Question: How to display overwritten/overlapping text

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?
ElMiko is online now   Reply With Quote
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,771
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
Old 07-02-2025, 08:55 PM   #3
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 450
Karma: 65460
Join Date: Jun 2011
Device: Kindle
@RbnJrg.... welp. Your solution is definitely superior to mine.

Thank you.

And to your knowledge, e-readers will honor this?

(separately, does letter-spacing only work in epub3, or does it work in epub2, too?)
ElMiko is online now   Reply With Quote
Old 07-02-2025, 09:05 PM   #4
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,771
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by ElMiko View Post
@RbnJrg.... welp. Your solution is definitely superior to mine.

Thank you.
You are welcome

Quote:
And to your knowledge, e-readers will honor this?
Yes, even ADE 2.0 will honor "display: inline-block"; don't worry about that.

Quote:
(separately, does letter-spacing only work in epub3, or does it work in epub2, too?)
In theory, it should be supported even by epub2 ebooks. But ADE 2.x/3.x doesn't honor the property.
RbnJrg is offline   Reply With Quote
Old 07-03-2025, 05:16 PM   #5
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,045
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Letter spacing might work in headings sometimes on ADE /epub2?

An annoying feature of headings is that they may automatically bold, which is certainly not wanted if the font face is a bold kind, so the CSS for a heading might need
Quote:
display: block;
font-family: "Gaelic", serif;
font-weight: normal;
I tend to pick fonts that look OK for what they are used for without having to mess with letter spacing.
Quoth is offline   Reply With Quote
Old 07-05-2025, 10:49 AM   #6
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,758
Karma: 145864619
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 RbnJrg View Post
You are welcome



Yes, even ADE 2.0 will honor "display: inline-block"; don't worry about that.



In theory, it should be supported even by epub2 ebooks. But ADE 2.x/3.x doesn't honor the property.
The only thing you can do in ADE 2.0.1 is to embed a font that has a thin space and use that to space the letters.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overlapping Text in Epub VideoPac Viewer 5 03-17-2022 12:17 PM
Overlapping Text Upon Conversion jrett Kindle Formats 5 02-20-2017 01:45 PM
Text Overlapping Image in Nook for PC, Help dvrader Sigil 4 12-18-2012 07:08 AM
Overlapping text jeeperz Kobo Reader 23 09-26-2011 09:03 PM
EPUB Overlapping Text - Please Help coaver Calibre 16 07-27-2010 12:40 AM


All times are GMT -4. The time now is 07:33 PM.


MobileRead.com is a privately owned, operated and funded community.