aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2010-09-16 10:51:56 +0900
committerKenichi Handa2010-09-16 10:51:56 +0900
commitfa3f60399014127e711f3f438004950cba0bddb9 (patch)
treeb9e8b8d96f44552f47b0ff6c5217d94cec072dc9 /src
parent308e764f26f61572067a959f6cbf94d7bd3f2e4e (diff)
downloademacs-fa3f60399014127e711f3f438004950cba0bddb9.tar.gz
emacs-fa3f60399014127e711f3f438004950cba0bddb9.zip
ftfont.c (ftfont_check_otf): Fix the case of checking just existence of GSUB or GPOS.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/ftfont.c67
2 files changed, 50 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4b4f82aa4c8..5a248bacc03 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-09-14 Kenichi Handa <handa@m17n.org>
2
3 * ftfont.c (ftfont_check_otf): Fix the case of checking just
4 existence of GSUB or GPOS.
5
12010-09-05 Juanma Barranquero <lekktu@gmail.com> 62010-09-05 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * biditype.h: Regenerate. 8 * biditype.h: Regenerate.
diff --git a/src/ftfont.c b/src/ftfont.c
index b99e50ca3ff..9eb7af27657 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1637,32 +1637,55 @@ ftfont_check_otf (MFLTFont *font, MFLTOtfSpec *spec)
1637 OTF_Tag *tags; 1637 OTF_Tag *tags;
1638 int i, n, negative; 1638 int i, n, negative;
1639 1639
1640 if (spec->features[0] && spec->features[0][0] ==0
1641 && spec->features[1] && spec->features[1][0] ==0)
1642 /* Return 1 iff any of GSUB or GPOS support the script (and language). */
1643 return (otf
1644 && (OTF_check_features (otf, 0, spec->script, spec->langsys,
1645 NULL, 0) > 0
1646 || OTF_check_features (otf, 1, spec->script, spec->langsys,
1647 NULL, 0) > 0));
1648
1640 for (i = 0; i < 2; i++) 1649 for (i = 0; i < 2; i++)
1641 { 1650 if (! spec->features[i] || spec->features[i][0] != 0)
1642 if (! spec->features[i]) 1651 {
1643 continue; 1652 int no_feature = ! otf || OTF_get_features (otf, i == 0) < 0;
1644 for (n = 0; spec->features[i][n]; n++); 1653 if (! spec->features[i])
1645 tags = alloca (sizeof (OTF_Tag) * n); 1654 {
1646 for (n = 0, negative = 0; spec->features[i][n]; n++) 1655 if (no_feature)
1647 { 1656 continue;
1648 if (spec->features[i][n] == 0xFFFFFFFF) 1657 return 0;
1649 negative = 1; 1658 }
1650 else if (negative) 1659 if (spec->features[i][0] == 0xFFFFFFFF)
1651 tags[n - 1] = spec->features[i][n] | 0x80000000; 1660 {
1652 else 1661 if (no_feature)
1653 tags[n] = spec->features[i][n]; 1662 continue;
1654 } 1663 }
1664 else if (no_feature)
1665 return 0;
1666 /* Now (! no_feature) */
1667 for (n = 1; spec->features[i][n]; n++);
1668 tags = alloca (sizeof (OTF_Tag) * n);
1669 for (n = 0, negative = 0; spec->features[i][n]; n++)
1670 {
1671 if (spec->features[i][n] == 0xFFFFFFFF)
1672 negative = 1;
1673 else if (negative)
1674 tags[n - 1] = spec->features[i][n] | 0x80000000;
1675 else
1676 tags[n] = spec->features[i][n];
1677 }
1655#ifdef M17N_FLT_USE_NEW_FEATURE 1678#ifdef M17N_FLT_USE_NEW_FEATURE
1656 if (OTF_check_features (otf, i == 0, spec->script, spec->langsys, 1679 if (OTF_check_features (otf, i == 0, spec->script, spec->langsys,
1657 tags, n - negative) != 1) 1680 tags, n - negative) != 1)
1658 return 0; 1681 return 0;
1659#else /* not M17N_FLT_USE_NEW_FEATURE */ 1682#else /* not M17N_FLT_USE_NEW_FEATURE */
1660 if (n - negative > 0 1683 if (n - negative > 0
1661 && OTF_check_features (otf, i == 0, spec->script, spec->langsys, 1684 && OTF_check_features (otf, i == 0, spec->script, spec->langsys,
1662 tags, n - negative) != 1) 1685 tags, n - negative) != 1)
1663 return 0; 1686 return 0;
1664#endif /* not M17N_FLT_USE_NEW_FEATURE */ 1687#endif /* not M17N_FLT_USE_NEW_FEATURE */
1665 } 1688 }
1666 return 1; 1689 return 1;
1667} 1690}
1668 1691