Formatting.
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 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c
index 6546475..4a8af0c 100644
--- a/src/autofit/aflatin2.c
+++ b/src/autofit/aflatin2.c
@@ -4,7 +4,7 @@
/* */
/* Auto-fitter hinting routines for latin script (body). */
/* */
-/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
+/* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -156,7 +156,8 @@
#define AF_LATIN_MAX_TEST_CHARACTERS 12
- static const char af_latin2_blue_chars[AF_LATIN_MAX_BLUES][AF_LATIN_MAX_TEST_CHARACTERS+1] =
+ static const char af_latin2_blue_chars[AF_LATIN_MAX_BLUES]
+ [AF_LATIN_MAX_TEST_CHARACTERS+1] =
{
"THEZOCQS",
"HEZLOCUS",
@@ -182,9 +183,9 @@
FT_GlyphSlot glyph = face->glyph;
- /* we compute the blues simply by loading each character from the */
+ /* we compute the blues simply by loading each character from the */
/* 'af_latin2_blue_chars[blues]' string, then compute its top-most or */
- /* bottom-most points (depending on `AF_IS_TOP_BLUE') */
+ /* bottom-most points (depending on `AF_IS_TOP_BLUE') */
AF_LOG(( "blue zones computation\n" ));
AF_LOG(( "------------------------------------------------\n" ));
@@ -548,7 +549,8 @@
if ( scaled != fitted )
{
scale = FT_MulDiv( scale, fitted, scaled );
- AF_LOG(( "== scaled x-top = %.2g fitted = %.2g, scaling = %.4g\n", scaled/64.0, fitted/64.0, (fitted*1.0)/scaled ));
+ AF_LOG(( "== scaled x-top = %.2g fitted = %.2g, scaling = %.4g\n",
+ scaled / 64.0, fitted / 64.0, ( fitted * 1.0 ) / scaled ));
}
#endif
}
@@ -624,9 +626,11 @@
blue->ref.fit = FT_PIX_ROUND( blue->ref.cur );
blue->shoot.fit = blue->ref.fit + delta2;
- AF_LOG(( ">> activating blue zone %d: ref.cur=%.2g ref.fit=%.2g shoot.cur=%.2g shoot.fit=%.2g\n",
- nn, blue->ref.cur/64.0, blue->ref.fit/64.0,
- blue->shoot.cur/64.0, blue->shoot.fit/64.0 ));
+ AF_LOG(( ">> activating blue zone %d:"
+ " ref.cur=%.2g ref.fit=%.2g"
+ " shoot.cur=%.2g shoot.fit=%.2g\n",
+ nn, blue->ref.cur / 64.0, blue->ref.fit / 64.0,
+ blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 ));
blue->flags |= AF_LATIN_BLUE_ACTIVE;
}
@@ -1137,7 +1141,8 @@
/* insert a new edge in the list and */
/* sort according to the position */
- error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, memory, &edge );
+ error = af_axis_hints_new_edge( axis, seg->pos, seg->dir,
+ memory, &edge );
if ( error )
goto Exit;
@@ -1796,7 +1801,8 @@
- AF_LOG(( "==== hinting %s edges =====\n", dim == AF_DIMENSION_HORZ ? "vertical" : "horizontal" ));
+ AF_LOG(( "==== hinting %s edges =====\n",
+ dim == AF_DIMENSION_HORZ ? "vertical" : "horizontal" ));
/* we begin by aligning all stems relative to the blue zone */
/* if needed -- that's only for horizontal edges */
@@ -1965,7 +1971,8 @@
org_left = org_pos + ((org_len - cur_len) >> 1);
org_right = org_pos + ((org_len + cur_len) >> 1);
- AF_LOG(( "ALIGN: left=%.2f right=%.2f ", org_left/64.0, org_right/64.0 ));
+ AF_LOG(( "ALIGN: left=%.2f right=%.2f ",
+ org_left / 64.0, org_right / 64.0 ));
cur_center = org_center;
if ( edge2->flags & AF_EDGE_DONE )
@@ -2066,8 +2073,8 @@
edge->pos = cur_center - (cur_len >> 1);
edge2->pos = edge->pos + cur_len;
- AF_LOG(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f) "
- "snapped to (%.2f) and (%.2f), org_len = %.2f cur_len=%.2f\n",
+ AF_LOG(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f)"
+ " snapped to (%.2f) and (%.2f), org_len=%.2f cur_len=%.2f\n",
edge-edges, edge->opos / 64.0,
edge2-edges, edge2->opos / 64.0,
edge->pos / 64.0, edge2->pos / 64.0,
@@ -2215,12 +2222,15 @@
FT_MulDiv( edge->opos - before->opos,
after->pos - before->pos,
after->opos - before->opos );
- AF_LOG(( "SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f) from %d (opos=%.2f)\n",
- edge-edges, edge->opos / 64.0, edge->pos / 64.0, before - edges, before->opos / 64.0 ));
+ AF_LOG(( "SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f)"
+ " from %d (opos=%.2f)\n",
+ edge-edges, edge->opos / 64.0, edge->pos / 64.0,
+ before - edges, before->opos / 64.0 ));
}
else
{
- edge->pos = anchor->pos + (( edge->opos - anchor->opos + 16) & ~31);
+ edge->pos = anchor->pos +
+ ( ( edge->opos - anchor->opos + 16 ) & ~31 );
AF_LOG(( "SERIF_LINK2: edge %d (opos=%.2f) snapped to (%.2f)\n",
edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
@@ -2321,7 +2331,7 @@
static const AF_Script_UniRangeRec af_latin2_uniranges[] =
{
- AF_UNIRANGE_REC( 32UL, 127UL ), /* XXX: TODO: Add new Unicode ranges here! */
+ AF_UNIRANGE_REC( 32UL, 127UL ), /* TODO: Add new Unicode ranges here! */
AF_UNIRANGE_REC( 160UL, 255UL ),
AF_UNIRANGE_REC( 0UL, 0UL )
};
diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c
index 5b9aba6..3aefbc5 100644
--- a/src/autofit/afpic.c
+++ b/src/autofit/afpic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009, 2010 by */
+/* Copyright 2009, 2010, 2011 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -24,7 +24,8 @@
#ifdef FT_CONFIG_OPTION_PIC
/* forward declaration of PIC init functions from afmodule.c */
- void FT_Init_Class_af_autofitter_service( FT_Library, FT_AutoHinter_ServiceRec*);
+ void FT_Init_Class_af_autofitter_service( FT_Library,
+ FT_AutoHinter_ServiceRec* );
/* forward declaration of PIC init functions from script classes */
#include "aflatin.h"
@@ -34,10 +35,12 @@
#include "afindic.h"
void
- autofit_module_class_pic_free( FT_Library library )
+ autofit_module_class_pic_free( FT_Library library )
{
- FT_PIC_Container* pic_container = &library->pic_container;
- FT_Memory memory = library->memory;
+ FT_PIC_Container* pic_container = &library->pic_container;
+ FT_Memory memory = library->memory;
+
+
if ( pic_container->autofit )
{
FT_FREE( pic_container->autofit );
@@ -62,28 +65,37 @@
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->autofit = container;
- /* initialize pointer table - this is how the module usually expects this data */
+ /* initialize pointer table - */
+ /* this is how the module usually expects this data */
for ( ss = 0 ; ss < AF_SCRIPT_CLASSES_REC_COUNT ; ss++ )
{
- container->af_script_classes[ss] = &container->af_script_classes_rec[ss];
+ container->af_script_classes[ss] =
+ &container->af_script_classes_rec[ss];
}
- container->af_script_classes[AF_SCRIPT_CLASSES_COUNT-1] = NULL;
+ container->af_script_classes[AF_SCRIPT_CLASSES_COUNT - 1] = NULL;
/* add call to initialization function when you add new scripts */
ss = 0;
- FT_Init_Class_af_dummy_script_class(&container->af_script_classes_rec[ss++]);
+ FT_Init_Class_af_dummy_script_class(
+ &container->af_script_classes_rec[ss++] );
#ifdef FT_OPTION_AUTOFIT2
- FT_Init_Class_af_latin2_script_class(&container->af_script_classes_rec[ss++]);
+ FT_Init_Class_af_latin2_script_class(
+ &container->af_script_classes_rec[ss++] );
#endif
- FT_Init_Class_af_latin_script_class(&container->af_script_classes_rec[ss++]);
- FT_Init_Class_af_cjk_script_class(&container->af_script_classes_rec[ss++]);
- FT_Init_Class_af_indic_script_class(&container->af_script_classes_rec[ss++]);
+ FT_Init_Class_af_latin_script_class(
+ &container->af_script_classes_rec[ss++] );
+ FT_Init_Class_af_cjk_script_class(
+ &container->af_script_classes_rec[ss++] );
+ FT_Init_Class_af_indic_script_class(
+ &container->af_script_classes_rec[ss++] );
+
+ FT_Init_Class_af_autofitter_service(
+ library, &container->af_autofitter_service );
- FT_Init_Class_af_autofitter_service(library, &container->af_autofitter_service);
+/* Exit: */
-/*Exit:*/
- if(error)
- autofit_module_class_pic_free(library);
+ if ( error )
+ autofit_module_class_pic_free( library );
return error;
}
diff --git a/src/autofit/afpic.h b/src/autofit/afpic.h
index 80e62d3..c1632e7 100644
--- a/src/autofit/afpic.h
+++ b/src/autofit/afpic.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType position independent code services for autofit module. */
/* */
-/* Copyright 2009 by */
+/* Copyright 2009, 2011 by */
/* Oran Agra and Mickey Gabel. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -33,24 +33,29 @@ FT_BEGIN_HEADER
#include "aftypes.h"
-/* increase these when you add new scripts, and update autofit_module_class_pic_init */
+ /* increase these when you add new scripts, */
+ /* and update autofit_module_class_pic_init */
#ifdef FT_OPTION_AUTOFIT2
- #define AF_SCRIPT_CLASSES_COUNT 6
+#define AF_SCRIPT_CLASSES_COUNT 6
#else
- #define AF_SCRIPT_CLASSES_COUNT 5
+#define AF_SCRIPT_CLASSES_COUNT 5
#endif
-#define AF_SCRIPT_CLASSES_REC_COUNT (AF_SCRIPT_CLASSES_COUNT-1)
+#define AF_SCRIPT_CLASSES_REC_COUNT ( AF_SCRIPT_CLASSES_COUNT - 1 )
typedef struct AFModulePIC_
{
- AF_ScriptClass af_script_classes[AF_SCRIPT_CLASSES_COUNT];
- AF_ScriptClassRec af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT];
- FT_AutoHinter_ServiceRec af_autofitter_service;
+ AF_ScriptClass af_script_classes[AF_SCRIPT_CLASSES_COUNT];
+ AF_ScriptClassRec af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT];
+ FT_AutoHinter_ServiceRec af_autofitter_service;
+
} AFModulePIC;
-#define GET_PIC(lib) ((AFModulePIC*)((lib)->pic_container.autofit))
-#define AF_SCRIPT_CLASSES_GET (GET_PIC(FT_FACE_LIBRARY(globals->face))->af_script_classes)
-#define AF_AF_AUTOFITTER_SERVICE_GET (GET_PIC(library)->af_autofitter_service)
+#define GET_PIC( lib ) \
+ ( (AFModulePIC*)((lib)->pic_container.autofit) )
+#define AF_SCRIPT_CLASSES_GET \
+ ( GET_PIC( FT_FACE_LIBRARY(globals->face) )->af_script_classes )
+#define AF_AF_AUTOFITTER_SERVICE_GET \
+ ( GET_PIC( library )->af_autofitter_service )
#endif /* FT_CONFIG_OPTION_PIC */