[HarfBuzz] Fwd: Small Caps

Deepak Jois deepak.jois at gmail.com
Sun Dec 13 04:25:16 PST 2015


On Sun, Dec 13, 2015 at 8:18 AM, Daniel Ribeiro Maciel
<daniel.maciel at gmail.com> wrote:
> I read harfbuzz might support real small caps for OpenType fonts. Is this
> true? If so, would you please help me getting it to work? I have no clue how
> to do it.

Small caps are a feature provided by the OpenType font you are using.
Unless the font supports small caps, harfbuzz cannot really do much.

Assuming the font you are using does support small caps, you will need
to turn on the small caps feature when you are calling the hb_shape or
hb_shape_full API function to shape text with Harfbuzz.

Harfbuzz has a flexible format to specify features to be enabled (or
disabled) when shaping text using a specific font. Here are some
details about it:
https://github.com/deepakjois/luaharfbuzz/wiki/Feature-Strings

For example, "+smcp" will enable small caps. You can use
hb_feature_from_string to convert a string to a hb_feature_t type, and
then pass it as an argument to hb_shape or hb_shape_full.

Deepak


More information about the HarfBuzz mailing list