Closed aggsol closed 2 years ago
Small caps are not possible. You can use text-transform to get uppercase (and now lowercase and capitalize too), but that's the extent of the font variant that Asciidoctor PDF supports.
I would imagine this would require reading information from the font library (ttfunk), which would require support from Prawn.
I now understand that the small caps variant / transformation is actually a glyph replacement. While this can be handled by the font, most text processors do this by replacing lowercase latin letter with the small capital equivalent. For example, a
becomes ᴀ
, and so forth. We can easily handle this transformation using the existing text transform mechanism. So we'll take that approach.
Part of this change includes adding all the small capital glyphs we need to the built-in fonts. That way, this transformation can be used out of the box. In doing so, I had to make a few substitutions.
Aside from those exceptions, this works as expected by setting the text-transform
key to smallcaps
somewhere in the theme.
role:
smallcaps:
text-transform: smallcaps
Happy to see this was added! Has the mainsite documentation been updated to demonstrate use?
Based on this thread, I have added this to my theme:
role:
smallcaps:
text-transform: smallcaps
and try to use it with:
[.smallcaps]#This is a test.#
It does not work.
Yes, it was implemented. If you are having difficulty using the feature, please ask follow-up questions in the project chat at https://chat.asciidoctor.org. Thanks!
How can I get small caps into the PDF? For HTML I just added
font-variant: small-caps;
to the css and I use a custom attribute[.smallcaps]#In small caps#
. How can I get small caps in PDF.