Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 04-01-2024, 07:26 AM   #1
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
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"?
jindroush is offline   Reply With Quote
Old 04-01-2024, 08:31 AM   #2
Quoth
the rook, bossing Never.
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: 11,173
Karma: 85874891
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.
Quoth is offline   Reply With Quote
Advert
Old 04-01-2024, 09:01 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,874
Karma: 22666666
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
kovidgoyal is online now   Reply With Quote
Old 04-01-2024, 09:22 AM   #4
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
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).
Attached Files
File Type: epub test - Unknown.epub (160.8 KB, 17 views)
File Type: docx test - Unknown.docx (13.3 KB, 20 views)
File Type: txt test - dbg report.txt (4.7 KB, 15 views)
File Type: epub test - Unknown - not subset.epub (652.0 KB, 16 views)
jindroush is offline   Reply With Quote
Old 04-01-2024, 10:12 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,874
Karma: 22666666
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.
kovidgoyal is online now   Reply With Quote
Advert
Old 04-01-2024, 11:15 AM   #6
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
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.
jindroush is offline   Reply With Quote
Reply


Forum Jump

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


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


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