zenilib: zenilib/jni/external/freetype2/src/autofit/aflatin.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions | Variables
aflatin.c File Reference
`#include <ft2build.h>`
`#include <FT_ADVANCES_H>`
`#include <FT_INTERNAL_DEBUG_H>`
`#include "aflatin.h"`
`#include "aferrors.h"`

Go to the source code of this file.

## Macros

#define | AF_LATIN_MAX_TEST_CHARACTERS 12
#define | FT_COMPONENT trace_aflatin

## Functions

static void | af_latin_align_linked_edge (AF_GlyphHints hints, AF_Dimension dim, AF_Edge base_edge, AF_Edge stem_edge)
static void | af_latin_align_serif_edge (AF_GlyphHints hints, AF_Edge base, AF_Edge serif)
static FT_Pos | af_latin_compute_stem_width (AF_GlyphHints hints, AF_Dimension dim, FT_Pos width, AF_Edge_Flags base_flags, AF_Edge_Flags stem_flags)
| af_latin_hint_edges (AF_GlyphHints hints, AF_Dimension dim)
static FT_Error | af_latin_hints_apply (AF_GlyphHints hints, FT_Outline *outline, AF_LatinMetrics metrics)
| af_latin_hints_compute_blue_edges (AF_GlyphHints hints, AF_LatinMetrics metrics)
| af_latin_hints_compute_edges (AF_GlyphHints hints, AF_Dimension dim)
| af_latin_hints_compute_segments (AF_GlyphHints hints, AF_Dimension dim)
| af_latin_hints_detect_features (AF_GlyphHints hints, AF_Dimension dim)
static FT_Error | af_latin_hints_init (AF_GlyphHints hints, AF_LatinMetrics metrics)
| af_latin_hints_link_segments (AF_GlyphHints hints, AF_Dimension dim)
| af_latin_metrics_check_digits (AF_LatinMetrics metrics, FT_Face face)
| af_latin_metrics_init (AF_LatinMetrics metrics, FT_Face face)
static void | af_latin_metrics_init_blues (AF_LatinMetrics metrics, FT_Face face)
| af_latin_metrics_init_widths (AF_LatinMetrics metrics, FT_Face face, FT_ULong charcode)
| af_latin_metrics_scale (AF_LatinMetrics metrics, AF_Scaler scaler)
static void | af_latin_metrics_scale_dim (AF_LatinMetrics metrics, AF_Scaler scaler, AF_Dimension dim)
static FT_Pos | af_latin_snap_width (AF_Width widths, FT_Int count, FT_Pos width)

## Variables

static const char | af_latin_blue_chars [AF_LATIN_MAX_BLUES][AF_LATIN_MAX_TEST_CHARACTERS+1]
static const AF_Script_UniRangeRec | af_latin_uniranges []

## Macro Definition Documentation

#define AF_LATIN_MAX_TEST_CHARACTERS 12

Definition at line 168 of file aflatin.c.

Referenced by af_latin_metrics_init_blues().

#define FT_COMPONENT trace_aflatin

Definition at line 39 of file aflatin.c.

## Function Documentation

static void af_latin_align_linked_edge | ( | AF_GlyphHints | hints,
|  | AF_Dimension | dim,
|  | AF_Edge | base_edge,
|  | AF_Edge | stem_edge
| ) |  |

static

Definition at line 1750 of file aflatin.c.

References af_latin_compute_stem_width(), AF_GlyphHintsRec_::axis, AF_AxisHintsRec_::edges, AF_EdgeRec_::flags, FT_Pos, FT_TRACE5, AF_EdgeRec_::opos, and AF_EdgeRec_::pos.

Referenced by af_latin_hint_edges().

static void af_latin_align_serif_edge | ( | AF_GlyphHints | hints,
|  | AF_Edge | base,
|  | AF_Edge | serif
| ) |  |

static

Definition at line 1776 of file aflatin.c.

References FT_UNUSED, AF_EdgeRec_::opos, and AF_EdgeRec_::pos.

Referenced by af_latin_hint_edges().

static FT_Pos af_latin_compute_stem_width | ( | AF_GlyphHints | hints,
|  | AF_Dimension | dim,
|  | FT_Pos | width,
|  | AF_Edge_Flags | base_flags,
|  | AF_Edge_Flags | stem_flags
| ) |  |

static

Definition at line 1586 of file aflatin.c.

References AF_DIMENSION_VERT, AF_EDGE_ROUND, AF_EDGE_SERIF, AF_LATIN_HINTS_DO_HORZ_SNAP, AF_LATIN_HINTS_DO_MONO, AF_LATIN_HINTS_DO_STEM_ADJUST, AF_LATIN_HINTS_DO_VERT_SNAP, af_latin_snap_width(), AF_LatinMetricsRec_::axis, FT_Pos, AF_GlyphHintsRec_::metrics, and sign.

Referenced by af_latin_align_linked_edge(), and af_latin_hint_edges().

af_latin_hint_edges | ( | AF_GlyphHints | hints,
|  | AF_Dimension | dim
| ) |  |

Definition at line 1800 of file aflatin.c.

References AF_DIMENSION_HORZ, AF_DIMENSION_VERT, AF_EDGE_DONE, AF_HINTS_DO_BLUES, af_latin_align_linked_edge(), af_latin_align_serif_edge(), af_latin_compute_stem_width(), AF_EdgeRec_::blue_edge, AF_AxisHintsRec_::edges, AF_EdgeRec_::flags, FT_MulDiv(), FT_PIX_ROUND, FT_Pos, FT_TRACE5, AF_EdgeRec_::link, NULL, AF_AxisHintsRec_::num_edges, AF_EdgeRec_::opos, AF_EdgeRec_::pos, and AF_EdgeRec_::serif.

Referenced by af_latin_hints_apply().

static FT_Error af_latin_hints_apply | ( | AF_GlyphHints | hints,
|  | FT_Outline * | outline,
|  | AF_LatinMetrics | metrics
| ) |  |

static

Definition at line 2230 of file aflatin.c.

References AF_DIMENSION_HORZ, AF_DIMENSION_MAX, AF_DIMENSION_VERT, af_glyph_hints_align_edge_points(), af_glyph_hints_align_strong_points(), af_glyph_hints_align_weak_points(), af_glyph_hints_reload(), af_glyph_hints_save(), AF_HINTS_DO_HORIZONTAL, AF_HINTS_DO_VERTICAL, af_latin_hint_edges(), af_latin_hints_compute_blue_edges(), af_latin_hints_detect_features(), af_warper_compute(), error, FT_Pos, FT_RENDER_MODE_LIGHT, AF_ScalerRec_::render_mode, AF_LatinMetricsRec_::root, and AF_ScriptMetricsRec_::scaler.

af_latin_hints_compute_blue_edges | ( | AF_GlyphHints | hints,
|  | AF_LatinMetrics | metrics
| ) |  |

Definition at line 1354 of file aflatin.c.

References AF_DIMENSION_VERT, AF_EDGE_ROUND, AF_LATIN_BLUE_ACTIVE, AF_LATIN_BLUE_MAX, AF_LATIN_BLUE_TOP, AF_EdgeRec_::blue_edge, AF_LatinAxisRec_::blues, AF_EdgeRec_::dir, AF_AxisHintsRec_::edges, AF_LatinBlueRec_::flags, AF_EdgeRec_::flags, AF_EdgeRec_::fpos, FT_Bool, FT_BOOL, FT_MulFix(), FT_Pos, AF_AxisHintsRec_::major_dir, NULL, AF_AxisHintsRec_::num_edges, AF_LatinBlueRec_::ref, AF_LatinAxisRec_::scale, and AF_LatinBlueRec_::shoot.

Referenced by af_latin_hints_apply().

af_latin_hints_compute_edges | ( | AF_GlyphHints | hints,
|  | AF_Dimension | dim
| ) |  |

Definition at line 1039 of file aflatin.c.

References af_axis_hints_new_edge(), AF_DIMENSION_HORZ, AF_DIR_NONE, AF_DIR_RIGHT, AF_DIR_UP, AF_EDGE_NORMAL, AF_EDGE_ROUND, AF_EDGE_SERIF, AF_SegmentRec_::dir, AF_EdgeRec_::dir, AF_SegmentRec_::edge, AF_LatinAxisRec_::edge_distance_threshold, AF_SegmentRec_::edge_next, AF_AxisHintsRec_::edges, error, AF_EdgeRec_::first, AF_SegmentRec_::flags, AF_EdgeRec_::flags, AF_EdgeRec_::fpos, FT_Bool, FT_DivFix(), FT_MulFix(), FT_Pos, FT_ZERO, AF_SegmentRec_::height, AF_EdgeRec_::last, AF_SegmentRec_::link, AF_EdgeRec_::link, AF_SegmentRec_::max_coord, AF_SegmentRec_::min_coord, NULL, AF_AxisHintsRec_::num_edges, AF_AxisHintsRec_::num_segments, AF_EdgeRec_::opos, AF_SegmentRec_::pos, AF_EdgeRec_::pos, AF_AxisHintsRec_::segments, AF_SegmentRec_::serif, and AF_EdgeRec_::serif.

Referenced by af_latin_hints_detect_features().

af_latin_hints_compute_segments | ( | AF_GlyphHints | hints,
|  | AF_Dimension | dim
| ) |  |

Definition at line 726 of file aflatin.c.

References af_axis_hints_new_segment(), AF_DIMENSION_HORZ, AF_EDGE_NORMAL, AF_EDGE_ROUND, AF_FLAG_CONTROL, AF_SegmentRec_::dir, error, AF_SegmentRec_::first, AF_PointRec_::flags, AF_SegmentRec_::flags, FT_ABS, FT_Bool, FT_Pos, FT_ZERO, AF_PointRec_::fx, AF_PointRec_::fy, AF_SegmentRec_::height, if(), AF_SegmentRec_::last, AF_AxisHintsRec_::major_dir, AF_SegmentRec_::max_coord, AF_SegmentRec_::min_coord, AF_PointRec_::next, NULL, AF_AxisHintsRec_::num_segments, AF_PointRec_::out_dir, AF_SegmentRec_::pos, AF_PointRec_::prev, AF_SegmentRec_::score, AF_AxisHintsRec_::segments, u, AF_PointRec_::u, and AF_PointRec_::v.

Referenced by af_latin_hints_detect_features(), and af_latin_metrics_init_widths().

af_latin_hints_detect_features | ( | AF_GlyphHints | hints,
|  | AF_Dimension | dim
| ) |  |

Definition at line 1333 of file aflatin.c.

References af_latin_hints_compute_edges(), af_latin_hints_compute_segments(), af_latin_hints_link_segments(), and error.

Referenced by af_latin_hints_apply().

static FT_Error af_latin_hints_init | ( | AF_GlyphHints | hints,
|  | AF_LatinMetrics | metrics
| ) |  |

static

Definition at line 1455 of file aflatin.c.

References AF_DIMENSION_HORZ, AF_DIMENSION_VERT, af_glyph_hints_rescale(), AF_LATIN_HINTS_HORZ_SNAP, AF_LATIN_HINTS_MONO, AF_LATIN_HINTS_STEM_ADJUST, AF_LATIN_HINTS_VERT_SNAP, AF_SCALER_FLAG_NO_HORIZONTAL, AF_ScalerRec_::face, FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V, FT_RENDER_MODE_LIGHT, FT_RENDER_MODE_MONO, FT_RENDER_MODE_NORMAL, FT_STYLE_FLAG_ITALIC, AF_GlyphHintsRec_::other_flags, AF_ScalerRec_::render_mode, AF_LatinMetricsRec_::root, AF_ScriptMetricsRec_::scaler, AF_GlyphHintsRec_::scaler_flags, FT_FaceRec_::style_flags, AF_GlyphHintsRec_::x_delta, AF_GlyphHintsRec_::x_scale, AF_GlyphHintsRec_::y_delta, and AF_GlyphHintsRec_::y_scale.

af_latin_hints_link_segments | ( | AF_GlyphHints | hints,
|  | AF_Dimension | dim
| ) |  |

Definition at line 946 of file aflatin.c.

References AF_LATIN_CONSTANT, AF_SegmentRec_::dir, AF_SegmentRec_::first, FT_Pos, AF_SegmentRec_::last, AF_SegmentRec_::link, AF_AxisHintsRec_::major_dir, max, AF_SegmentRec_::max_coord, min, AF_SegmentRec_::min_coord, AF_AxisHintsRec_::num_segments, AF_SegmentRec_::pos, AF_SegmentRec_::score, AF_AxisHintsRec_::segments, and AF_SegmentRec_::serif.

Referenced by af_latin_hints_detect_features(), and af_latin_metrics_init_widths().

af_latin_metrics_check_digits | ( | AF_LatinMetrics | metrics,
|  | FT_Face | face
| ) |  |

Definition at line 431 of file aflatin.c.

References FT_Bool, FT_Get_Advance(), FT_Get_Char_Index(), FT_LOAD_IGNORE_TRANSFORM, FT_LOAD_NO_HINTING, FT_LOAD_NO_SCALE, and i.

Referenced by af_latin_metrics_init().

af_latin_metrics_init | ( | AF_LatinMetrics | metrics,
|  | FT_Face | face
| ) |  |

Definition at line 478 of file aflatin.c.

References af_latin_metrics_check_digits(), af_latin_metrics_init_blues(), af_latin_metrics_init_widths(), error, FT_Select_Charmap(), and FT_Set_Charmap().

static void af_latin_metrics_init_blues | ( | AF_LatinMetrics | metrics,
|  | FT_Face | face
| ) |  |

static

Definition at line 187 of file aflatin.c.

References AF_DIMENSION_VERT, AF_LATIN_BLUE_ADJUSTMENT, af_latin_blue_chars, AF_LATIN_BLUE_MAX, AF_LATIN_BLUE_SMALL_TOP, AF_LATIN_BLUE_TOP, AF_LATIN_IS_TOP_BLUE, AF_LATIN_MAX_TEST_CHARACTERS, af_sort_pos(), AF_LatinMetricsRec_::axis, AF_LatinAxisRec_::blue_count, AF_LatinAxisRec_::blues, FT_Outline_::contours, error, AF_LatinBlueRec_::flags, FT_Bool, FT_BOOL, FT_CURVE_TAG, FT_CURVE_TAG_ON, FT_Get_Char_Index(), FT_Load_Glyph(), FT_LOAD_NO_SCALE, FT_Pos, FT_TRACE5, FT_FaceRec_::glyph, if(), FT_Outline_::n_contours, FT_Outline_::n_points, FT_GlyphSlotRec_::outline, FT_Outline_::points, pp, AF_LatinBlueRec_::ref, AF_LatinBlueRec_::shoot, FT_Outline_::tags, and FT_Vector_::y.

Referenced by af_latin_metrics_init().

af_latin_metrics_init_widths | ( | AF_LatinMetrics | metrics,
|  | FT_Face | face,
|  | FT_ULong | charcode
| ) |  |

Definition at line 55 of file aflatin.c.

References AF_DIMENSION_HORZ, AF_DIMENSION_MAX, AF_DIMENSION_VERT, af_glyph_hints_done(), af_glyph_hints_init(), af_glyph_hints_reload(), af_glyph_hints_rescale(), AF_LATIN_CONSTANT, af_latin_hints_compute_segments(), af_latin_hints_link_segments(), AF_LATIN_MAX_WIDTHS, af_sort_widths(), AF_GlyphHintsRec_::axis, AF_LatinAxisRec_::edge_distance_threshold, error, AF_LatinAxisRec_::extra_light, AF_ScalerRec_::face, AF_ScalerRec_::flags, FT_Get_Char_Index(), FT_Load_Glyph(), FT_LOAD_NO_SCALE, FT_Pos, FT_RENDER_MODE_NORMAL, FT_ZERO, AF_SegmentRec_::link, AF_GlyphHintsRec_::memory, AF_AxisHintsRec_::num_segments, AF_SegmentRec_::pos, AF_ScalerRec_::render_mode, AF_LatinMetricsRec_::root, AF_ScriptMetricsRec_::scaler, AF_AxisHintsRec_::segments, AF_LatinAxisRec_::standard_width, AF_LatinMetricsRec_::units_per_em, AF_LatinAxisRec_::width_count, AF_LatinAxisRec_::widths, AF_ScalerRec_::x_delta, AF_ScalerRec_::x_scale, AF_ScalerRec_::y_delta, and AF_ScalerRec_::y_scale.

Referenced by af_latin_metrics_init().

af_latin_metrics_scale | ( | AF_LatinMetrics | metrics,
|  | AF_Scaler | scaler
| ) |  |

Definition at line 703 of file aflatin.c.

References AF_DIMENSION_HORZ, AF_DIMENSION_VERT, and af_latin_metrics_scale_dim().

static void af_latin_metrics_scale_dim | ( | AF_LatinMetrics | metrics,
|  | AF_Scaler | scaler,
|  | AF_Dimension | dim
| ) |  |

static

Definition at line 523 of file aflatin.c.

References AF_DIMENSION_HORZ, AF_DIMENSION_VERT, AF_LATIN_BLUE_ACTIVE, AF_LATIN_BLUE_ADJUSTMENT, AF_LatinMetricsRec_::axis, AF_LatinAxisRec_::blue_count, AF_LatinAxisRec_::blues, AF_LatinAxisRec_::delta, AF_LatinAxisRec_::extra_light, AF_LatinBlueRec_::flags, FT_Bool, FT_MulDiv(), FT_MulFix(), FT_PIX_ROUND, FT_Pos, NULL, AF_LatinAxisRec_::org_delta, AF_LatinAxisRec_::org_scale, AF_LatinBlueRec_::ref, AF_LatinMetricsRec_::root, AF_LatinAxisRec_::scale, AF_ScriptMetricsRec_::scaler, AF_LatinBlueRec_::shoot, AF_LatinAxisRec_::standard_width, AF_LatinAxisRec_::width_count, AF_LatinAxisRec_::widths, AF_ScalerRec_::x_delta, AF_ScalerRec_::x_scale, AF_ScalerRec_::y_delta, and AF_ScalerRec_::y_scale.

Referenced by af_latin_metrics_scale().

static FT_Pos af_latin_snap_width | ( | AF_Width | widths,
|  | FT_Int | count,
|  | FT_Pos | width
| ) |  |

static

Definition at line 1537 of file aflatin.c.

References FT_PIX_ROUND, and FT_Pos.

Referenced by af_latin_compute_stem_width().

## Variable Documentation

const char af_latin_blue_chars[AF_LATIN_MAX_BLUES][AF_LATIN_MAX_TEST_CHARACTERS+1]

static

Initial value:
=
{
"THEZOCQS",
"HEZLOCUS",
"fijkdbh",
"xzroesc",
"xzroesc",
"pqgjy"
}

Definition at line 172 of file aflatin.c.

Referenced by af_latin_metrics_init_blues().

const AF_Script_UniRangeRec af_latin_uniranges[]

static

Initial value:
=
{
AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ),
AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ),
AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ),
AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ),
AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ),
AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ),
AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ),
AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ),
AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ),
AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ),
AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ),
AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ),
AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ),
AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ),
AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ),
AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ),
AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ),
AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ),
AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ),
AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ),
AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ),
AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ),
AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ),
AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ),
AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ),
AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ),
}
AF_UNIRANGE_REC
#define AF_UNIRANGE_REC(a, b)
Definition: aftypes.h:290

Definition at line 2312 of file aflatin.c.