Thread: Locking Fonts?
View Single Post
Old 09-18-2021, 01:25 AM   #19
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
I agree with JSWolf in this case.

I wouldn't rely on <pre>. Too many readers overflow off the edge of the screen (don't linebreak properly), especially when raising font sizes or reading on skinny screens, etc.

Just rely on simple <p> or <span>, then apply the monospace font to them:

Code:
<p class="terminal">I AM A HUMAN.</p>

<p class="terminal">I AM NOT A ROBOT.</p>
over:

Code:
<pre>I AM A HUMAN.

I AM NOT A ROBOT.</pre>
Back in the 80s/90s, there was a lot of HTML also buried in pre-formatted HTML (manual "justification")... let me tell you, it does not age well on the transfer to modern ebooks/readers.

Note: In ebooks, the only place <pre> + <code> might be acceptable is actual code blocks (like pasting actual C++ or Java code)... but even there, if I was creating the ebook, I'd likely rely on <p> or images for better compatibility.

(Luckily, I haven't had to do that often. The SINGLE programming book I did create code blocks for, I generated PDFs + SVGs + PNGs of the entire syntax-highlighted code block, inserted in the ebook as an image, then linked to the actual github code. It's a formatting mess that I wouldn't wish on anybody.)

Last edited by Tex2002ans; 09-18-2021 at 01:34 AM.
Tex2002ans is offline   Reply With Quote