[autofit] Some comments. Whitespace.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
diff --git a/src/autofit/aflatin.h b/src/autofit/aflatin.h
index 660b10c..d753428 100644
--- a/src/autofit/aflatin.h
+++ b/src/autofit/aflatin.h
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (specification). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2009 by */
+/* Copyright 2003-2007, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,8 +30,8 @@ FT_BEGIN_HEADER
AF_DECLARE_SCRIPT_CLASS(af_latin_script_class)
-/* constants are given with units_per_em == 2048 in mind */
-#define AF_LATIN_CONSTANT( metrics, c ) \
+ /* constants are given with units_per_em == 2048 in mind */
+#define AF_LATIN_CONSTANT( metrics, c ) \
( ( (c) * (FT_Long)( (AF_LatinMetrics)(metrics) )->units_per_em ) / 2048 )
@@ -76,10 +76,10 @@ FT_BEGIN_HEADER
enum
{
- AF_LATIN_BLUE_ACTIVE = 1 << 0,
- AF_LATIN_BLUE_TOP = 1 << 1,
- AF_LATIN_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */
- /* optimization */
+ AF_LATIN_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */
+ AF_LATIN_BLUE_TOP = 1 << 1, /* result of AF_LATIN_IS_TOP_BLUE */
+ AF_LATIN_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */
+ /* optimization */
AF_LATIN_BLUE_FLAG_MAX
};
@@ -98,11 +98,11 @@ FT_BEGIN_HEADER
FT_Fixed scale;
FT_Pos delta;
- FT_UInt width_count;
- AF_WidthRec widths[AF_LATIN_MAX_WIDTHS];
- FT_Pos edge_distance_threshold;
- FT_Pos standard_width;
- FT_Bool extra_light;
+ FT_UInt width_count; /* number of used widths */
+ AF_WidthRec widths[AF_LATIN_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? */
/* ignored for horizontal metrics */
FT_Bool control_overshoot;
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index 6dd9f2a..0bb7dcc 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter glyph loading routines (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
+/* Copyright 2003-2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -22,6 +22,8 @@
#include "aferrors.h"
+ /* Initialize glyph loader. */
+
FT_LOCAL_DEF( FT_Error )
af_loader_init( AF_Loader loader,
FT_Memory memory )
@@ -36,6 +38,8 @@
}
+ /* Reset glyph loader and compute globals if necessary. */
+
FT_LOCAL_DEF( FT_Error )
af_loader_reset( AF_Loader loader,
FT_Face face )
@@ -64,6 +68,8 @@
}
+ /* Finalize glyph loader. */
+
FT_LOCAL_DEF( void )
af_loader_done( AF_Loader loader )
{
@@ -80,6 +86,10 @@
}
+ /* Load a single glyph component. This routine calls itself */
+ /* recursively, if necessary, and does the main work of */
+ /* `af_loader_load_glyph.' */
+
static FT_Error
af_loader_load_g( AF_Loader loader,
AF_Scaler scaler,
@@ -169,8 +179,8 @@
&gloader->current.outline,
metrics );
- /* we now need to hint the metrics according to the change in */
- /* width/positioning that occurred during the hinting process */
+ /* we now need to adjust the metrics according to the change in */
+ /* width/positioning that occurred during the hinting process */
if ( scaler->render_mode != FT_RENDER_MODE_LIGHT )
{
FT_Pos old_rsb, old_lsb, new_lsb;
@@ -265,7 +275,7 @@
gloader->current.num_subglyphs = num_subglyphs;
num_base_subgs = gloader->base.num_subglyphs;
- /* now, read each subglyph independently */
+ /* now read each subglyph independently */
for ( nn = 0; nn < num_subglyphs; nn++ )
{
FT_Vector pp1, pp2;
@@ -305,7 +315,7 @@
num_points = gloader->base.outline.n_points;
num_new_points = num_points - num_base_points;
- /* now perform the transform required for this subglyph */
+ /* now perform the transformation required for this subglyph */
if ( subglyph->flags & ( FT_SUBGLYPH_FLAG_SCALE |
FT_SUBGLYPH_FLAG_XY_SCALE |
@@ -444,7 +454,7 @@
#endif
slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
- metrics->scaler.y_scale );
+ metrics->scaler.y_scale );
slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
@@ -468,6 +478,8 @@
}
+ /* Load a glyph. */
+
FT_LOCAL_DEF( FT_Error )
af_loader_load_glyph( AF_Loader loader,
FT_Face face,
diff --git a/src/autofit/afmodule.c b/src/autofit/afmodule.c
index ec2d707..0d21eb7 100644
--- a/src/autofit/afmodule.c
+++ b/src/autofit/afmodule.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter module implementation (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006 by */
+/* Copyright 2003-2006, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -67,14 +67,15 @@
}
- FT_DEFINE_AUTOHINTER_SERVICE(af_autofitter_service,
+ FT_DEFINE_AUTOHINTER_SERVICE(
+ af_autofitter_service,
NULL,
NULL,
NULL,
- (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph
- )
+ (FT_AutoHinter_GlyphLoadFunc)af_autofitter_load_glyph )
- FT_DEFINE_MODULE(autofit_module_class,
+ FT_DEFINE_MODULE(
+ autofit_module_class,
FT_MODULE_HINTER,
sizeof ( FT_AutofitterRec ),
@@ -87,8 +88,7 @@
(FT_Module_Constructor)af_autofitter_init,
(FT_Module_Destructor) af_autofitter_done,
- (FT_Module_Requester) NULL
- )
+ (FT_Module_Requester) NULL )
/* END */