04-01-2024, 07:26 AM | #1 |
Connoisseur
Posts: 78
Karma: 104
Join Date: Nov 2014
Device: Kindle
|
DOCX to EPUB, font subsetting quirk
Hi,
the docx file has lowercase text uppercased by style (ie. All Caps in font settings of style). When converting to epub, everything works, text is included in lowercase, and CSS style has text-transform: uppercase; BUT: When font subsetting is on, the uppercase letters are not "counted in" and therefore not included in ttf in epub file. There are workarounds (uppercase in word, which is bleh, or not subsetting which produces unnecessarily large epubs). Kovid, is this fixable, or should I "work around"? |
04-01-2024, 08:31 AM | #2 |
the rook, bossing Never.
Posts: 11,956
Karma: 88000007
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
|
Add a separate page (with a header) with all the desired characters, convert with subset, then delete that (x)html file in the editor.
|
04-01-2024, 09:01 AM | #3 |
creator of calibre
Posts: 44,145
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
This is font subsetting in what context? If its conversion, please follow the instruxtions in: https://www.mobileread.com/forums/sh...d.php?t=186697
|
04-01-2024, 09:22 AM | #4 |
Connoisseur
Posts: 78
Karma: 104
Join Date: Nov 2014
Device: Kindle
|
Attached are original DOCX, converted EPUB and conversion report.
The font is embedded and subsetted, but only uppercase T is included, because it's in the original text. The glyphs for All Caps and Small Caps are not present in subsetted font. I also added EPUB with "subsetting" off, it's much longer (expected) and displays correct glyps (also expected). |
04-01-2024, 10:12 AM | #5 |
creator of calibre
Posts: 44,145
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Well text-transform is relatively easy to add, https://github.com/kovidgoyal/calibr...890d7580eefd1c
but font-variant is not going to happen. |
04-01-2024, 11:15 AM | #6 |
Connoisseur
Posts: 78
Karma: 104
Join Date: Nov 2014
Device: Kindle
|
Thanks a lot for the uppercase patch!
I've included small-caps only because I had (wrong) feeling this would be the same beast. Not the case, so I've done some digging in TTF format, I'll check how you actually parse it and if it's possible to submit a patch for this. There are 'c2sc' and 'smcp' display substitution tables which should provide the necessary glyphs for 'please don't remove me' list. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre Conversion: Inconsistent Font Output When Converting From Epub to Docx | IndiePublisher | Conversion | 2 | 06-16-2020 02:17 AM |
Conversion problem Docx to epub font failure | sinbadalexandros | Conversion | 1 | 04-10-2020 03:17 AM |
Problem with font subsetting | grumbles | Editor | 17 | 06-20-2014 02:35 PM |
Font subsetting problem | yktan | Calibre | 5 | 09-19-2013 11:00 PM |
ePub Font Subsetting | Cygfrydd | ePub | 2 | 08-17-2010 08:53 AM |