[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r101445: ftfont.c (ftfont_check_otf):
From: |
Kenichi Handa |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r101445: ftfont.c (ftfont_check_otf): Fix the case of checking just existence of GSUB or GPOS. |
Date: |
Thu, 16 Sep 2010 11:12:27 +0900 |
User-agent: |
Bazaar (2.0.3) |
------------------------------------------------------------
revno: 101445 [merge]
committer: Kenichi Handa <address@hidden>
branch nick: trunk
timestamp: Thu 2010-09-16 11:12:27 +0900
message:
ftfont.c (ftfont_check_otf): Fix the case of checking just existence of GSUB
or GPOS.
modified:
src/ChangeLog
src/ftfont.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2010-09-14 20:32:35 +0000
+++ b/src/ChangeLog 2010-09-16 02:11:13 +0000
@@ -1,3 +1,8 @@
+2010-09-14 Kenichi Handa <address@hidden>
+
+ * ftfont.c (ftfont_check_otf): Fix the case of checking just
+ existence of GSUB or GPOS.
+
2010-09-14 Juanma Barranquero <address@hidden>
* cmds.c (syms_of_cmds) <post-self-insert-hook>: Fix typos in docstring.
=== modified file 'src/ftfont.c'
--- a/src/ftfont.c 2010-08-08 21:03:45 +0000
+++ b/src/ftfont.c 2010-09-16 01:51:56 +0000
@@ -1637,32 +1637,55 @@
OTF_Tag *tags;
int i, n, negative;
+ if (spec->features[0] && spec->features[0][0] ==0
+ && spec->features[1] && spec->features[1][0] ==0)
+ /* Return 1 iff any of GSUB or GPOS support the script (and language). */
+ return (otf
+ && (OTF_check_features (otf, 0, spec->script, spec->langsys,
+ NULL, 0) > 0
+ || OTF_check_features (otf, 1, spec->script, spec->langsys,
+ NULL, 0) > 0));
+
for (i = 0; i < 2; i++)
- {
- if (! spec->features[i])
- continue;
- for (n = 0; spec->features[i][n]; n++);
- tags = alloca (sizeof (OTF_Tag) * n);
- for (n = 0, negative = 0; spec->features[i][n]; n++)
- {
- if (spec->features[i][n] == 0xFFFFFFFF)
- negative = 1;
- else if (negative)
- tags[n - 1] = spec->features[i][n] | 0x80000000;
- else
- tags[n] = spec->features[i][n];
- }
+ if (! spec->features[i] || spec->features[i][0] != 0)
+ {
+ int no_feature = ! otf || OTF_get_features (otf, i == 0) < 0;
+ if (! spec->features[i])
+ {
+ if (no_feature)
+ continue;
+ return 0;
+ }
+ if (spec->features[i][0] == 0xFFFFFFFF)
+ {
+ if (no_feature)
+ continue;
+ }
+ else if (no_feature)
+ return 0;
+ /* Now (! no_feature) */
+ for (n = 1; spec->features[i][n]; n++);
+ tags = alloca (sizeof (OTF_Tag) * n);
+ for (n = 0, negative = 0; spec->features[i][n]; n++)
+ {
+ if (spec->features[i][n] == 0xFFFFFFFF)
+ negative = 1;
+ else if (negative)
+ tags[n - 1] = spec->features[i][n] | 0x80000000;
+ else
+ tags[n] = spec->features[i][n];
+ }
#ifdef M17N_FLT_USE_NEW_FEATURE
- if (OTF_check_features (otf, i == 0, spec->script, spec->langsys,
- tags, n - negative) != 1)
- return 0;
+ if (OTF_check_features (otf, i == 0, spec->script, spec->langsys,
+ tags, n - negative) != 1)
+ return 0;
#else /* not M17N_FLT_USE_NEW_FEATURE */
- if (n - negative > 0
- && OTF_check_features (otf, i == 0, spec->script, spec->langsys,
- tags, n - negative) != 1)
- return 0;
+ if (n - negative > 0
+ && OTF_check_features (otf, i == 0, spec->script, spec->langsys,
+ tags, n - negative) != 1)
+ return 0;
#endif /* not M17N_FLT_USE_NEW_FEATURE */
- }
+ }
return 1;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r101445: ftfont.c (ftfont_check_otf): Fix the case of checking just existence of GSUB or GPOS.,
Kenichi Handa <=