Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-11-2019, 09:00 PM   #1
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,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Implementing small-caps using Open-type features

This new thread follows a former thread about ligatures. This time it is about small-caps (but it could concern also other Open-type features of course).

I suppressed the former post.

Quote:
Originally Posted by Tex2002ans View Post

I would highly recommend reading these fantastic articles (they also include fantastic visual comparisons):

Each of them goes through reasons/locations where you might want to include each setting.

This is also another good article showing visual examples of each setting + the CSS to enable each one:

And Mozilla's page on font-feature-settings is more developer-focused (but still fantastic). On the left-hand side, you can see select between different CSS properties you can use (like font-variant-ligatures, font-kerning, [...]).

Implementing small-caps

I have been using a fork of my font of choice which is Linux Libertine (see joint attachment). I had previously tried to write small-caps, using the CSS property font-variant: small-caps without realizing that I had first to unlock its possibilities (smcp)...

Thus, I had obtained only mixed results (no accented letter) and I had given up.
Even with your links, there are different advices on how to implement this (top level, low level,...)

I join here the regular font I am using.

It seems to work using this code (taken from "Typotheque" above). It needs now testing. It does something with Sigil but nothing the Calibre editor and later with Prince PDF...

Code:
font-variant-caps: small-caps;          /* high-level property          */
-moz-font-feature-settings: 'smcp';     /* low-level (old Firefox)      */
-webkit-font-feature-settings: 'smcp';  /* low-level (old Webkit)       */
font-feature-settings: 'smcp' on;       /* low-level (all new browsers) */
On LibreOffice 6.2, I learned also that I just need to define a style (paragraph or character the same) with this font name:
Code:
LinLibertineG30:smcp=1
and small-caps are displayed fine too.
Attached Files
File Type: zip LinLibertineG30-Regular.ttf.zip (411.9 KB, 204 views)

Last edited by roger64; 03-12-2019 at 12:13 AM. Reason: sigil
roger64 is offline   Reply With Quote
Old 03-12-2019, 07:58 AM   #2
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Roger, are you working on epub2 or epub3? In epub2 ADE doesn't support "font-variant: small-caps", so forget to implement small-caps by means of CSS. And first you have to embbed the font before using it; did you do it?
RbnJrg is online now   Reply With Quote
Advert
Old 03-12-2019, 09:42 AM   #3
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,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by RbnJrg View Post
Roger, are you working on epub2 or epub3? In epub2 ADE doesn't support "font-variant: small-caps", so forget to implement small-caps by means of CSS. And first you have to embbed the font before using it; did you do it?
Hi Ruben

I embed fonts since the dawn of times (nearly) , and this one particularly. I use ePub3 on a standard basis.

If you have a look at the nice links given by Tex2002ans, you'll find one Adobe recommendation (but it seems it's more focused on web design than ebook publishing). Adobe recommends this (the name of the class is mine):
Code:
.adobe {
  font-variant-caps: small-caps;
  -moz-font-feature-settings: "smcp";
  -webkit-font-feature-settings: "smcp";
}
I tried it on ePub3 to no avail.

So they forget the "low-level" property "font-feature-settings" and recommend "font-variant-caps" (not font-variant).

Up to now, the only software I found that makes a complete use of the OpenType feature is LibreOffice. So, I tried to export to ePub with LibreOffice an odt using this extra-feature. A pity, the extra OpenType feature which appeared nicely in the odt has not been converted in the ePub....
roger64 is offline   Reply With Quote
Old 03-12-2019, 11:18 AM   #4
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by roger64 View Post
Hi Ruben

I embed fonts since the dawn of times (nearly) , and this one particularly. I use ePub3 on a standard basis.
Well, there must be something that you are doing wrong:

Click image for larger version

Name:	Image1.png
Views:	263
Size:	61.1 KB
ID:	170196

By the way, the font you uploaded is not a small-cap font but a regular one.

Below you can check the respective epub with small-caps and the font you want to use.

Regards
Attached Files
File Type: epub Small Caps ADE Epub3.epub (424.0 KB, 254 views)
RbnJrg is online now   Reply With Quote
Old 03-12-2019, 08:16 PM   #5
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,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
mistake

Last edited by roger64; 03-12-2019 at 09:20 PM.
roger64 is offline   Reply With Quote
Advert
Old 03-12-2019, 08:21 PM   #6
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,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by RbnJrg View Post

By the way, the font you uploaded is not a small-cap font but a regular one.
For the last years, I used a dedicated small-cap font and still do. Today's problem is different and there is a misundertanding I'd like to clear. Yes, this font is a regular one but it has optional smcp capabillities

Please, do analyze my font using this site
Select the "features" tab. You'll see that it has indeed some optional features which are "off by default". Among them, using small-caps.(see screenshot).

My question is how to use them on an ePub?

I am afraid that using font-variant: small-caps does not yield good results. Your ePub does not display smcp characters coming from the font using Sigil ou Calibre.

There is a simple way to check if you really use smcp characters coming from the font. Try to write: &. You should get the second character on the left of the screenshot.. (I've put a circle around it)

I add a second screenshot, showing a PDF exported from LibreOffice, using characters from this font, and which displays small-caps correctly, and also (see red marks)
- standard ligatures (on by default)
- old style numerics (off by default)
This is the result I am aiming for.

Edit:
However, after some searching, the informations I've reffered to above seem to be a little ahead of schedule as far as CSS is concerned.
The CSS Fonts Module Level 3 properties, font-feature-settings and font-variant-caps (among others) are currently "Candidates au statut de recommandation" (candidates to get a recommended status). Thre reference document is this one..

So, for the time being, it's too early to hope to get any CSS implementation, even if some software like LibreOffice or probably some browsers make already wide use of them.
Attached Thumbnails
Click image for larger version

Name:	smcp2.png
Views:	240
Size:	73.6 KB
ID:	170204   Click image for larger version

Name:	LO.png
Views:	275
Size:	91.0 KB
ID:	170205  

Last edited by roger64; 03-13-2019 at 03:43 AM. Reason: CSS3
roger64 is offline   Reply With Quote
Old 03-13-2019, 08:42 AM   #7
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,636
Karma: 8566337
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Hi Roger,

So, you are not seeking small-caps but how to enable some features on .otf (by the way, the font you uploaded is a .ttf, or not?). It's not possible for now to get what you want, at least, on epub. Nor property "font-variant-caps" nor property "font-feature-settings" will work, except "font-variant-caps: small-caps" (and with any font, not only with .otf with special features embbeded). Give a look to this pages:

https://sparanoid.com/lab/opentype-features/

https://sparanoid.com/lab/opentype-features/#c2sc

And there also you'll find the names of the .otf fonts that support the features you want, many of them are free. So, you can do your tests with them too.
RbnJrg is online now   Reply With Quote
Old 03-13-2019, 09:07 AM   #8
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,623
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by RbnJrg View Post

So, you are not seeking small-caps but how to enable some features on .otf
Indeed (cf the title of this thread "Implementing small-caps using Open-type features" ) and that's exactly the reason why I provided a font.

Quote:
Originally Posted by RbnJrg View Post
by the way, the font you uploaded is a .ttf, or not?.
Please, do analyze this font using this site You'll get all the information you ask for and more.

The links you provide describe exhaustively the OpenType features. However, as I wrote before, on this field, the CSS implementation is lagging. So, the choice today is either we use LibreOffice and produce PDF ebooks with these wanted features (see screenshot above), or we produce ePubs without them and we wait for their implementation.

It's a pity because the version of Linux Libertine I use has been published in 2012. LibreOffice maintains an even more typographically advanced version (Linux Libertine G) and seven years later we are still waiting to unleash their full potential on the ePubs.

Last edited by roger64; 03-13-2019 at 10:17 AM. Reason: wakamai
roger64 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Small caps JLius ePub 10 06-09-2014 01:37 AM
Kindle and small caps ricroma Kindle Formats 14 05-02-2013 04:39 PM
Small caps Notjohn Sigil 9 02-23-2013 10:19 AM
Small Caps djulian Kindle Formats 2 04-05-2012 08:48 AM
small caps yuxi_kelly ePub 20 06-05-2011 12:04 AM


All times are GMT -4. The time now is 07:14 PM.


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