aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2010-09-17 13:57:58 +0900
committerKenichi Handa2010-09-17 13:57:58 +0900
commit78a217725f91bce7f3981c1ba1fdbdedab9cc96a (patch)
tree7f018cec53615425631d676bf3b24b9233a8b8ac /src
parent38d50547c2a8195bed0aaeafbbc4c0f277d4e416 (diff)
downloademacs-78a217725f91bce7f3981c1ba1fdbdedab9cc96a.tar.gz
emacs-78a217725f91bce7f3981c1ba1fdbdedab9cc96a.zip
ftfont.c (ftfont_check_otf): Fix previous change.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/ftfont.c31
2 files changed, 24 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d62215e4eef..f294f41e020 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12010-09-17 Kenichi Handa <handa@m17n.org>
2
3 * ftfont.c (ftfont_check_otf): Fix previous change.
4
12010-09-14 Kenichi Handa <handa@m17n.org> 52010-09-14 Kenichi Handa <handa@m17n.org>
2 6
3 * ftfont.c (ftfont_check_otf): Fix the case of checking just 7 * ftfont.c (ftfont_check_otf): Fix the case of checking just
diff --git a/src/ftfont.c b/src/ftfont.c
index 9eb7af27657..97bf265a84c 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -1632,13 +1632,18 @@ ftfont_get_metrics (MFLTFont *font, MFLTGlyphString *gstring,
1632static int 1632static int
1633ftfont_check_otf (MFLTFont *font, MFLTOtfSpec *spec) 1633ftfont_check_otf (MFLTFont *font, MFLTOtfSpec *spec)
1634{ 1634{
1635#define FEATURE_NONE(IDX) (! spec->features[IDX])
1636
1637#define FEATURE_ANY(IDX) \
1638 (spec->features[IDX] \
1639 && spec->features[IDX][0] == 0xFFFFFFFF && spec->features[IDX][1] == 0)
1640
1635 struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font; 1641 struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font;
1636 OTF *otf = flt_font_ft->otf; 1642 OTF *otf = flt_font_ft->otf;
1637 OTF_Tag *tags; 1643 OTF_Tag *tags;
1638 int i, n, negative; 1644 int i, n, negative;
1639 1645
1640 if (spec->features[0] && spec->features[0][0] ==0 1646 if (FEATURE_ANY (0) && FEATURE_ANY (1))
1641 && spec->features[1] && spec->features[1][0] ==0)
1642 /* Return 1 iff any of GSUB or GPOS support the script (and language). */ 1647 /* Return 1 iff any of GSUB or GPOS support the script (and language). */
1643 return (otf 1648 return (otf
1644 && (OTF_check_features (otf, 0, spec->script, spec->langsys, 1649 && (OTF_check_features (otf, 0, spec->script, spec->langsys,
@@ -1647,23 +1652,25 @@ ftfont_check_otf (MFLTFont *font, MFLTOtfSpec *spec)
1647 NULL, 0) > 0)); 1652 NULL, 0) > 0));
1648 1653
1649 for (i = 0; i < 2; i++) 1654 for (i = 0; i < 2; i++)
1650 if (! spec->features[i] || spec->features[i][0] != 0) 1655 if (! FEATURE_ANY (i))
1651 { 1656 {
1652 int no_feature = ! otf || OTF_get_features (otf, i == 0) < 0; 1657 if (FEATURE_NONE (i))
1653 if (! spec->features[i])
1654 { 1658 {
1655 if (no_feature) 1659 if (otf
1656 continue; 1660 && OTF_check_features (otf, i == 0, spec->script, spec->langsys,
1657 return 0; 1661 NULL, 0) > 0)
1662 return 0;
1663 continue;
1658 } 1664 }
1659 if (spec->features[i][0] == 0xFFFFFFFF) 1665 if (spec->features[i][0] == 0xFFFFFFFF)
1660 { 1666 {
1661 if (no_feature) 1667 if (! otf
1668 || OTF_check_features (otf, i == 0, spec->script, spec->langsys,
1669 NULL, 0) <= 0)
1662 continue; 1670 continue;
1663 } 1671 }
1664 else if (no_feature) 1672 else if (! otf)
1665 return 0; 1673 return 0;
1666 /* Now (! no_feature) */
1667 for (n = 1; spec->features[i][n]; n++); 1674 for (n = 1; spec->features[i][n]; n++);
1668 tags = alloca (sizeof (OTF_Tag) * n); 1675 tags = alloca (sizeof (OTF_Tag) * n);
1669 for (n = 0, negative = 0; spec->features[i][n]; n++) 1676 for (n = 0, negative = 0; spec->features[i][n]; n++)
@@ -1687,6 +1694,8 @@ ftfont_check_otf (MFLTFont *font, MFLTOtfSpec *spec)
1687#endif /* not M17N_FLT_USE_NEW_FEATURE */ 1694#endif /* not M17N_FLT_USE_NEW_FEATURE */
1688 } 1695 }
1689 return 1; 1696 return 1;
1697#undef FEATURE_NONE
1698#undef FEATURE_ANY
1690} 1699}
1691 1700
1692#define DEVICE_DELTA(table, size) \ 1701#define DEVICE_DELTA(table, size) \