[autofit] Don't combine multiple features into one set.
Combining them, as originally envisioned, would lead to much more complicated code, as investigations have shown meanwhile. The major drawback is that we run out of available style slots much earlier. However, this is only a theoretical issue since we don't support a large number of scripts currently. * src/autofit/afcover.h: Replace `COVERAGE_{1,2,3}' macros with a single-element `COVERAGE' macro, sort the elements by the feature tags, and add entry for `ruby'. * src/autofit/aftypes.h: Updated. * src/autofit/hbshim.c: Updated.
This commit is contained in:
parent
072dc45d27
commit
44aa7e0af5
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,20 @@
|
||||||
|
2013-12-30 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[autofit] Don't combine multiple features into one set.
|
||||||
|
|
||||||
|
Combining them, as originally envisioned, would lead to much more
|
||||||
|
complicated code, as investigations have shown meanwhile. The major
|
||||||
|
drawback is that we run out of available style slots much earlier.
|
||||||
|
However, this is only a theoretical issue since we don't support a
|
||||||
|
large number of scripts currently.
|
||||||
|
|
||||||
|
* src/autofit/afcover.h: Replace `COVERAGE_{1,2,3}' macros with
|
||||||
|
a single-element `COVERAGE' macro, sort the elements by the feature
|
||||||
|
tags, and add entry for `ruby'.
|
||||||
|
|
||||||
|
* src/autofit/aftypes.h: Updated.
|
||||||
|
* src/autofit/hbshim.c: Updated.
|
||||||
|
|
||||||
2013-12-28 Werner Lemberg <wl@gnu.org>
|
2013-12-28 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
[autofit] Code shuffling to reduce use of cpp macros.
|
[autofit] Code shuffling to reduce use of cpp macros.
|
||||||
|
@ -93,7 +110,7 @@
|
||||||
http://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html
|
http://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html
|
||||||
|
|
||||||
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch
|
* src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch
|
||||||
`sort_by_res_id' to control the fragmented resource ordering.
|
`sort_by_res_id' to control the fragmented resource ordering.
|
||||||
* include/internal/ftrfork.h: Declare new switch.
|
* include/internal/ftrfork.h: Declare new switch.
|
||||||
* src/base/ftobjs.c (IsMacResource): Enable the sorting for `POST'
|
* src/base/ftobjs.c (IsMacResource): Enable the sorting for `POST'
|
||||||
resource, and disable the sorting for `sfnt' resource.
|
resource, and disable the sorting for `sfnt' resource.
|
||||||
|
|
|
@ -17,50 +17,79 @@
|
||||||
|
|
||||||
|
|
||||||
/* This header file can be included multiple times. */
|
/* This header file can be included multiple times. */
|
||||||
/* Define `COVERAGE_{1,2,3}' as needed. */
|
/* Define `COVERAGE' as needed. */
|
||||||
|
|
||||||
|
|
||||||
/* Add new coverages here. The first and second arguments are the */
|
/* Add new coverages here. The first and second arguments are the */
|
||||||
/* coverage name in lowercase and uppercase, respectively, followed */
|
/* coverage name in lowercase and uppercase, respectively, followed */
|
||||||
/* by a description string. The remaining arguments the */
|
/* by a description string. The last four arguments are the four */
|
||||||
/* corresponding OpenType features (with four characters a feature). */
|
/* characters defining the corresponding OpenType feature. */
|
||||||
|
|
||||||
COVERAGE_1( oldstyle_figures, OLDSTYLE_FIGURES,
|
COVERAGE( alternative_fractions, ALTERNATIVE_FRACTIONS,
|
||||||
"oldstyle figures",
|
"alternative fractions",
|
||||||
'o', 'n', 'u', 'm' ) /* Oldstyle Figures */
|
'a', 'f', 'r', 'c' )
|
||||||
|
|
||||||
COVERAGE_2( petite_capitals, PETITE_CAPITALS,
|
COVERAGE( petite_capitals_from_capitals, PETITE_CAPITALS_FROM_CAPITALS,
|
||||||
"petite capitals",
|
"petite capitals from capitals",
|
||||||
'c', '2', 'c', 'p', /* Petite Capitals from Capitals */
|
'c', '2', 'c', 'p' )
|
||||||
'p', 'c', 'a', 'p' ) /* Petite Capitals */
|
|
||||||
|
|
||||||
COVERAGE_2( small_capitals, SMALL_CAPITALS,
|
COVERAGE( small_capitals_from_capitals, SMALL_CAPITALS_FROM_CAPITALS,
|
||||||
"small capitals",
|
"small capitals from capitals",
|
||||||
'c', '2', 's', 'c', /* Small Capitals from Capitals */
|
'c', '2', 's', 'c' )
|
||||||
's', 'm', 'c', 'p' ) /* Small Capitals */
|
|
||||||
|
|
||||||
COVERAGE_1( titling, TITLING,
|
COVERAGE( denominators, DENOMINATORS,
|
||||||
"titling",
|
"denominators",
|
||||||
't', 'i', 't', 'l' ) /* Titling */
|
'd', 'n', 'o', 'm' )
|
||||||
|
|
||||||
COVERAGE_2( sub_superscript_1, SUB_SUPERSCRIPT_1,
|
COVERAGE( fractions, FRACTIONS,
|
||||||
"sub- and superscripts group 1",
|
"fractions",
|
||||||
's', 'u', 'b', 's', /* Subscript */
|
'f', 'r', 'a', 'c' )
|
||||||
's', 'u', 'p', 's' ) /* Superscript */
|
|
||||||
|
|
||||||
COVERAGE_2( sub_superscript_2, SUB_SUPERSCRIPT_2,
|
COVERAGE( numerators, NUMERATORS,
|
||||||
"sub- and superscripts group 2",
|
"numerators",
|
||||||
'o', 'r', 'd', 'n', /* Ordinals */
|
'n', 'u', 'm', 'r' )
|
||||||
's', 'i', 'n', 'f' ) /* Scientific Inferiors */
|
|
||||||
|
|
||||||
COVERAGE_3( fractions, FRACTIONS,
|
COVERAGE( oldstyle_figures, OLDSTYLE_FIGURES,
|
||||||
"fractions",
|
"oldstyle figures",
|
||||||
'd', 'n', 'o', 'm', /* Denominators */
|
'o', 'n', 'u', 'm' )
|
||||||
'f', 'r', 'a', 'c', /* Fractions */
|
|
||||||
'n', 'u', 'm', 'r' ) /* Numerators */
|
COVERAGE( ordinals, ORDINALS,
|
||||||
|
"ordinals",
|
||||||
|
'o', 'r', 'd', 'n' )
|
||||||
|
|
||||||
|
COVERAGE( petite_capitals, PETITE_CAPITALS,
|
||||||
|
"petite capitals",
|
||||||
|
'p', 'c', 'a', 'p' )
|
||||||
|
|
||||||
|
COVERAGE( ruby, RUBY,
|
||||||
|
"ruby",
|
||||||
|
'r', 'u', 'b', 'y' )
|
||||||
|
|
||||||
|
COVERAGE( scientific_inferiors, SCIENTIFIC_INFERIORS,
|
||||||
|
"scientific inferiors",
|
||||||
|
's', 'i', 'n', 'f' )
|
||||||
|
|
||||||
|
COVERAGE( small_capitals, SMALL_CAPITALS,
|
||||||
|
"small capitals",
|
||||||
|
's', 'm', 'c', 'p' )
|
||||||
|
|
||||||
|
COVERAGE( subscript, SUBSCRIPT,
|
||||||
|
"subscript",
|
||||||
|
's', 'u', 'b', 's' )
|
||||||
|
|
||||||
|
COVERAGE( superscript, SUPERSCRIPT,
|
||||||
|
"superscript",
|
||||||
|
's', 'u', 'p', 's' )
|
||||||
|
|
||||||
|
COVERAGE( titling, TITLING,
|
||||||
|
"titling",
|
||||||
|
't', 'i', 't', 'l' )
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* to be always excluded */
|
||||||
|
COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */
|
||||||
|
COVERAGE(ornm, 'o', 'r', 'n', 'm'); /* Ornaments (?) */
|
||||||
|
#endif
|
||||||
|
|
||||||
COVERAGE_1( alternative_fractions, ALTERNATIVE_FRACTIONS,
|
|
||||||
"alternative fractions",
|
|
||||||
'a', 'f', 'r', 'c' ) /* Alternative Fractions */
|
|
||||||
|
|
||||||
/* END */
|
/* END */
|
||||||
|
|
|
@ -370,12 +370,11 @@ extern void* _af_debug_hints;
|
||||||
* representation forms. How this mapping happens is completely
|
* representation forms. How this mapping happens is completely
|
||||||
* uninteresting to us.
|
* uninteresting to us.
|
||||||
*
|
*
|
||||||
* For the auto-hinter, a `coverage' represents all glyphs of one or more
|
* For the auto-hinter, a `coverage' represents all glyphs of an OpenType
|
||||||
* OpenType features collected in a set (as listed below) that can be
|
* feature collected in a set (as listed below) that can be hinted
|
||||||
* hinted together. To continue the above example, superscript glyphs
|
* together. To continue the above example, superscript glyphs must not
|
||||||
* must not be hinted together with normal glyphs because the blue zones
|
* be hinted together with normal glyphs because the blue zones
|
||||||
* completely differ. On the other hand, superscripts and subscripts
|
* completely differ.
|
||||||
* don't overlap, so they can be combined into a single set.
|
|
||||||
*
|
*
|
||||||
* Note that FreeType itself doesn't compute coverages; it only provides
|
* Note that FreeType itself doesn't compute coverages; it only provides
|
||||||
* the glyphs addressable by the default Unicode character map. Instead,
|
* the glyphs addressable by the default Unicode character map. Instead,
|
||||||
|
@ -389,22 +388,9 @@ extern void* _af_debug_hints;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef COVERAGE_1
|
#undef COVERAGE
|
||||||
#define COVERAGE_1( name, NAME, description, \
|
#define COVERAGE( name, NAME, description, \
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4 ) \
|
tag1, tag2, tag3, tag4 ) \
|
||||||
AF_COVERAGE_ ## NAME,
|
|
||||||
|
|
||||||
#undef COVERAGE_2
|
|
||||||
#define COVERAGE_2( name, NAME, description, \
|
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4, \
|
|
||||||
tag_b1, tag_b2, tag_b3, tag_b4 ) \
|
|
||||||
AF_COVERAGE_ ## NAME,
|
|
||||||
|
|
||||||
#undef COVERAGE_3
|
|
||||||
#define COVERAGE_3( name, NAME, description, \
|
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4, \
|
|
||||||
tag_b1, tag_b2, tag_b3, tag_b4, \
|
|
||||||
tag_c1, tag_c2, tag_c3, tag_c4 ) \
|
|
||||||
AF_COVERAGE_ ## NAME,
|
AF_COVERAGE_ ## NAME,
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -38,10 +38,10 @@
|
||||||
* usual mathematical meaning) to manage both lookups and glyph indices.
|
* usual mathematical meaning) to manage both lookups and glyph indices.
|
||||||
*
|
*
|
||||||
* 1. For each coverage, collect lookup IDs in a set. Note that an
|
* 1. For each coverage, collect lookup IDs in a set. Note that an
|
||||||
* auto-hinter `coverage' is represented by one or more `feature's, and
|
* auto-hinter `coverage' is represented by one `feature', and a
|
||||||
* a feature consists of an arbitrary number of (font specific)
|
* feature consists of an arbitrary number of (font specific) `lookup's
|
||||||
* `lookup's that actually do the mapping job. Please check the
|
* that actually do the mapping job. Please check the OpenType
|
||||||
* OpenType specification for more details on features and lookups.
|
* specification for more details on features and lookups.
|
||||||
*
|
*
|
||||||
* 2. Create glyph ID sets from the corresponding lookup sets.
|
* 2. Create glyph ID sets from the corresponding lookup sets.
|
||||||
*
|
*
|
||||||
|
@ -54,36 +54,12 @@
|
||||||
|
|
||||||
|
|
||||||
/* load coverage tags */
|
/* load coverage tags */
|
||||||
#undef COVERAGE_1
|
#undef COVERAGE
|
||||||
#define COVERAGE_1( name, NAME, description, \
|
#define COVERAGE( name, NAME, description, \
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4 ) \
|
tag1, tag2, tag3, tag4 ) \
|
||||||
static const hb_tag_t name ## _coverage[] = \
|
static const hb_tag_t name ## _coverage[] = \
|
||||||
{ \
|
{ \
|
||||||
HB_TAG( tag_a1, tag_a2, tag_a3, tag_a4 ), \
|
HB_TAG( tag1, tag2, tag3, tag4 ), \
|
||||||
HB_TAG_NONE \
|
|
||||||
};
|
|
||||||
|
|
||||||
#undef COVERAGE_2
|
|
||||||
#define COVERAGE_2( name, NAME, description, \
|
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4, \
|
|
||||||
tag_b1, tag_b2, tag_b3, tag_b4 ) \
|
|
||||||
static const hb_tag_t name ## _coverage[] = \
|
|
||||||
{ \
|
|
||||||
HB_TAG( tag_a1, tag_a2, tag_a3, tag_a4 ), \
|
|
||||||
HB_TAG( tag_b1, tag_b2, tag_b3, tag_b4 ), \
|
|
||||||
HB_TAG_NONE \
|
|
||||||
};
|
|
||||||
|
|
||||||
#undef COVERAGE_3
|
|
||||||
#define COVERAGE_3( name, NAME, description, \
|
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4, \
|
|
||||||
tag_b1, tag_b2, tag_b3, tag_b4, \
|
|
||||||
tag_c1, tag_c2, tag_c3, tag_c4 ) \
|
|
||||||
static const hb_tag_t name ## _coverage[] = \
|
|
||||||
{ \
|
|
||||||
HB_TAG( tag_a1, tag_a2, tag_a3, tag_a4 ), \
|
|
||||||
HB_TAG( tag_b1, tag_b2, tag_b3, tag_b4 ), \
|
|
||||||
HB_TAG( tag_c1, tag_c2, tag_c3, tag_c4 ), \
|
|
||||||
HB_TAG_NONE \
|
HB_TAG_NONE \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -92,22 +68,9 @@
|
||||||
|
|
||||||
|
|
||||||
/* define mapping between coverage tags and AF_Coverage */
|
/* define mapping between coverage tags and AF_Coverage */
|
||||||
#undef COVERAGE_1
|
#undef COVERAGE
|
||||||
#define COVERAGE_1( name, NAME, description, \
|
#define COVERAGE( name, NAME, description, \
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4 ) \
|
tag1, tag2, tag3, tag4 ) \
|
||||||
name ## _coverage,
|
|
||||||
|
|
||||||
#undef COVERAGE_2
|
|
||||||
#define COVERAGE_2( name, NAME, description, \
|
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4, \
|
|
||||||
tag_b1, tag_b2, tag_b3, tag_b4 ) \
|
|
||||||
name ## _coverage,
|
|
||||||
|
|
||||||
#undef COVERAGE_3
|
|
||||||
#define COVERAGE_3( name, NAME, description, \
|
|
||||||
tag_a1, tag_a2, tag_a3, tag_a4, \
|
|
||||||
tag_b1, tag_b2, tag_b3, tag_b4, \
|
|
||||||
tag_c1, tag_c2, tag_c3, tag_c4 ) \
|
|
||||||
name ## _coverage,
|
name ## _coverage,
|
||||||
|
|
||||||
|
|
||||||
|
@ -283,14 +246,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* to be always excluded */
|
|
||||||
COVERAGE(nalt, 'n', 'a', 'l', 't'); /* Alternate Annotation Forms (?) */
|
|
||||||
COVERAGE(ornm, 'o', 'r', 'n', 'm'); /* Ornaments (?) */
|
|
||||||
/* COVERAGE(ruby, 'r', 'u', 'b', 'y') */ /* (only for Japanese) */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#else /* !FT_CONFIG_OPTION_USE_HARDBUZZ */
|
#else /* !FT_CONFIG_OPTION_USE_HARDBUZZ */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue