Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-22-2019, 02:33 AM   #1
momoha
Annabelle Viau
momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.
 
momoha's Avatar
 
Posts: 43
Karma: 16664
Join Date: Jan 2015
Location: Rishikesh, India
Device: iPad, Kobo, Windows 10 (ADE, Azardi), Android (Google Books, Bluefire)
Question Alternate glyph support (font-variant-alternates)

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!
momoha is offline   Reply With Quote
Old 10-22-2019, 12:16 PM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,356
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
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.
DNSB is offline   Reply With Quote
Old 10-22-2019, 03:19 PM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,938
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by momoha View Post
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.
JSWolf is offline   Reply With Quote
Old 10-22-2019, 05:53 PM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by momoha View Post
Does anyone know if the CSS font-variant-alternates is supported in ePub3?
According to Mozilla's site:

https://developer.mozilla.org/en-US/...ant-alternates

it's only supported in Firefox currently.

Quote:
Originally Posted by momoha View Post
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?
Tex2002ans is offline   Reply With Quote
Old 10-23-2019, 03:32 AM   #5
momoha
Annabelle Viau
momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.
 
momoha's Avatar
 
Posts: 43
Karma: 16664
Join Date: Jan 2015
Location: Rishikesh, India
Device: iPad, Kobo, Windows 10 (ADE, Azardi), Android (Google Books, Bluefire)
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?
Attached Files
File Type: epub Alternate glyph (en test).epub (784.2 KB, 253 views)
momoha is offline   Reply With Quote
Old 10-23-2019, 03:47 AM   #6
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by momoha View Post
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.
Doitsu is offline   Reply With Quote
Old 10-23-2019, 07:25 AM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,938
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by momoha View Post
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?
JSWolf is offline   Reply With Quote
Old 10-23-2019, 08:40 AM   #8
momoha
Annabelle Viau
momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.
 
momoha's Avatar
 
Posts: 43
Karma: 16664
Join Date: Jan 2015
Location: Rishikesh, India
Device: iPad, Kobo, Windows 10 (ADE, Azardi), Android (Google Books, Bluefire)
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:
Originally Posted by JSWolf View Post
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.
momoha is offline   Reply With Quote
Old 10-23-2019, 08:58 AM   #9
momoha
Annabelle Viau
momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.momoha 's shirt has a full set of merit badges.
 
momoha's Avatar
 
Posts: 43
Karma: 16664
Join Date: Jan 2015
Location: Rishikesh, India
Device: iPad, Kobo, Windows 10 (ADE, Azardi), Android (Google Books, Bluefire)
Quote:
Originally Posted by Doitsu View Post
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
momoha is offline   Reply With Quote
Old 10-23-2019, 04:18 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,938
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by momoha View Post
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.
JSWolf is offline   Reply With Quote
Old 10-23-2019, 09:14 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by JSWolf View Post
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.
It's not a different character, it's an alternate form.

It's not like some of those dingbat/foreign fonts that replaced "abcd" with absolutely different symbols "αβγδ".

It's substituting a swashy 'Q' with a normal 'Q'. Or 'a' with a more rounded 'a' (as a child would write [see GIF below]):

https://helpx.adobe.com/content/dam/...n-type-bar.gif
https://helpx.adobe.com/illustrator/...haracters.html

Before: https://ilovetypography.com/OpenType/_img/salt_src.gif
After: https://ilovetypography.com/OpenType/_img/salt_trgt.gif

I would agree with Doitsu, your best best would probably be to flip the alternate symbol in the font itself, then embed that modified font into the Fixed Format Ebook. Currently, that advanced CSS3 is just not well supported across readers/browsers.

Side Note: If you look at the font OP mentioned, the 'v' looks a lot like a 'u', and in a children's book, I could see how that would be extremely confusing.

Quote:
Originally Posted by momoha View Post
[...] which solves my problem at the moment, but not for potentiel future cases where a book would be using both glyphs, regular and alternate.
I can't think off the top of my head where you would require both... besides Maths. Are you thinking of things like the swashy Q, where it only applies in the beginning of a word? Or in special ligatures like "Qu"?

Anyway, it all stems back to a problem of reader support:
  • Embedded fonts are already an issue
    • Can't guarantee device supports even that.
  • Advanced CSS3 support is nearly non-existent in ebooks
    • If it's not supported in browsers, there's 99.9% chance it won't work in books.
  • and Fixed Format is just a plain disaster.

If you created a book which relied on alternate characters for comprehension, you most likely have serious underlying issues in your text.

Last edited by Tex2002ans; 10-23-2019 at 09:26 PM.
Tex2002ans is offline   Reply With Quote
Old 03-22-2020, 06:07 AM   #12
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
font-variant-alternates

Hi

Is this necro-posting?

It's still about the CSS property font-variant-alternates to be used in an ePub3.
My OT font is Linux Libertine. I'd like to write in the CSS at the body place, the following line:

font-variant-alternates: stylistic ();

Question: I do not know how to fill-up what must be inserted within the red brackets. In the text of the ePub, I'd like to make appear the alternate character instead of &

My font has the stylistic set ss06 (see screenshot). Currently, I can make appear the alternate character only using the smcp set as you can see (other screenshot), but then I have to wrap a span around each & which is not very convenient.

I'm afraid I have not been clear...
Attached Thumbnails
Click image for larger version

Name:	ss06.png
Views:	154
Size:	18.3 KB
ID:	177859   Click image for larger version

Name:	smcp.png
Views:	169
Size:	50.0 KB
ID:	177860  

Last edited by roger64; 03-22-2020 at 06:20 AM.
roger64 is offline   Reply With Quote
Old 03-22-2020, 08:34 AM   #13
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by roger64 View Post
It's still about the CSS property font-variant-alternates to be used in an ePub3.
AFAIK, font-variant-alternates isn't widely supported. However, font-feature-settings works fine with ADE 4.5:

Code:
body {
    font-family: 'Linux Libertine';
    
    -moz-font-feature-settings: "salt";
    -webkit-font-feature-settings: "salt";
    font-feature-settings: "salt";
}
Doitsu is offline   Reply With Quote
Old 03-22-2020, 09:35 AM   #14
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Code:
font-feature-settings: "salt";
It indeed does work, but it also modifies some other letters (for example I get a strange h with a tail). So, I can't use it for the body.

It would be convenient for a span around the &, but then I would not be any better than the smcp solution.

Last edited by roger64; 03-22-2020 at 09:54 AM.
roger64 is offline   Reply With Quote
Old 03-22-2020, 10:22 AM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,938
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Doitsu View Post
AFAIK, font-variant-alternates isn't widely supported. However, font-feature-settings works fine with ADE 4.5:

Code:
body {
    font-family: 'Linux Libertine';
    
    -moz-font-feature-settings: "salt";
    -webkit-font-feature-settings: "salt";
    font-feature-settings: "salt";
}
But it doesn't work with ADE 2.0.1 or even ADE 3.x. So it's not a good idea to use it as a lot of Readers or programs with RMSDK are not using the latest version and thus do not support such.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
glyph font for member names is annoying. Phogg Feedback 3 02-01-2016 01:07 PM
variable width font with slash/dot zero glyph rem736 General Discussions 3 07-28-2015 03:02 PM
Add alternates to tab delimited dictionary Magvidal Kindle Formats 3 02-25-2015 07:36 PM
DR1000 FW2.0 - RC2 - font-variant: small-caps ThR iRex 0 06-29-2010 05:31 AM
Hacks Alternate Kindle 2 Font Hack daffy4u Amazon Kindle 29 09-19-2009 08:47 PM


All times are GMT -4. The time now is 08:02 AM.


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