[HarfBuzz] Detect applied features

Pedro Navarro pnavarro at netflix.com
Tue Mar 7 17:48:22 UTC 2017


Hello,

Is there a way to detect the features Harfbuzz has applied to a code point?
We are implementing Japanese text features and there are several places
where we need that information:

According to UTR #50 characters with the Tr property need a vertical
variant but, as a fallback, the character can be displayed rotated 90
degrees. How can we detect if a vertical variant was not applied for a
glyph so we can rotate it?

When implementing something similar to the CSS property text-combine-upright
<https://www.w3.org/TR/css-writing-modes-3/#propdef-text-combine-upright>,
the client is supposed to try to use the hwid/twid/qwid features -if
present- and then resort to things like converting to half-width forms
and/or scaling the text to fit the 1em space allocated. Here, again,
knowing if the features were applied would help to use the right fallback
method (without the time consuming way of shaping with the different
fallback methods until one fits).

Is that possible without having to enable a feature and comparing the
buffers with the feature and without it? Is a reverse lookup, where given a
glyph index you get the table it comes from, possible?

If not, would it make sense to add an (optional?) member to hb_glyph_info_t
(or a different struct?) so for each glyph besides the cluster you can also
know the feature(s) that made that glyph index be selected?

Thanks a lot!
Pedro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20170307/857b0317/attachment.html>


More information about the HarfBuzz mailing list