freetype2/src/autofit/afcjk.h

142 lines
4.1 KiB
C
Raw Normal View History

/****************************************************************************
*
* afcjk.h
*
* Auto-fitter hinting routines for CJK writing system (specification).
*
2022-01-11 10:54:10 +01:00
* Copyright (C) 2006-2022 by
* 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.
*
*/
#ifndef AFCJK_H_
#define AFCJK_H_
#include "afhints.h"
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
#include "aflatin.h"
FT_BEGIN_HEADER
[autofit] Introduce `writing systems'. This patch adds a new top level to the auto-hinter's script class hierarchy. It defines `writing systems' which can contain multiple scripts. For example, the `latin' writing system (in file `aflatin.c') is able to support scripts like Latin, Cyrillic, Armenian, etc., which can be handled similarly. Scripts are now named using four-letter OpenType tags. * src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members to... (AF_WritingSystemClassRec): This new structure. It holds pointers to functions which can be shared among related scripts. (AF_WritingSystem): New enumeration. (AF_Script): Revised values using four-letter tags. (AF_DEFINE_WRITING_SYSTEM_CLASS): New macro. (AF_DEFINE_SCRIPT_CLASS): Updated. * src/autofit/afglobal.c (af_writing_system_classes): New global, constant array. (af_script_classes): Updated. (af_face_globals_free): Updated. Remove assertion. (af_face_globals_get_metrics): Updated. * src/autofit/afglobal.h (AF_SCRIPT_FALLBACK) [!AF_CONFIG_OPTION_CJK]: Handle this case. * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): Updated. * src/autofit/afpic.c (autofit_module_class_pic_init): Updated; initialize structures for both writing systems and scripts. * src/autofit/afpic.h: Updated. (AF_WRITING_SYSTEM_CLASSES_GET): New macro. * src/autofit/afcjk.c (af_cjk_writing_system_class): New writing system. (af_cjk_uniranges): Renamed to... (af_hani_uniranges): This. (af_cjk_script_class): Reduced and renamed to... (af_hani_script_class): This. * src/autofit/afcjk.h: Updated. * src/autofit/afdummy.c (af_dummy_writing_system_class): New writing system. (af_dummy_script_class): Reduced and renamed to... (af_dflt_script_class): This. * src/autofit/afdummy.h: Updated. * src/autofit/afindic.c (af_indic_writing_system_class): New writing system. (af_indic_uniranges): Renamed to... (af_deva_uniranges): This. (af_indic_script_class): Reduced and renamed to... (af_deva_script_class): This. * src/autofit/afcjk.h: Updated. * src/autofit/aflatin.c (af_latin_writing_system_class): New writing system. (af_latin_uniranges): Renamed to... (af_latn_uniranges): This. (af_latin_script_class): Reduced and renamed to... (af_latn_script_class): This. * src/autofit/aflatin.h: Updated. * src/autofit/aflatin2.c (af_latin2_writing_system_class): New writing system. (af_latin2_uniranges): Renamed to... (af_ltn2_uniranges): This. Synchronize ranges with `latin'. (af_latin2_script_class): Reduced and renamed to... (af_ltn2_script_class): This. * src/autofit/aflatin2.h: Updated.
2013-07-31 22:49:29 +02:00
/* the CJK-specific writing system */
AF_DECLARE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class )
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** C J K G L O B A L M E T R I C S *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
/*
* CJK glyphs tend to fill the square. So we have both vertical and
* horizontal blue zones. But some glyphs have flat bounding strokes that
* leave some space between neighbour glyphs.
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
*/
#define AF_CJK_IS_TOP_BLUE( b ) \
( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP )
#define AF_CJK_IS_HORIZ_BLUE( b ) \
( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ )
#define AF_CJK_IS_RIGHT_BLUE AF_CJK_IS_TOP_BLUE
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
#define AF_CJK_MAX_WIDTHS 16
#define AF_CJK_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
#define AF_CJK_BLUE_TOP ( 1U << 1 ) /* result of AF_CJK_IS_TOP_BLUE */
#define AF_CJK_BLUE_ADJUSTMENT ( 1U << 2 ) /* used for scale adjustment */
/* optimization */
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
2011-05-09 09:48:49 +02:00
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
typedef struct AF_CJKBlueRec_
{
AF_WidthRec ref;
AF_WidthRec shoot; /* undershoot */
FT_UInt flags;
} AF_CJKBlueRec, *AF_CJKBlue;
2011-05-09 09:48:49 +02:00
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
typedef struct AF_CJKAxisRec_
{
2011-05-09 09:48:49 +02:00
FT_Fixed scale;
FT_Pos delta;
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
FT_UInt width_count; /* number of used widths */
AF_WidthRec widths[AF_CJK_MAX_WIDTHS]; /* widths array */
FT_Pos edge_distance_threshold; /* used for creating edges */
FT_Pos standard_width; /* the default stem thickness */
FT_Bool extra_light; /* is standard width very light? */
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
/* used for horizontal metrics too for CJK */
2011-05-09 09:48:49 +02:00
FT_Bool control_overshoot;
FT_UInt blue_count;
AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX];
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
2011-05-09 09:48:49 +02:00
FT_Fixed org_scale;
FT_Pos org_delta;
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
} AF_CJKAxisRec, *AF_CJKAxis;
typedef struct AF_CJKMetricsRec_
{
AF_StyleMetricsRec root;
FT_UInt units_per_em;
AF_CJKAxisRec axis[AF_DIMENSION_MAX];
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
} AF_CJKMetricsRec, *AF_CJKMetrics;
2011-05-09 09:48:49 +02:00
#ifdef AF_CONFIG_OPTION_CJK
FT_LOCAL( FT_Error )
2011-05-09 09:48:49 +02:00
af_cjk_metrics_init( AF_CJKMetrics metrics,
FT_Face face );
FT_LOCAL( void )
2011-05-09 09:48:49 +02:00
af_cjk_metrics_scale( AF_CJKMetrics metrics,
AF_Scaler scaler );
FT_LOCAL( FT_Error )
2011-05-09 09:48:49 +02:00
af_cjk_hints_init( AF_GlyphHints hints,
AF_CJKMetrics metrics );
FT_LOCAL( FT_Error )
af_cjk_hints_apply( FT_UInt glyph_index,
AF_GlyphHints hints,
2011-05-09 09:48:49 +02:00
FT_Outline* outline,
AF_CJKMetrics metrics );
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
/* shared; called from afindic.c */
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
FT_LOCAL( void )
af_cjk_metrics_check_digits( AF_CJKMetrics metrics,
FT_Face face );
FT_LOCAL( void )
af_cjk_metrics_init_widths( AF_CJKMetrics metrics,
FT_Face face );
#endif /* AF_CONFIG_OPTION_CJK */
[autofit] Add bluezones for CJK Ideographs. To remove extremas of vertical strokes of CJK Ideographs at low resolution and make the top and bottom horizontal stems aligned, bluezones for CJK Ideographs are calculated from sample glyphs. At present, vertical bluezones (bluezones to align vertical stems) are disabled by default. For detail, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html http://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html * include/freetype/internal/fttrace.h: New trace component `afcjk'. * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version for AF_Latin{Blue,Axis,Metric}Rec. (af_cjk_metrics_check_digits): Ditto, shared with Indic module. (af_cjk_metrics_init_widths): Ditto. (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric. (af_cjk_metrics_scale): Ditto (declaration). (af_cjk_hints_init): Ditto (declaration). (af_cjk_hints_apply): Ditto (declaration). * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body). (af_cjk_hints_init): Ditto (body). (af_cjk_hints_apply): Ditto (body). (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths. (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits. (af_cjk_metrics_init): Call CJK bluezone initializer. (af_cjk_metrics_scale_dim): Add code to scale bluezones. (af_cjk_hints_compute_blue_edges): New function, CJK version of af_latin_hints_compute_blue_edges. (af_cjk_metrics_init_blues): New function, CJK version of af_latin_metrics_init_blues. (af_cjk_hints_edges): Add code to align the edge stems to blue zones. * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric, and initialize as af_cjk_metrics_init. However bluezones are not initialized. (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric. (af_indic_hints_init): Ditto. (af_indic_hints_apply): Ditto. * docs/CHANGES: Note about CJK bluezone support.
2011-05-08 12:07:13 +02:00
/* */
FT_END_HEADER
#endif /* AFCJK_H_ */
/* END */