26#include FT_INTERNAL_CALC_H
37 loader->hints =
hints;
54 if ( !loader->globals )
61 face->autohint.finalizer =
76 loader->globals =
NULL;
81#define af_intToFixed( i ) \
82 ( (FT_Fixed)( (FT_UInt32)(i) << 16 ) )
83#define af_fixedToInt( x ) \
84 ( (FT_Short)( ( (FT_UInt32)(x) + 0x8000U ) >> 16 ) )
85#define af_floatToFixed( f ) \
86 ( (FT_Fixed)( (f) * 65536.0 + 0.5 ) )
111 FT_Matrix scale_down_matrix = { 0x10000L, 0, 0, 0x10000L };
115 if ( !
face->units_per_EM )
126 writing_system_class =
142 FT_Fixed darken_by_font_units_x, darken_x;
145 darken_by_font_units_x =
161 FT_Fixed darken_by_font_units_y, darken_y;
164 darken_by_font_units_y =
218 FT_Int32 load_flags )
231 FT_UInt style_options = AF_STYLE_NONE_DFLT;
235#ifdef FT_CONFIG_OPTION_PIC
241 return FT_THROW( Invalid_Size_Handle );
255#ifdef AF_CONFIG_OPTION_TT_SIZE_METRICS
274 face->units_per_EM );
276 face->units_per_EM );
308#ifdef FT_OPTION_AUTOFIT2
310 if ( load_flags & ( 1UL << 20 ) )
311 style_options = AF_STYLE_LTN2_DFLT;
321 style_options, &style_metrics );
326 writing_system_class =
329 loader->metrics = style_metrics;
334 style_metrics->
scaler = scaler;
354 load_flags &= ~FT_LOAD_RENDER;
386 ( !
face->internal->no_stem_darkening ||
387 (
face->internal->no_stem_darkening < 0 &&
388 !
module->no_stem_darkening ) ) )
392 if ( loader->transformed )
400 inverse = loader->trans_matrix;
405 switch (
slot->format )
409 if ( loader->transformed )
411 loader->trans_delta.x,
412 loader->trans_delta.y );
416 loader->pp1.x =
hints->x_delta;
417 loader->pp1.y =
hints->y_delta;
420 loader->pp2.y =
hints->y_delta;
423 if (
slot->outline.n_points == 0 )
438 FT_Pos old_rsb, old_lsb, new_lsb;
449 old_rsb = loader->pp2.x - edge2->
opos;
451 old_lsb = edge1->
opos ;
452 new_lsb = edge1->
pos;
456 pp1x_uh = new_lsb - old_lsb;
457 pp2x_uh = edge2->
pos + old_rsb;
471 if ( loader->pp1.x >= new_lsb && old_lsb > 0 )
474 if ( loader->pp2.x <= edge2->
pos && old_rsb > 0 )
477 slot->lsb_delta = loader->pp1.x - pp1x_uh;
478 slot->rsb_delta = loader->pp2.x - pp2x_uh;
482 FT_Pos pp1x = loader->pp1.x;
483 FT_Pos pp2x = loader->pp2.x;
489 slot->lsb_delta = loader->pp1.x - pp1x;
490 slot->rsb_delta = loader->pp2.x - pp2x;
497 FT_Pos pp1x = loader->pp1.x;
498 FT_Pos pp2x = loader->pp2.x;
504 slot->lsb_delta = loader->pp1.x - pp1x;
505 slot->rsb_delta = loader->pp2.x - pp2x;
521 vvector.
x =
slot->metrics.vertBearingX -
slot->metrics.horiBearingX;
522 vvector.
y =
slot->metrics.vertBearingY -
slot->metrics.horiBearingY;
527 if ( loader->transformed )
561 slot->metrics.horiAdvance =
573 if (
slot->metrics.horiAdvance )
574 slot->metrics.horiAdvance = loader->pp2.x - loader->pp1.x;
607 FT_Fixed stem_width, stem_width_per_1000, scaled_stem, darken_amount;
614 units_per_EM =
face->units_per_EM;
628 x3 =
module->darken_params[4];
629 y3 =
module->darken_params[5];
630 x4 =
module->darken_params[6];
631 y4 =
module->darken_params[7];
636 stem_width_per_1000 = stem_width;
641 stem_width_per_1000 =
FT_MulFix( stem_width, em_ratio );
644 log_base_2 =
FT_MSB( (FT_UInt32)stem_width_per_1000 ) +
645 FT_MSB( (FT_UInt32)ppem );
647 if ( log_base_2 >= 46 )
653 scaled_stem =
FT_MulFix( stem_width_per_1000, ppem );
663 FT_Int x = stem_width_per_1000 -
670 darken_amount =
FT_MulDiv(
x, ydelta, xdelta ) +
680 FT_Int x = stem_width_per_1000 -
687 darken_amount =
FT_MulDiv(
x, ydelta, xdelta ) +
698 FT_Int x = stem_width_per_1000 -
705 darken_amount =
FT_MulDiv(
x, ydelta, xdelta ) +
af_face_globals_is_digit(AF_FaceGlobals globals, FT_UInt gindex)
af_face_globals_new(FT_Face face, AF_FaceGlobals *aglobals, AF_Module module)
af_face_globals_free(AF_FaceGlobals globals)
af_face_globals_get_metrics(AF_FaceGlobals globals, FT_UInt gindex, FT_UInt options, AF_StyleMetrics *ametrics)
#define AF_HINTS_DO_ADVANCE(h)
#define af_floatToFixed(f)
af_loader_init(AF_Loader loader, AF_GlyphHints hints)
static FT_Error af_loader_embolden_glyph_in_slot(AF_Loader loader, FT_Face face, AF_StyleMetrics style_metrics)
af_loader_compute_darkening(AF_Loader loader, FT_Face face, FT_Pos standard_width)
af_loader_load_glyph(AF_Loader loader, AF_Module module, FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
af_loader_reset(AF_Loader loader, AF_Module module, FT_Face face)
af_loader_done(AF_Loader loader)
FT_BEGIN_HEADER struct AF_LoaderRec_ * AF_Loader
FT_BEGIN_HEADER struct AF_ModuleRec_ * AF_Module
#define AF_WRITING_SYSTEM_CLASSES_GET
struct AF_FaceGlobalsRec_ * AF_FaceGlobals
FT_Load_Glyph(FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
#define FT_LOAD_TARGET_MODE(x)
FT_Vector_Transform(FT_Vector *vec, const FT_Matrix *matrix)
#define FT_LOAD_IGNORE_TRANSFORM
FT_DivFix(FT_Long a, FT_Long b)
#define FT_IS_FIXED_WIDTH(face)
#define FT_LOAD_LINEAR_DESIGN
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
FT_MulFix(FT_Long a, FT_Long b)
FT_Matrix_Invert(FT_Matrix *matrix)
FT_BEGIN_HEADER typedef signed long FT_Pos
FT_Outline_EmboldenXY(FT_Outline *outline, FT_Pos xstrength, FT_Pos ystrength)
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
FT_BEGIN_HEADER typedef unsigned char FT_Bool
void(* FT_Generic_Finalizer)(void *object)
GLint GLint GLint GLint GLint x
GLenum GLuint GLint GLenum face
namespace GUID const ADDRINFOEXW * hints
FT_UShort stem_darkening_for_ppem
FT_Pos standard_horizontal_width
FT_Pos standard_vertical_width
FT_Fixed scale_down_factor
FT_Render_Mode render_mode
AF_WritingSystem writing_system
FT_Bool digits_have_same_width
AF_StyleClass style_class
AF_WritingSystem_InitHintsFunc style_hints_init
AF_WritingSystem_GetStdWidthsFunc style_metrics_getstdw
AF_WritingSystem_ScaleMetricsFunc style_metrics_scale
AF_WritingSystem_ApplyHintsFunc style_hints_apply
FT_Size_Metrics autohint_metrics
FT_Render_Mode autohint_mode
FT_Bool glyph_transformed
IMAGEHLP_MODULEW64 module
T1_FIELD_DICT_PRIVATE T1_FIELD_DICT_PRIVATE T1_FIELD_DICT_PRIVATE T1_FIELD_DICT_PRIVATE T1_FIELD_DICT_PRIVATE standard_width
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2