Mobileread
Alternate glyph support (font-variant-alternates)
#1  momoha 10-22-2019, 03:33 AM
Hello everyone,

Does anyone know if the CSS font-variant-alternates is supported in ePub3? I tried in Sigil and it doesn’t seem to be working, and I can’t seem to find any information about it for ePubs.

I have a book where alternate glyphs are used for certain letters, so if that doesn’t work, I’ll have to turn them into images I guess.

Any information or ideas would be of great help
Thanks!
Reply 

#2  DNSB 10-22-2019, 01:16 PM
As far as I am aware, font-variant-alternates is part of the supported CSS for epub3. It does require use of an OpenType font that supports features such as 'historical-forms' which is a pretty limited set. Equally sadly, font-variant-alternates is not supported by most renderers. Pretty much a useless feature.
Reply 

#3  JSWolf 10-22-2019, 04:19 PM
Quote momoha
Hello everyone,

Does anyone know if the CSS font-variant-alternates is supported in ePub3? I tried in Sigil and it doesn’t seem to be working, and I can’t seem to find any information about it for ePubs.

I have a book where alternate glyphs are used for certain letters, so if that doesn’t work, I’ll have to turn them into images I guess.

Any information or ideas would be of great help
Thanks!
Don't use images where you don't have to. What you could do is embed a font that has glyphs you need. But before you do, make sure the font has enough weight for eInk.

The image based solution would only be needed for Mobi on an old Kindle if the font doesn't have the glyphs/. So if you can get access to an old Kindle or ask on MR if someone has such can test some words for you, then you'll know if you need the images or not.
Reply 

#4  Tex2002ans 10-22-2019, 06:53 PM
Quote momoha
Does anyone know if the CSS font-variant-alternates is supported in ePub3?
According to Mozilla's site:

https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-alternates

it's only supported in Firefox currently.

Quote momoha
I have a book where alternate glyphs are used for certain letters, so if that doesn’t work, I’ll have to turn them into images I guess.
What's the use-case? Can you show example text of what you're trying to achieve?
Reply 

#5  momoha 10-23-2019, 04:32 AM
I’m converting a children book into fixed-layout. The printed book is using the font Bree with the alternates glyphs for the letters « Q » and « v » as the default ones are a bit hard to read.

If font-variant-alternates is supposed to be supported, I’d love to try this out first as it’d be the best option, but I’m unable to make the code work. I even tried outside of ePub and it’s just not working. InDesign is telling me that the alternates are in the salt group, all the code seems right, but, nothing... I,m stuck

I joined my test ePub, maybe one of you know how to solve this?
[epub] Alternate glyph (en test).epub (784.2 KB, 12 views)
Reply 

#6  Doitsu 10-23-2019, 04:47 AM
Quote momoha
I joined my test ePub, maybe one of you know how to solve this?
You could try using Fontsquirrel's Webfont Generator in expert mode and flatten the font.
Reply 

#7  JSWolf 10-23-2019, 08:25 AM
Quote momoha
I’m converting a children book into fixed-layout. The printed book is using the font Bree with the alternates glyphs for the letters « Q » and « v » as the default ones are a bit hard to read.

If font-variant-alternates is supposed to be supported, I’d love to try this out first as it’d be the best option, but I’m unable to make the code work. I even tried outside of ePub and it’s just not working. InDesign is telling me that the alternates are in the salt group, all the code seems right, but, nothing... I,m stuck

I joined my test ePub, maybe one of you know how to solve this?
Why is it OK to use this font for the print version and not the eBook?
Reply 

#8  momoha 10-23-2019, 09:40 AM
Well, I found a bypass solution which worked but is pretty messy, I wouldn’t recommend that to anyone... I edited the font using FontForge and replaced the normal letters with their alternate glyphs

I really wish I could figure out how to make the font-variant-alternates work though.

Quote JSWolf
Why is it OK to use this font for the print version and not the eBook?
In the print version, alternate glyphs are used, which I am unable to reproduce in the ePub. Alternate glyph means both letters are attributed to the same unicode. So in the print version, instead of using the regular « Q » and « v », it is the alternate ones that are used. Only some rare fonts have alternate glyphs (like the famous Zapfino) and this function is really not widely used, except for ligatures I believe.
Reply 

#9  momoha 10-23-2019, 09:58 AM
Quote Doitsu
You could try using Fontsquirrel's Webfont Generator in expert mode and flatten the font.
I just tried and it does work at overwriting the regular glyphs with the alternate ones, which solves my problem at the moment, but not for potentiel future cases where a book would be using both glyphs, regular and alternate.

So, well, I still wish to make that font-variant-alternates work hehe
Reply 

#10  JSWolf 10-23-2019, 05:18 PM
Quote momoha
I just tried and it does work at overwriting the regular glyphs with the alternate ones, which solves my problem at the moment, but not for potentiel future cases where a book would be using both glyphs, regular and alternate.

So, well, I still wish to make that font-variant-alternates work hehe
One thing you should never ever do is replace a different character with the alternates and use that. Some programs/devices allow the embedded font to be replaced or not used.
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register