freetype2/src/autofit/afcjk.h

143 lines
3.9 KiB
C
Raw Normal View History

/***************************************************************************/
/* */
/* afcjk.h */
/* */
/* Auto-fitter hinting routines for CJK script (specification). */
/* */
/* Copyright 2006, 2007, 2011, 2012 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
/* the CJK-specific script class */
AF_DECLARE_SCRIPT_CLASS( af_cjk_script_class )
[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 (global) metrics management */
/*
2011-05-09 09:48:49 +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
*/
enum
{
AF_CJK_BLUE_TOP,
AF_CJK_BLUE_BOTTOM,
AF_CJK_BLUE_LEFT,
AF_CJK_BLUE_RIGHT,
AF_CJK_BLUE_MAX
};
#define AF_CJK_MAX_WIDTHS 16
#define AF_CJK_MAX_BLUES AF_CJK_BLUE_MAX
enum
{
AF_CJK_BLUE_ACTIVE = 1 << 0,
AF_CJK_BLUE_IS_TOP = 1 << 1,
AF_CJK_BLUE_IS_RIGHT = 1 << 2,
AF_CJK_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment */
2011-05-09 09:48:49 +02:00
/* 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
AF_CJK_BLUE_FLAG_MAX
};
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
2011-05-09 09:48:49 +02:00
FT_UInt width_count;
AF_WidthRec widths[AF_CJK_MAX_WIDTHS];
FT_Pos edge_distance_threshold;
FT_Pos standard_width;
FT_Bool extra_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_CJK_BLUE_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_ScriptMetricsRec root;
FT_UInt units_per_em;
AF_CJKAxisRec axis[AF_DIMENSION_MAX];
} 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 )
2011-05-09 09:48:49 +02:00
af_cjk_hints_apply( AF_GlyphHints hints,
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 */