![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Font won't Subset
I have an ebook which uses Han characters, but were not being displayed.
I searched for a Han font and ended up finding and using this one and now it displays correctly on the libra2... https://github.com/adobe-fonts/sourc...SC-Regular.otf Its quite a big file and I only needed 11 characters. When I try to run Subset Embedded Font nothing happens... Code:
Project Hail Subsetting embedded fonts Reduced total font size to 0.0% of original |
![]() |
![]() |
![]() |
#2 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,183
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I checked the font using Sigil and it's SubsetFont plugin and it seemed to work without issue. The 12 characters I used gave me an output font file around 48KB down from 23088KB so about 0.2%.
The calibre editor showed a massive size reduction but the save button was greyed out which would seem to indicate that no changes were made. |
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Thanks for testing @DNSB.
Sounds like you had some reduction in Calibre, whereas nothing happens for me. I tried restarting in Debug Mode, but looks like that mode doesn't extend to the Editor. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
To debug a subsetting issue i need both the full book since subsetting is a function both o fthe font and text in the book.
|
![]() |
![]() |
![]() |
#5 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,183
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I've attached the epub I generated with the .otf font from Karellen's download link embedded that I used for testing.
|
![]() |
![]() |
![]() |
#6 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,183
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
calibre seemed to show that the font was being subsetted but did not make any changes in the font file and would not save. I added and removed a space in the text to allow me to save it but the font file had no change in it's size.
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Book sent via PM
|
![]() |
![]() |
![]() |
#8 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,025
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Some font files not only won't subset, but even cause conversion to fail if "subset fonts" is selected. I solve this by picking a similar appearance font and check that it has any extended non-Latin-Roman characters needed.
I think this is a more common problem with some non-alphabetic fonts, but I've had it years ago on a font with just regular Latin-Roman characters plus áéíóú ÁÉÍÓÚ. It was a font obtained maybe in 1994 on Windows 3.x, so hardly surprising. Last edited by Quoth; 04-19-2023 at 05:11 AM. |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's a CID keyed font subsetting of these is not supported. I will fix the code to emit a better error message about such fonts.
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Thank you for checking @kovidgoyal
![]() Too difficult to implement? Thanks @DNSB for checking also ![]() |
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
CID keyed fonts are not common enough for me to bother, but patches are most welcome.
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#13 |
Bibliophist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,020
Karma: 7173892
Join Date: Dec 2021
Location: England
Device: none
|
From a quick web search you might be able to convert you cid keyed font with font forge?
|
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
I thought it would be a simple matter of deleting the characters I do not want, but even that seemed difficult, especially as there must be a thousand characters in the file, and doing it one by one is too time consuming to attempt. A simple "invert selection" would have made it easier. |
|
![]() |
![]() |
![]() |
#15 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,025
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
I think, but I'm not sure, that CID is maybe partly hierarchical to save storage for complex glyphs sharing sub-elements. It's not impossible that you could build a regular font table using Font Forge, but the way CID fonts work is so different that I doubt it. Hinting, for example, can apply to a row of symbols/glyphs.
Regular fonts, especially alphabetic or related, have a unique sequential entry for each character. The CID font concept seems to have been designed around elements of a distinct glyph. Some OCR for Asian languages even build a custom CID font for that document. I can't see how you can even substitute a regular font instead of a CID font in an existing document, because they work so differently. This is also why a CID font won't subset in the same way as a regular font. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Font won't embed | NIRC | Conversion | 2 | 06-19-2020 08:38 PM |
Hexadecimal support for calibre-debug --subset-font ? | un_pogaz | Calibre | 9 | 11-23-2018 03:00 AM |
FontShrinker - tool to subset a font | Toxaris | Workshop | 91 | 02-08-2018 06:54 PM |
Embedded font-subset sometimes fails | GrannyGrump | Sigil | 3 | 10-20-2012 09:47 AM |
HELP! Courier Font Won't Work | TedPark | Sony Reader | 0 | 07-06-2008 07:34 PM |