[autofit] s/glyph_scripts/glyph_styles/.

This is the first commit of a series to create a new top-level
structure (a `style') for handling scripts, writing_systems, and
soon-to-be-added coverages.
This commit is contained in:
Werner Lemberg 2013-12-18 10:36:06 +01:00
parent 7a5fc2f362
commit 9a35455045
4 changed files with 24 additions and 16 deletions

View File

@ -1,3 +1,11 @@
2013-12-18 Werner Lemberg <wl@gnu.org>
[autofit] s/glyph_scripts/glyph_styles/.
This is the first commit of a series to create a new top-level
structure (a `style') for handling scripts, writing_systems, and
soon-to-be-added coverages.
2013-12-17 Werner Lemberg <wl@gnu.org> 2013-12-17 Werner Lemberg <wl@gnu.org>
[autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate. [autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate.

View File

@ -83,13 +83,13 @@
FT_Error error; FT_Error error;
FT_Face face = globals->face; FT_Face face = globals->face;
FT_CharMap old_charmap = face->charmap; FT_CharMap old_charmap = face->charmap;
FT_Byte* gscripts = globals->glyph_scripts; FT_Byte* gscripts = globals->glyph_styles;
FT_UInt ss; FT_UInt ss;
FT_UInt i; FT_UInt i;
/* the value AF_SCRIPT_UNASSIGNED means `uncovered glyph' */ /* the value AF_SCRIPT_UNASSIGNED means `uncovered glyph' */
FT_MEM_SET( globals->glyph_scripts, FT_MEM_SET( globals->glyph_styles,
AF_SCRIPT_UNASSIGNED, AF_SCRIPT_UNASSIGNED,
globals->glyph_count ); globals->glyph_count );
@ -200,7 +200,7 @@
globals->face = face; globals->face = face;
globals->glyph_count = face->num_glyphs; globals->glyph_count = face->num_glyphs;
globals->glyph_scripts = (FT_Byte*)( globals + 1 ); globals->glyph_styles = (FT_Byte*)( globals + 1 );
globals->module = module; globals->module = module;
error = af_face_globals_compute_script_coverage( globals ); error = af_face_globals_compute_script_coverage( globals );
@ -245,7 +245,7 @@
} }
globals->glyph_count = 0; globals->glyph_count = 0;
globals->glyph_scripts = NULL; /* no need to free this one! */ globals->glyph_styles = NULL; /* no need to free this one! */
globals->face = NULL; globals->face = NULL;
FT_FREE( globals ); FT_FREE( globals );
@ -275,9 +275,9 @@
} }
/* if we have a forced script (via `options'), use it, */ /* if we have a forced script (via `options'), use it, */
/* otherwise look into `glyph_scripts' array */ /* otherwise look into `glyph_styles' array */
if ( script == AF_SCRIPT_NONE || script + 1 >= AF_SCRIPT_MAX ) if ( script == AF_SCRIPT_NONE || script + 1 >= AF_SCRIPT_MAX )
script = (AF_Script)( globals->glyph_scripts[gindex] & script = (AF_Script)( globals->glyph_styles[gindex] &
AF_SCRIPT_UNASSIGNED ); AF_SCRIPT_UNASSIGNED );
script_class = AF_SCRIPT_CLASSES_GET[script]; script_class = AF_SCRIPT_CLASSES_GET[script];
@ -326,7 +326,7 @@
FT_UInt gindex ) FT_UInt gindex )
{ {
if ( gindex < (FT_ULong)globals->glyph_count ) if ( gindex < (FT_ULong)globals->glyph_count )
return (FT_Bool)( globals->glyph_scripts[gindex] & AF_DIGIT ); return (FT_Bool)( globals->glyph_styles[gindex] & AF_DIGIT );
return (FT_Bool)0; return (FT_Bool)0;
} }

View File

@ -70,7 +70,7 @@ FT_BEGIN_HEADER
/* /*
* Note that glyph_scripts[] maps each glyph to an index into the * Note that glyph_styles[] maps each glyph to an index into the
* `af_script_classes' array. * `af_script_classes' array.
* *
*/ */
@ -78,7 +78,7 @@ FT_BEGIN_HEADER
{ {
FT_Face face; FT_Face face;
FT_Long glyph_count; /* same as face->num_glyphs */ FT_Long glyph_count; /* same as face->num_glyphs */
FT_Byte* glyph_scripts; FT_Byte* glyph_styles;
/* per-face auto-hinter properties */ /* per-face auto-hinter properties */
FT_UInt increase_x_height; FT_UInt increase_x_height;

View File

@ -134,7 +134,7 @@
error = af_property_get_face_globals( prop->face, &globals, module ); error = af_property_get_face_globals( prop->face, &globals, module );
if ( !error ) if ( !error )
prop->map = globals->glyph_scripts; prop->map = globals->glyph_styles;
return error; return error;
} }