Forum Bugs

Including small-caps variant

prince.eggs
The following two font rules declare a regular and small-caps font with the same name. This is currently support with varying font-style and font-weight properties, but fails with font-variant as only the last declared font is embedded in PDF output.

@font-face {
font-family : "Linux Libertine";
font-style : normal;
font-weight : normal;
font-variant : normal;
src : url("/usr/share/fonts/truetype/linux-libertine/LinLibertine_Re.ttf") format("truetype");
}

@font-face {
font-family : "Linux Libertine";
font-style : normal;
font-weight : normal;
font-variant : small-caps;
src : url("/usr/share/fonts/truetype/linux-libertine/LinLibertineC_Re.ttf") format("truetype");
}
mikeday
Interesting! Prince cannot choose fonts based on font-variant yet, as currently Prince assumes that it is the same font, with the "smcp" OpenType substitution rule enabled. We will investigate this for future releases of Prince.
jim_albright
I like small caps also. Especially needed for LORD in the Old Testament.

Jim Albright
Wycliffe Bible Translators

mikeday
Small-caps will work out of the box if the font supports the OpenType feature, otherwise Prince will synthesize them by scaling down regular capitals.
_savage
Just now I wanted to try out small caps, when I found this thread. Out of the box, this
<span style="font-variant: small-caps;">isbn</span> 978-1-495...

worked just fine, and so did this
<span style="font-variant: prince-opentype(smcp);">isbn</span> 978-1-495...

I had to remember though to replace the original capital "ISBN" with the lower case :)
mikeday
Yes, Prince will attempt to use the "smcp" feature for small-caps, and only fallback to scaling down uppercase letters if it is not available.

This thread concerns the fact that Prince cannot yet distinguish between two @font-face rules based on font-variant, which is an oversight. Many older fonts use different files for small-caps, instead of OpenType features. We can probably correct this in a future release of Prince.
mikeday
Prince 10 is now available, and includes support for the font-variant property in @font-face rules, so it can be used to distinguish between small-caps and regular fonts.