Skip to content

Commit

Permalink
[aat/morx] Implement language-specific forms
Browse files Browse the repository at this point in the history
Test on Mac with, eg.

$ hb-view /Library/Fonts/BigCaslon.ttf -u 107
vs
$ hb-view /Library/Fonts/BigCaslon.ttf -u 107 --language pl

Fixes #1373
  • Loading branch information
behdad committed Jul 18, 2022
1 parent d8574b4 commit 2124ad8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/hb-aat-layout-morx-table.hh
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,13 @@ struct Chain
setting = HB_AAT_LAYOUT_FEATURE_SELECTOR_LOWER_CASE_SMALL_CAPS;
goto retry;
}
else if (type == HB_AAT_LAYOUT_FEATURE_TYPE_LANGUAGE_TAG_TYPE && setting &&
/* TODO: Rudimentary language matching. */
map->face->table.ltag->get_language (setting - 1) == map->props.language)
{
flags &= feature.disableFlags;
flags |= feature.enableFlags;
}
}
}
return flags;
Expand Down
6 changes: 4 additions & 2 deletions src/hb-aat-map.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ struct hb_aat_map_builder_t
public:

HB_INTERNAL hb_aat_map_builder_t (hb_face_t *face_,
const hb_segment_properties_t *props_ HB_UNUSED) :
face (face_) {}
const hb_segment_properties_t *props_) :
face (face_),
props (*props_) {}

HB_INTERNAL void add_feature (hb_tag_t tag, unsigned int value=1);

Expand Down Expand Up @@ -87,6 +88,7 @@ struct hb_aat_map_builder_t

public:
hb_face_t *face;
hb_segment_properties_t props;

public:
hb_sorted_vector_t<feature_info_t> features;
Expand Down

0 comments on commit 2124ad8

Please sign in to comment.