2005-03-03 18:09:08 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* afglobal.h */
|
|
|
|
/* */
|
|
|
|
/* Auto-fitter routines to compute global hinting values */
|
|
|
|
/* (specification). */
|
|
|
|
/* */
|
2017-01-04 20:16:34 +01:00
|
|
|
/* Copyright 2003-2017 by */
|
2005-03-03 18:09:08 +01:00
|
|
|
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
|
|
|
/* */
|
|
|
|
/* This file is part of the FreeType project, and may only be used, */
|
|
|
|
/* modified, and distributed under the terms of the FreeType project */
|
|
|
|
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
|
|
|
/* this file you indicate that you have read the license and */
|
|
|
|
/* understand and accept it fully. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef AFGLOBAL_H_
|
|
|
|
#define AFGLOBAL_H_
|
2003-11-23 22:39:51 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2003-11-23 22:39:51 +01:00
|
|
|
#include "aftypes.h"
|
2012-09-18 15:23:41 +02:00
|
|
|
#include "afmodule.h"
|
[autofit] Rewrite HarfBuzz interface to support character clusters.
Scripts like Khmer have blue zones that can't be directly
represented by Unicode characters. Instead, it is necessary to let
HarfBuzz convert character clusters into proper glyph representation
forms, then deriving the blue zone information from the resulting
glyphs.
* src/autofit/hbshim.c, src/autofit/hbshim.h: Replaced by...
* src/autofit/afshaper.c, src/autofit/afshaper.h: ... these two new
files, providing a new API to access HarfBuzz.
The new API manages a HarfBuzz buffer with `af_shaper_buf_create'
and `af_shaper_buf_destroy'. The buffer receives a UTF8 encoded
string with function `af_shaper_get_cluster', and the resulting
glyph data (indices, advance widths, vertical offsets) can be
iteratively accessed with function `af_shaper_get_elem'.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_check_digits):
Updated.
* include/freetype/internal/fttrace.h: s/afharfbuzz/afshaper/.
* src/autofit/afglobal.c: s/hbshim.h/afshaper.h/.
(af_face_globals_compute_style_coverage): Updated.
* src/autofit/afglocal.h: s/hbshim.h/afshaper.h/.
* src/autofit/autofit.c: s/hbshim.c/afshaper.c/.
* src/autofit/Jamfile, src/autofit/rules.mk (AUTOF_DRV_SRC):
Updated.
2015-12-06 18:52:41 +01:00
|
|
|
#include "afshaper.h"
|
2003-11-23 22:39:51 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2003-11-23 22:39:51 +01:00
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
|
|
|
|
2013-08-02 14:50:23 +02:00
|
|
|
FT_LOCAL_ARRAY( AF_WritingSystemClass )
|
|
|
|
af_writing_system_classes[];
|
|
|
|
|
2013-12-20 18:35:35 +01:00
|
|
|
|
2013-12-19 15:45:24 +01:00
|
|
|
#undef SCRIPT
|
2015-12-23 23:25:03 +01:00
|
|
|
#define SCRIPT( s, S, d, h, H, ss ) \
|
2013-12-19 15:45:24 +01:00
|
|
|
AF_DECLARE_SCRIPT_CLASS( af_ ## s ## _script_class )
|
|
|
|
|
|
|
|
#include "afscript.h"
|
|
|
|
|
2013-08-02 14:50:23 +02:00
|
|
|
FT_LOCAL_ARRAY( AF_ScriptClass )
|
|
|
|
af_script_classes[];
|
|
|
|
|
[autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.
* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.
* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition. This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.
* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.
* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.
* src/autofit/afranges.h: Updated.
* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
|
|
|
|
|
|
|
#undef STYLE
|
2013-12-21 21:31:38 +01:00
|
|
|
#define STYLE( s, S, d, ws, sc, ss, c ) \
|
[autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.
* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.
* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition. This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.
* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.
* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.
* src/autofit/afranges.h: Updated.
* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
|
|
|
AF_DECLARE_STYLE_CLASS( af_ ## s ## _style_class )
|
|
|
|
|
|
|
|
#include "afstyles.h"
|
|
|
|
|
|
|
|
FT_LOCAL_ARRAY( AF_StyleClass )
|
|
|
|
af_style_classes[];
|
|
|
|
|
|
|
|
|
2013-08-27 18:37:39 +02:00
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
|
|
|
FT_LOCAL_ARRAY( char* )
|
[autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.
* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.
* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition. This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.
* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.
* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.
* src/autofit/afranges.h: Updated.
* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
|
|
|
af_style_names[];
|
2013-08-27 18:37:39 +02:00
|
|
|
#endif
|
2013-08-02 14:50:23 +02:00
|
|
|
|
[autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.
* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.
* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition. This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.
* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.
* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.
* src/autofit/afranges.h: Updated.
* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
|
|
|
|
2012-09-18 23:26:37 +02:00
|
|
|
/*
|
|
|
|
* Default values and flags for both autofitter globals (found in
|
|
|
|
* AF_ModuleRec) and face globals (in AF_FaceGlobalsRec).
|
|
|
|
*/
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2013-12-21 21:31:38 +01:00
|
|
|
/* index of fallback style in `af_style_classes' */
|
2013-07-31 22:49:29 +02:00
|
|
|
#ifdef AF_CONFIG_OPTION_CJK
|
2014-06-13 09:28:00 +02:00
|
|
|
#define AF_STYLE_FALLBACK AF_STYLE_HANI_DFLT
|
2013-07-31 22:49:29 +02:00
|
|
|
#else
|
2014-06-13 09:28:00 +02:00
|
|
|
#define AF_STYLE_FALLBACK AF_STYLE_NONE_DFLT
|
2013-07-31 22:49:29 +02:00
|
|
|
#endif
|
2013-12-27 19:26:04 +01:00
|
|
|
/* default script for OpenType; ignored if HarfBuzz isn't used */
|
2014-06-13 09:28:00 +02:00
|
|
|
#define AF_SCRIPT_DEFAULT AF_SCRIPT_LATN
|
2015-08-31 08:51:52 +02:00
|
|
|
|
2015-09-30 17:52:42 +02:00
|
|
|
/* a bit mask for AF_DIGIT and AF_NONBASE */
|
2015-09-04 10:28:53 +02:00
|
|
|
#define AF_STYLE_MASK 0x3FFF
|
2015-08-31 08:51:52 +02:00
|
|
|
/* an uncovered glyph */
|
|
|
|
#define AF_STYLE_UNASSIGNED AF_STYLE_MASK
|
|
|
|
|
2015-09-04 10:28:53 +02:00
|
|
|
/* if this flag is set, we have an ASCII digit */
|
2015-08-30 10:35:21 +02:00
|
|
|
#define AF_DIGIT 0x8000U
|
2015-09-30 17:52:42 +02:00
|
|
|
/* if this flag is set, we have a non-base character */
|
|
|
|
#define AF_NONBASE 0x4000U
|
2012-09-12 17:45:39 +02:00
|
|
|
|
2012-09-18 23:26:37 +02:00
|
|
|
/* `increase-x-height' property */
|
|
|
|
#define AF_PROP_INCREASE_X_HEIGHT_MIN 6
|
|
|
|
#define AF_PROP_INCREASE_X_HEIGHT_MAX 0
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
/************************************************************************/
|
|
|
|
/***** *****/
|
|
|
|
/***** F A C E G L O B A L S *****/
|
|
|
|
/***** *****/
|
|
|
|
/************************************************************************/
|
|
|
|
/************************************************************************/
|
|
|
|
|
2012-09-12 17:45:39 +02:00
|
|
|
|
2012-09-01 22:31:43 +02:00
|
|
|
/*
|
2013-12-18 10:36:06 +01:00
|
|
|
* Note that glyph_styles[] maps each glyph to an index into the
|
[autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.
* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.
* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition. This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.
* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.
* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.
* src/autofit/afranges.h: Updated.
* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
|
|
|
* `af_style_classes' array.
|
2012-09-01 22:31:43 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
typedef struct AF_FaceGlobalsRec_
|
|
|
|
{
|
2013-12-18 12:59:35 +01:00
|
|
|
FT_Face face;
|
|
|
|
FT_Long glyph_count; /* same as face->num_glyphs */
|
2015-08-30 10:35:21 +02:00
|
|
|
FT_UShort* glyph_styles;
|
2012-09-01 22:31:43 +02:00
|
|
|
|
2013-12-28 08:55:24 +01:00
|
|
|
#ifdef FT_CONFIG_OPTION_USE_HARFBUZZ
|
|
|
|
hb_font_t* hb_font;
|
2015-12-11 08:08:48 +01:00
|
|
|
hb_buffer_t* hb_buf; /* for feature comparison */
|
2013-12-28 08:55:24 +01:00
|
|
|
#endif
|
|
|
|
|
2012-09-18 23:26:37 +02:00
|
|
|
/* per-face auto-hinter properties */
|
2013-12-18 12:59:35 +01:00
|
|
|
FT_UInt increase_x_height;
|
2012-09-18 23:26:37 +02:00
|
|
|
|
[autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.
* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.
* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition. This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.
* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.
* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.
* src/autofit/afranges.h: Updated.
* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
|
|
|
AF_StyleMetrics metrics[AF_STYLE_MAX];
|
2012-09-01 22:31:43 +02:00
|
|
|
|
2015-11-02 09:20:32 +01:00
|
|
|
/* Compute darkening amount once per size. Use this to check whether */
|
|
|
|
/* darken_{x,y} needs to be recomputed. */
|
|
|
|
FT_UShort stem_darkening_for_ppem;
|
|
|
|
/* Copy from e.g. AF_LatinMetrics.axis[AF_DIMENSION_HORZ] */
|
|
|
|
/* to compute the darkening amount. */
|
|
|
|
FT_Pos standard_vertical_width;
|
|
|
|
/* Copy from e.g. AF_LatinMetrics.axis[AF_DIMENSION_VERT] */
|
|
|
|
/* to compute the darkening amount. */
|
|
|
|
FT_Pos standard_horizontal_width;
|
|
|
|
/* The actual amount to darken a glyph along the X axis. */
|
|
|
|
FT_Pos darken_x;
|
|
|
|
/* The actual amount to darken a glyph along the Y axis. */
|
|
|
|
FT_Pos darken_y;
|
|
|
|
/* Amount to scale down by to keep emboldened points */
|
|
|
|
/* on the Y-axis in pre-computed blue zones. */
|
|
|
|
FT_Fixed scale_down_factor;
|
2013-12-18 12:59:35 +01:00
|
|
|
AF_Module module; /* to access global properties */
|
2012-09-18 15:23:41 +02:00
|
|
|
|
2012-09-01 22:31:43 +02:00
|
|
|
} AF_FaceGlobalsRec;
|
|
|
|
|
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
/*
|
|
|
|
* model the global hints data for a given face, decomposed into
|
[autofit] Introduce `styles'.
This is the new top-level structure for handling glyph input data;
scripts are now defined separately.
* src/autofit/aftypes.h (SCRIPT): Updated.
(AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
members to ...
(AF_Style_ClassRec): ... this new structure.
(AF_Style): New enumeration.
(AF_StyleMetricsRec): Replace `script' enumeration with
`style_class' pointer.
(AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
(AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
* src/autofit/afstyles.h: New file, using data from `afscript.h'.
* src/autofit/afscript.h: Updated.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths,
af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
* src/autofit/afglobal.c (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
(af_style_names): ... this array.
(af_face_globals_compute_script_coverage): Renamed to...
(af_face_globals_compute_style_coverage): ... this.
Updated.
(af_face_globals_new, af_face_globals_free,
af_face_globals_get_metrics): Updated.
* src/autofit/afglobal.h (SCRIPT): Updated.
(STYLE): Redefine macro to load `afstyles.h'.
(AF_SCRIPT_FALLBACK): Update definition. This will get more
refinements with later on.
(AF_SCRIPT_UNASSIGNED): Replace with...
(AF_STYLE_UNASSIGNED): ... this macro.
(AF_FaceGlobalsRec): Updated.
* src/autofit/aflatin.c (af_latin_metrics_init_widths,
af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
af_latin_hint_edges): Updated.
* src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
(af_ltn2_uniranges): Removed.
* src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
Updated.
* src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
* src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
(AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
members.
* src/autofit/afranges.h: Updated.
* src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
2013-12-20 17:26:26 +01:00
|
|
|
* style-specific items
|
2005-03-03 18:09:08 +01:00
|
|
|
*/
|
2003-11-23 22:39:51 +01:00
|
|
|
|
|
|
|
FT_LOCAL( FT_Error )
|
|
|
|
af_face_globals_new( FT_Face face,
|
2012-09-15 10:33:43 +02:00
|
|
|
AF_FaceGlobals *aglobals,
|
2012-09-18 15:23:41 +02:00
|
|
|
AF_Module module );
|
2003-11-23 22:39:51 +01:00
|
|
|
|
|
|
|
FT_LOCAL( FT_Error )
|
2013-12-18 12:59:35 +01:00
|
|
|
af_face_globals_get_metrics( AF_FaceGlobals globals,
|
|
|
|
FT_UInt gindex,
|
|
|
|
FT_UInt options,
|
|
|
|
AF_StyleMetrics *ametrics );
|
2003-11-23 22:39:51 +01:00
|
|
|
|
|
|
|
FT_LOCAL( void )
|
|
|
|
af_face_globals_free( AF_FaceGlobals globals );
|
|
|
|
|
2009-04-27 19:40:35 +02:00
|
|
|
FT_LOCAL_DEF( FT_Bool )
|
|
|
|
af_face_globals_is_digit( AF_FaceGlobals globals,
|
|
|
|
FT_UInt gindex );
|
|
|
|
|
|
|
|
/* */
|
2004-01-16 10:51:00 +01:00
|
|
|
|
2005-03-03 18:09:08 +01:00
|
|
|
|
2003-11-23 22:39:51 +01:00
|
|
|
FT_END_HEADER
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* AFGLOBAL_H_ */
|
2005-03-03 18:09:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|