aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2012-07-17 21:24:54 -0700
committerRaph Levien <raph@google.com>2012-07-17 21:24:54 -0700
commit81da29ac61d5854976e515f6fede6a418b8eaec4 (patch)
tree63ce2e192a58e5d11ed7427252f531c913becc99
parent580c68b86c79b455bdae828456ff68e89137eeef (diff)
downloadharfbuzz-81da29ac61d5854976e515f6fede6a418b8eaec4.tar.gz
Make Harfbuzz accept DFLT language tag.
In fonts (such as Roboto) that have only a DFLT language tag in their OpenType layout tables, Harfbuzz was skipping those features because it was only matching against the explicit language tag. This patch makes Harfbuzz check the DFLT tag too, in case there's not an explicit match. Behdad looked at this patch and said it looks fine. Note that committing this without having positioning fully in place will cause regressions, as kerning makes the advances as generated by Harfbuzz inconsistent with the advances actually used in drawText. Change-Id: I6ea2eb2a580d00410c05c748e2db577072c25534
-rwxr-xr-xsrc/harfbuzz-shaper.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/harfbuzz-shaper.cpp b/src/harfbuzz-shaper.cpp
index 65da6c7..efd08a5 100755
--- a/src/harfbuzz-shaper.cpp
+++ b/src/harfbuzz-shaper.cpp
@@ -1082,8 +1082,11 @@ HB_Bool HB_SelectScript(HB_ShaperItem *shaper_item, const HB_OpenTypeFeature *fe
HB_GSUB_Clear_Features(face->gsub);
HB_UShort script_index;
HB_Error error = HB_GSUB_Select_Script(face->gsub, tag, &script_index);
+ if (error == HB_Err_Not_Covered) {
+ error = HB_GSUB_Select_Script(face->gsub, DefaultScript, &script_index);
+ }
if (!error) {
- DEBUG("script %s has script index %d", tag_to_string(script), script_index);
+ DEBUG("script %s has script index %d", tag_to_string(tag), script_index);
while (features->tag) {
HB_UShort feature_index;
error = HB_GSUB_Select_Feature(face->gsub, features->tag, script_index, 0xffff, &feature_index);
@@ -1103,6 +1106,9 @@ HB_Bool HB_SelectScript(HB_ShaperItem *shaper_item, const HB_OpenTypeFeature *fe
HB_GPOS_Clear_Features(face->gpos);
HB_UShort script_index;
HB_Error error = HB_GPOS_Select_Script(face->gpos, tag, &script_index);
+ if (error == HB_Err_Not_Covered) {
+ error = HB_GPOS_Select_Script(face->gpos, DefaultScript, &script_index);
+ }
if (!error) {
#ifdef OT_DEBUG
{