[autofit] Minor reorganization. * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT, AF_SCRIPT_LIST_NONE, AF_DIGIT): Move to... * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT, AF_SCRIPT_LIST_NONE, AF_DIGIT): This and update code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
diff --git a/ChangeLog b/ChangeLog
index 5a08dee..faa1908 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-12 Werner Lemberg <wl@gnu.org>
+
+ [autofit] Minor reorganization.
+
+ * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT,
+ AF_SCRIPT_LIST_NONE, AF_DIGIT): Move to...
+ * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT, AF_SCRIPT_LIST_NONE,
+ AF_DIGIT): This and update code.
+
2012-09-01 Werner Lemberg <wl@gnu.org>
[autofit] Implement `glyph-to-script-map' property.
diff --git a/src/autofit/afglobal.c b/src/autofit/afglobal.c
index 9a5bac2..1842c86 100644
--- a/src/autofit/afglobal.c
+++ b/src/autofit/afglobal.c
@@ -49,13 +49,6 @@
#endif /* !FT_CONFIG_OPTION_PIC */
- /* index of default script in `af_script_classes' */
-#define AF_SCRIPT_LIST_DEFAULT 2
- /* a bit mask indicating an uncovered glyph */
-#define AF_SCRIPT_LIST_NONE 0x7F
- /* if this flag is set, we have an ASCII digit */
-#define AF_DIGIT 0x80
-
/* Compute the script index of each glyph within a given face. */
@@ -70,9 +63,9 @@
FT_UInt i;
- /* the value AF_SCRIPT_LIST_NONE means `uncovered glyph' */
+ /* the value AF_SCRIPT_NONE means `uncovered glyph' */
FT_MEM_SET( globals->glyph_scripts,
- AF_SCRIPT_LIST_NONE,
+ AF_SCRIPT_NONE,
globals->glyph_count );
error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
@@ -110,7 +103,7 @@
if ( gindex != 0 &&
gindex < (FT_ULong)globals->glyph_count &&
- gscripts[gindex] == AF_SCRIPT_LIST_NONE )
+ gscripts[gindex] == AF_SCRIPT_NONE )
gscripts[gindex] = (FT_Byte)ss;
for (;;)
@@ -121,7 +114,7 @@
break;
if ( gindex < (FT_ULong)globals->glyph_count &&
- gscripts[gindex] == AF_SCRIPT_LIST_NONE )
+ gscripts[gindex] == AF_SCRIPT_NONE )
gscripts[gindex] = (FT_Byte)ss;
}
}
@@ -148,10 +141,10 @@
for ( nn = 0; nn < globals->glyph_count; nn++ )
{
- if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_LIST_NONE )
+ if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_NONE )
{
- gscripts[nn] &= ~AF_SCRIPT_LIST_NONE;
- gscripts[nn] |= AF_SCRIPT_LIST_DEFAULT;
+ gscripts[nn] &= ~AF_SCRIPT_NONE;
+ gscripts[nn] |= AF_SCRIPT_DEFAULT;
}
}
}
@@ -250,7 +243,7 @@
gidx = script;
if ( gidx == 0 || gidx + 1 >= script_max )
- gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_LIST_NONE;
+ gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_NONE;
clazz = AF_SCRIPT_CLASSES_GET[gidx];
if ( script == 0 )
diff --git a/src/autofit/afglobal.h b/src/autofit/afglobal.h
index 9137dce..3bb77d1 100644
--- a/src/autofit/afglobal.h
+++ b/src/autofit/afglobal.h
@@ -36,6 +36,14 @@ FT_BEGIN_HEADER
/************************************************************************/
+ /* index of default script in `af_script_classes' */
+#define AF_SCRIPT_DEFAULT 2
+ /* a bit mask indicating an uncovered glyph */
+#define AF_SCRIPT_NONE 0x7F
+ /* if this flag is set, we have an ASCII digit */
+#define AF_DIGIT 0x80
+
+
/*
* Note that glyph_scripts[] is used to map each glyph into
* an index into the `af_script_classes' array.