Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-10-2022, 05:03 PM   #1
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
<samp> Tag on Ereaders?

Playing around with another fiction book and I ran across the <samp> tag. At first, I thought I'd fat-fingered a search/replace. But, upon checking, there IS a <samp> tag:

https://www.w3schools.com/tags/tag_samp.asp
Quote:
The <samp> tag is used to define sample output from a computer program. The content inside is displayed in the browser's default monospace font.

Tip: This tag is not deprecated. However, it is possible to achieve richer effect by using CSS.
That tag seems aimed at browsers. What do ereaders (with their Publisher Default or user-specified fonts) do when they run across these tags? And, I guess the same applies to the semi-quasi-related tags of:
Quote:
<code> Defines a piece of computer code
<kbd> Defines keyboard input
<var> Defines a variable
<pre> Defines preformatted text
?
enuddleyarbl is online now   Reply With Quote
Old 10-10-2022, 06:53 PM   #2
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
A perennial gripe of mine is that the Kobo doesn't support monospace out of the box the way the Kindle does. E.g.,
Code:
.monospace {
  font-family: monospace;
}
Won't work unless you embed the font in the epub, or install one, Courier I think, and you have to name it a certain way.

So I'm guessing that none of those will work on a Kobo, although I don't know what would happen if you had embeded the font or installed Courier.
hobnail is offline   Reply With Quote
Advert
Old 10-10-2022, 07:19 PM   #3
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: 74,015
Karma: 129333114
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 hobnail View Post
A perennial gripe of mine is that the Kobo doesn't support monospace out of the box the way the Kindle does. E.g.,
Code:
.monospace {
  font-family: monospace;
}
Won't work unless you embed the font in the epub, or install one, Courier I think, and you have to name it a certain way.

So I'm guessing that none of those will work on a Kobo, although I don't know what would happen if you had embeded the font or installed Courier.
The font has to be internally named Courier (I also externally named it Courier just to be safe) and put in the fonts directory. This only works for ePub. For KePub, you do have to embed a monospace font.
JSWolf is offline   Reply With Quote
Old 10-11-2022, 11:36 AM   #4
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
The book is Sanderson's "Oathbringer:"

https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

It's odd that they'd use that <samp> tag, then. I can't see that it would get them anything by doing that versus just using a <span> with a class (which is exactly how they used the <samp>.

Oh, well. I'd been hoping the <samp> would somehow override the ereader's lack of monospace. Thanks for the answers.
enuddleyarbl is online now   Reply With Quote
Old 10-11-2022, 11:54 AM   #5
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: 74,015
Karma: 129333114
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 enuddleyarbl View Post
The book is Sanderson's "Oathbringer:"

https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1

It's odd that they'd use that <samp> tag, then. I can't see that it would get them anything by doing that versus just using a <span> with a class (which is exactly how they used the <samp>.

Oh, well. I'd been hoping the <samp> would somehow override the ereader's lack of monospace. Thanks for the answers.
It's trivial to change <samp> to <span> so it works in all cases.
JSWolf is offline   Reply With Quote
Advert
Old 10-11-2022, 01:42 PM   #6
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,498
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by enuddleyarbl View Post
The book is Sanderson's "Oathbringer:"

https://www.amazon.com/gp/product/B0...?ie=UTF8&psc=1
I have that book and it appears that Tor really messed it up.

The CSS style sheet has lots of "dispaly: block" properties.
jhowell is offline   Reply With Quote
Old 10-11-2022, 01:59 PM   #7
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Quote:
Originally Posted by jhowell View Post
I have that book and it appears that Tor really messed it up.

The CSS style sheet has lots of "dispaly: block" properties.
Yep. I saw those, too. Hard to believe a major publisher wouldn't have run a check on their code before actually sending the book out. I'd have also thought that they'd have fixed it after 5 years.
enuddleyarbl is online now   Reply With Quote
Old 10-11-2022, 05:19 PM   #8
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: 74,015
Karma: 129333114
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 enuddleyarbl View Post
Yep. I saw those, too. Hard to believe a major publisher wouldn't have run a check on their code before actually sending the book out. I'd have also thought that they'd have fixed it after 5 years.
It's a bug in epubcheck. epubcheck verifies this with no errors. epubcheck needs to do a better job checking the CSS. That's where epubcheck falls flat.
JSWolf is offline   Reply With Quote
Old 10-13-2022, 10:33 PM   #9
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
<pre> is disastrous.

On many devices, the text will go flying off the edge of the screen.

Or if you're trying to read on a small/skinny device, like a cellphone, the linebreaks make it impossible to read.

Some of this <pre> discussion happened way back in:

but it hasn't been brought up on MobileRead in a very long time...

I remember <pre> used to be discussed often in the olden days, but I can't find those topics now.

Everyone probably collectively agreed how awful it was and hasn't brought it up since.

- - -

Side Note: And I swear I wrote a post on "code blocks" + syntax highlighting in ebooks... maybe that was in a personal email/rant I did to Hitch years ago.

There was this one programming ebook where I argued replacing every block with SVG and/or high-resolution PNGs generated directly from the source code... using something like LaTeX's minted to go from:
  • raw code
  • -> custom-sized PDF
  • -> SVG or PNG.

This would allow you to generate line numbers and have much more complicated layout/breaks, without the need for Javascript or CSS3 overflows or any of that stuff (that wouldn't work on 99% of ereaders).

Not very Accessible, but at least it would be readable on nearly everything.

(Pinch/zoom on PNGs and/or perfectly laid-out+crisp text SVGs.)

(Reminds me of that 2014 topic on SVG Charts/Tables.)

Last edited by Tex2002ans; 10-13-2022 at 10:48 PM.
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do you prefer Kobo ereaders to Amazon ereaders Pajamaman General Discussions 173 02-23-2022 02:52 PM
Tag Mapper: Remove tag if another specific tag exists? ownedbycats Library Management 2 07-23-2020 10:32 PM
Ways for the parent tag to not be shown with the child tag in the tags column? icecold Calibre 3 03-16-2020 10:23 PM
html img tag versus svg wrapped image tag hobnail ePub 8 02-27-2020 03:16 AM
My Ereaders cant see series tag Zarkhes Calibre 2 09-30-2016 10:23 AM


All times are GMT -4. The time now is 12:06 PM.


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