fontfeature patch
This commit is contained in:
parent
b77fb11b76
commit
4397a1814f
4 changed files with 34 additions and 9 deletions
20
x.c
20
x.c
|
|
@ -1724,6 +1724,26 @@ xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len, int x
|
|||
xp = winx, yp = winy + font->ascent;
|
||||
#endif // VERTCENTER_PATCH
|
||||
cluster_xp = xp; cluster_yp = yp;
|
||||
#if FONTFEATURES_PATCH
|
||||
{ // Get font features
|
||||
shaped.features = (hb_feature_t *) malloc(sizeof(hb_feature_t) * 128);
|
||||
FcChar8 *s;
|
||||
int feature_idx = 0;
|
||||
while (FcPatternGetString(font->pattern, FC_FONT_FEATURES, feature_idx, &s) == FcResultMatch) {
|
||||
if (strlen(s) != 4)
|
||||
die("Invalid font feature tag");
|
||||
if (feature_idx >= 128)
|
||||
die("Too many font features");
|
||||
shaped.features[feature_idx].tag = HB_TAG(s[0], s[1], s[2], s[3]);
|
||||
shaped.features[feature_idx].value = 1;
|
||||
shaped.features[feature_idx].start = HB_FEATURE_GLOBAL_START;
|
||||
shaped.features[feature_idx].end = HB_FEATURE_GLOBAL_END;
|
||||
feature_idx++;
|
||||
}
|
||||
shaped.features_count = feature_idx;
|
||||
}
|
||||
#endif // FONTFEATURES_PATCH
|
||||
|
||||
/* Shape the segment. */
|
||||
hbtransform(&shaped, font->match, glyphs, 0, len);
|
||||
#endif // LIGATURES_PATCH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue