03-05-2020, 03:40 PM | #1 |
Member
Posts: 11
Karma: 10
Join Date: Oct 2019
Device: Kindle Paperwhite 7th gen
|
Forcing old-style figures from a font in Kindle
Is there any easy way to edit the CSS to force the Kindle to show
figures as old-style figures? I have a solution, but it’s pretty radical. You’d have to find all the figures or numbers in the file, include them in <span> brackets, and use a class that uses: Code:
font-variant:small-caps; readers. Is there any solution available? The CSS code— Code:
body { font-kerning: normal; font-variant: common-ligatures oldstyle-nums; font-feature-settings: "kern", "liga", "clig", "onum"; } Thanks for your help! |
03-06-2020, 07:42 PM | #2 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
What's a "figure"? Indeed, what's an old-style number? Is this a numerical equivalent of the double-S in German or the thorn in Icelandic or the S with a tail in Polish? I can't picture a number of that sort. Well, there's roman numerals, but that's too easy.
|
Advert | |
|
03-06-2020, 09:08 PM | #3 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Oops, sorry; I didn't read your last part. On the kindle are you using a font that has oldstyle-nums? Not all do.
Last edited by hobnail; 03-06-2020 at 09:10 PM. |
03-06-2020, 10:12 PM | #4 | |
Wizard
Posts: 1,613
Karma: 6718479
Join Date: Dec 2004
Location: Paradise (Key West, FL)
Device: Current:Surface Go & Kindle 3 - Retired: DellV8p, Clie UX50, ...
|
Quote:
When doing serious type setting for print, I prefer to use them for any numbers that appear in the run of the text, while still using the more common style of number when they appears as leading numbers for a list or in a string of text otherwise in all capitals. The only good way to use old-style numerals is to use a font containing them. The glyphs are shaped differently from the usual shapes. Their height is more similar to that of the lower case letters and some of the numbers have descenders extending below the baseline. Only a few fonts look halfway decent with faked old-style numerals created by reducing the size of conventional numerals and none really look good. Just as with fake small caps, such fake characters will be lighter in appearance when compared to normal text. |
|
03-07-2020, 02:42 AM | #5 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
You can add the CSS there, and just hope future devices can render Oldstyle Figures (it won't hurt... any device that doesn't understand the CSS will just ignore it). Here's the Oldstyle Figures code: Code:
font-variant-numeric: oldstyle-nums; /* high-level property */ -moz-font-feature-settings: "onum"; /* low-level (old Firefox) */ -webkit-font-feature-settings: "onum"; /* low-level (old Webkit) */ font-feature-settings: "onum" on; /* low-level (all new browsers) */ Side Note: More of this was discussed in technical detail in my 2019 post in "Turn off ligatures (temporarily)". Also see the references to Microsoft's + Mozilla's OpenType documentation. (Also, check out the rest of that thread... there's a ton of great information in there.) Quote:
Quote:
Here's Mozilla's "OpenType Font Features Guide" for example. They also have brief descriptions of what each setting is used for. Last edited by Tex2002ans; 03-07-2020 at 02:47 AM. |
|||
Advert | |
|
03-07-2020, 07:11 AM | #6 | |
Wizard
Posts: 1,542
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
03-07-2020, 09:26 AM | #7 |
Member
Posts: 11
Karma: 10
Join Date: Oct 2019
Device: Kindle Paperwhite 7th gen
|
The thing is, Kindle can show old-style figures (by drawing glyphs from the .smcp section of the font, when forced with font-variant:small-caps). If the font supports it—such as the one included with the epub by the publisher—it seems very unusual to add support to some OpenType features in the Kindle, and not others.
As a side note, I’m not sure which OpenType features recent Kindles currently support, besides small caps. Stylistic sets? Extended ligatures? Diagonal fractions? The list in the Adobe article is wonderful, but it doesn’t specify cross-platform compatibility. Some websites (such as this one) mention the small-caps feature as an exclusive EPUB3 feature, and not on Kindles, which is wrong. It’s not very clear, and their Kindle Previewer software doesn’t offer the slightest hint regarding this. Is there any clear compatibility article somewhere that I missed? |
03-07-2020, 03:18 PM | #8 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
If the OpenType features the Kindles support isn't listed anywhere then you could test them; here's an epub for testing stuff; dunno if things get lost when converting:
https://www.mobileread.com/forums/sh...feature+peeker |
03-08-2020, 12:26 PM | #9 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
I'm still having a problem wrapping my head around this concept. My favorite typeface is Georgia, but its numerals are a bit small, and when I use them in a heading I sometimes add a couple of points to size of the type. Are Georgia's numerals "old style"?
|
03-08-2020, 01:44 PM | #10 |
Resident Curmudgeon
Posts: 73,972
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Just remember, these tricks will not work in Mobi (in case you're selling eBooks on Amazon).
|
03-08-2020, 02:39 PM | #11 | |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Quote:
https://cdncms.fonts.net/images/5231...le_Figures.jpg First line is old style, second line is not. I think Georgia has both so if you want to use the old style you need the css he's using; "font-variant-numeric: oldstyle-nums;". I use that on the body tag and then for the h1, etc. I switch back to regular. I got this from the Blitz site; what my body tag has is "font-variant: common-ligatures oldstyle-nums proportional-nums;" and for h1, h2, h3, h4 it's "font-variant: common-ligatures lining-nums proportional-nums;" and there's other stuff for both of them (e.g., bold for the h tags). Last edited by hobnail; 03-08-2020 at 03:12 PM. |
|
03-08-2020, 04:01 PM | #12 | |
Resident Curmudgeon
Posts: 73,972
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
03-09-2020, 11:26 AM | #13 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
03-09-2020, 11:59 AM | #14 | |
Resident Curmudgeon
Posts: 73,972
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
But seriously, they look like the new Bookerly (at a smallish size where the letters are not aligned). |
|
03-09-2020, 03:43 PM | #15 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Mozilla's CSS pages are usually pretty damn good too, and most of the time they have interactive code where you can enable/disable and see what the differences are: MDN page for "font-variant-numeric" Only thing that bothers me is OCRing the oldstyle 1 (usually looks like a Roman Numeral I). In many cases, it's hard to tell which one was intended, especially when dealing with citations: Code:
Vol. I Usually I have to go hunting much closer throughout the book to see if they use "Vol. II" (Roman Numerals) or "Vol. 2" (Numbers) or "Vol. 11" (Numbers). |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dictionary font size and style | ams | KOReader | 5 | 11-09-2019 02:54 AM |
Losing Font Style in Conversion | Jimmbo | Conversion | 4 | 06-27-2015 12:10 PM |
How to change font size and font style? | butterbescotch | Sigil | 20 | 09-06-2013 08:22 PM |
Forcing a quotation mark style | Hoods7070 | Sigil | 27 | 05-04-2013 03:41 AM |
Font / style questions | holdit | Kindle Fire | 0 | 12-22-2012 12:11 PM |