[HarfBuzz] Small Caps

Khaled Hosny khaledhosny at eglug.org
Sun Dec 13 02:15:28 PST 2015


On Sun, Dec 13, 2015 at 05:26:33PM +0900, Simon Cozens wrote:
> On 13/12/2015 11:48, Daniel Ribeiro Maciel 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.
> 
> You want to be passing the +smcp feature when shaping:
> 
> 
> features[0].tag = hb_tag_from_string("smcp", 4);
> features[0].start = 0; /* Start point in text */
> features[0].end = (unsigned int) -1; /* End point in text */
> features[0].value = 1;
> 
> shape_plan = hb_shape_plan_create_cached(hbFace, &segment_props,
> features, nFeatures, NULL);
> int res = hb_shape_plan_execute(shape_plan, hbFont, buf, features,
> nFeatures);

Or just hb_shape_full() if you don’t all the flexibility of shape plans.

Regards,
Khaled


More information about the HarfBuzz mailing list