![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 982
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Font handling in SVGs
I'm about to draw a bunch of line art diagrams for a book intended for my Inkpad Color 3.
Using SVG is the "obvious" choice, however I did a quick test and it doesn't look like PB honours the specified typeface at all. Essentially everything looks like Times. I'm drawing using Affinity Designer 2; here's a bit of my exported SVG using Times New Roman: Code:
<text x="448.819px" y="706.625px" style="font-family:'TimesNewRomanPSMT', 'Times New Roman', serif;font-size:50px;">12pt ks@%</text> Code:
<text x="448.819px" y="708.863px" style="font-family:'ArialMT', 'Arial', sans-serif;font-size:50px;">12pt artscGR</text> Are there any known issues here or tricks I can use? At the end of the day I can always embed a PNG, or get the export to render text as curves, but the downsides of those options are clear. Edit: I also tried the latest Inkscape, but it was no better. Edit: I tried embedding the font and using @font-face in CSS - no change. I tried <link>ing the stylesheet into the SVG files - also no change. Last edited by chrisridd; 08-02-2025 at 07:09 AM. Reason: Tried embedding the fonts |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,735
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
I experimented with this more than 10 years ago and back then it only worked with ADE 4. Unfortunately, not much has changed since then.
![]() Unless you can convince your readers to use ADE 4.x, you'll probably have to convert all SVG text to paths. |
![]() |
![]() |
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 982
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
After some googling I think I've determined that PocketBook doesn't support fonts embedded in EPUBs at all, which I suspect then carries over to not supporting them in SVGs. That's really quite annoying. Surely the RMSDK supports this?
One question might be, if I installed a font in the usual system/fonts directory, can I refer to it in CSS, either with or without a @font-face? This would make the books completely non-portable, but would be a potential workaround. Separately, I noticed that <pre> does not render with a monospaced font. But <tt> does, which is a bit surprising. ![]() So "<pre><tt>...</tt></pre>" it is... |
![]() |
![]() |
![]() |
#4 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 217
Karma: 1000000
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
|
Quote:
That’s not SVG though, just normal embedded fonts. Last edited by Moonbase59; 08-03-2025 at 01:30 PM. |
|
![]() |
![]() |
![]() |
#5 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 982
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Quote:
But clearly it is working a bit, so that's something to build on. Getting the CSS to load the font is an important step though as you can make SVG link to the same CSS file. Thanks for the link!! ![]() |
|
![]() |
![]() |
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 217
Karma: 1000000
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
|
You’re welcome!
The left pic (of the PB) looks like mine when I’ve set a font override (lower menu, "A" symbol). Are you sure this is set to "default" (which should use the embedded fonts)? Oh, also make sure the PocketBook uses its built-in EPUB3 reader, not the EPUB2 reader. You can long-tap the book and select "Open With …" → "PB Reader (EPUB 3)". (Although this should normally default to the correct one if you haven’t changed the PB’s extensions.cfg.) Last edited by Moonbase59; 08-03-2025 at 03:12 PM. |
![]() |
![]() |
![]() |
#7 | ||
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 982
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Quote:
But if you look at the bottom of my first photo, you can see one of the custom fonts being used - the line starting "besitze". But in the CSS, that's using the same rule ("block_2" class) as the paragraph above it starting "Hervorhebungen" that is being rendered differently. What?! This is why I said it works "a bit". Editing the rules to add "!important" to the font-family doesn't seem to make a difference when I'm not using "default". I wonder if continually replacing the book via Calibre is confusing the PB? Maybe it has cached the old version. Quote:
|
||
![]() |
![]() |
![]() |
#8 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 217
Karma: 1000000
Join Date: Oct 2021
Location: Germany
Device: Tolino Vision 5, Tolino Tab 8", Pocketbook Era (16GB)
|
Quote:
Reader overrides can be quite tricky… ;-) I’m rather sure my Tolino Vision 5 did that differently. |
|
![]() |
![]() |
![]() |
#9 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 982
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
I did also ask PocketBook support for some guidance, along the lines of what Kobo provide on Github.
They implied that they may help a commercial author, but essentially they told me to pound sand. |
![]() |
![]() |
![]() |
Tags |
svg text |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Possible to access note raw SVGs? (10.3 Go) | Fitz Frobozz | Onyx Boox | 1 | 04-14-2025 09:38 PM |
Do SVGs have to be wrapped in DIVs? | what | ePub | 3 | 03-23-2021 02:40 AM |
Marvin not handling not handling #151; | pehkay | Marvin | 3 | 12-13-2013 07:27 AM |
SVGs are centered by KF8, how do you prevent it? | FunkeXMix | Kindle Formats | 3 | 01-09-2013 07:32 PM |
ePub (and KF8) from SVGs | heinrich66 | ePub | 5 | 05-03-2012 01:56 PM |