View Single Post
Old 04-01-2013, 09:51 AM   #512
Anak
Guru
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 600
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Use of real small capitals

Currently font selection is roughly:
1 Use fonts settings from epub
* use embedded fonts
2. Device specific default generic font family settings:
* use device specific default generic font family settings (serif, sans-serif; when "hard coded" CSS font rules)
* let user select the default reading font

But there is no support of true small capitals, even when they are present in the font file itself or in a seperate small caps font file.
Maybe this can be fixed with a font configuration file, in which the font sub styles are defined. Which is basically the same as the current implementation by Kobo but only adding a reference to a specific "small cap font file".

2. Device specific default generic font family settings:
* use device specific default generic font family (serif, sans-serif) settings (when "hard coded" CSS font rules)
* let user select the default reading font
* check if there is a font configuration file, when true use these (additional) font settings, if not
* use the current generic font implementation by Kobo

A configuration file could look something like this:

Configuration file: Linux Libertine.conf
Code:
FontGenericFamily=serif/sans-serif/monospace (cursive, fantasy)
FontWeightRegular=Linux Libertine-Regular.ttf (.otf)
FontWeightItalic=Linux Libertine-Italic.ttf
FontWeightBold=Linux Libertine-Bold.ttf
FontWeightBoldItalic=Linux Libertine-BoldItalic.ttf
FontWeightSmallCaps=Linux Libertine-SmallCaps.ttf
The font configuration file and additonal small cap font files both should be placed in the default fonts folder.

Sure, the mentioned parameters can (should?) be read directly from the font files themselves.
In the example above the "FontGenericFamily" parameter is optional and only added to enable the user to select two default font families for serif sans-serif fonts.

In case there is a real small cap font file specified then some CSS selectors should probably being ignored or overruled.
Either <small> or the <span> tag where small caps are defined (e.g. <span class="smallcaps">).
So maybe something like this shoud be added:
Code:
IgnoreFontCSSselector=small
IgnoreFontCSSspanclass=smallcaps

A better solution would be (partial) XeTex support for small capitals and oldstyle figures.
Font configuration file example:

Code:
XeTexActicate=true (false)
XeTexSmallCaps=smcp, c2sc (c2sc as fallback)
XeTexNumerals=onum (use Oldstyle Figures instead of the default numerals)
Some XeTex references

XeTeX on the Web
The XETEX Companion (CERN)
Libertine-XeTex-Pakage

Or any other script or direct method that uses GSUB tables (GSUB: Glyph substitution data) in font files.
OpenType font files contain tables that contain either TrueType or PostScript outline font data and
the data in these tables are used by rendering programs to render the TrueType or PostScript glyphs.
Features provide information about how to use the glyphs in an OpenType or TrueType font to render a
script or language. All OpenType Layout features define data for glyph substitution, glyph positioning, or both.

Rendering Small Capitals
Code:
Feature	Description
smcp	Small Capitals
c2sc	Small Capitals From Capitals
c2pc	Petite Capitals From Capitals
Rendering Oldstyle numbers
Code:
Feature	Description
onum	Oldstyle Figures

Last edited by Anak; 04-02-2013 at 05:37 AM. Reason: + GSUB
Anak is offline   Reply With Quote