Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cf2ft.c

Issue 294353002: Fix warnings in android build, fix font rendering issue, fix issue 357588: wrong characters represe… (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Patch Set after rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /***************************************************************************/ 1 /***************************************************************************/
2 /* */ 2 /* */
3 /* cf2ft.c */ 3 /* cf2ft.c */
4 /* */ 4 /* */
5 /* FreeType Glue Component to Adobe's Interpreter (body). */ 5 /* FreeType Glue Component to Adobe's Interpreter (body). */
6 /* */ 6 /* */
7 /* Copyright 2013 Adobe Systems Incorporated. */ 7 /* Copyright 2013 Adobe Systems Incorporated. */
8 /* */ 8 /* */
9 /* This software, and all works of authorship, whether in source or */ 9 /* This software, and all works of authorship, whether in source or */
10 /* object code form as indicated by the copyright notice(s) included */ 10 /* object code form as indicated by the copyright notice(s) included */
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 138
139 static void 139 static void
140 cf2_builder_lineTo( CF2_OutlineCallbacks callbacks, 140 cf2_builder_lineTo( CF2_OutlineCallbacks callbacks,
141 const CF2_CallbackParams params ) 141 const CF2_CallbackParams params )
142 { 142 {
143 /* downcast the object pointer */ 143 /* downcast the object pointer */
144 CF2_Outline outline = (CF2_Outline)callbacks; 144 CF2_Outline outline = (CF2_Outline)callbacks;
145 CFF_Builder* builder; 145 CFF_Builder* builder;
146 FT_Error error;
146 147
147 148
148 FT_ASSERT( outline && outline->decoder ); 149 FT_ASSERT( outline && outline->decoder );
149 FT_ASSERT( params->op == CF2_PathOpLineTo ); 150 FT_ASSERT( params->op == CF2_PathOpLineTo );
150 151
151 builder = &outline->decoder->builder; 152 builder = &outline->decoder->builder;
152 153
153 if ( !builder->path_begun ) 154 if ( !builder->path_begun )
154 { 155 {
155 /* record the move before the line; also check points and set */ 156 /* record the move before the line; also check points and set */
156 /* `path_begun' */ 157 /* `path_begun' */
157 cff_builder_start_point( builder, 158 » » error = cff_builder_start_point(builder,
158 params->pt0.x, 159 params->pt0.x,
159 params->pt0.y ); 160 params->pt0.y );
161 if (callbacks && callbacks->error) *callbacks->error = error;
162 if (error) return;
160 } 163 }
161 164
162 /* `cff_builder_add_point1' includes a check_points call for one point */ 165 /* `cff_builder_add_point1' includes a check_points call for one point */
163 cff_builder_add_point1( builder, 166 » error = cff_builder_add_point1(builder,
164 params->pt1.x, 167 params->pt1.x,
165 params->pt1.y ); 168 params->pt1.y );
169 if (callbacks && callbacks->error) *callbacks->error = error;
166 } 170 }
167 171
168 172
169 static void 173 static void
170 cf2_builder_cubeTo( CF2_OutlineCallbacks callbacks, 174 cf2_builder_cubeTo( CF2_OutlineCallbacks callbacks,
171 const CF2_CallbackParams params ) 175 const CF2_CallbackParams params )
172 { 176 {
173 /* downcast the object pointer */ 177 /* downcast the object pointer */
174 CF2_Outline outline = (CF2_Outline)callbacks; 178 CF2_Outline outline = (CF2_Outline)callbacks;
175 CFF_Builder* builder; 179 CFF_Builder* builder;
180 FT_Error error;
176 181
177 182
178 FT_ASSERT( outline && outline->decoder ); 183 FT_ASSERT( outline && outline->decoder );
179 FT_ASSERT( params->op == CF2_PathOpCubeTo ); 184 FT_ASSERT( params->op == CF2_PathOpCubeTo );
180 185
181 builder = &outline->decoder->builder; 186 builder = &outline->decoder->builder;
182 187
183 if ( !builder->path_begun ) 188 if ( !builder->path_begun )
184 { 189 {
185 /* record the move before the line; also check points and set */ 190 /* record the move before the line; also check points and set */
186 /* `path_begun' */ 191 /* `path_begun' */
187 cff_builder_start_point( builder, 192 error = cff_builder_start_point( builder,
188 params->pt0.x, 193 params->pt0.x,
189 params->pt0.y ); 194 params->pt0.y );
195 if (callbacks && callbacks->error) *callbacks->error = error;
196 if (error) return;
190 } 197 }
191 198
192 /* prepare room for 3 points: 2 off-curve, 1 on-curve */ 199 /* prepare room for 3 points: 2 off-curve, 1 on-curve */
193 cff_check_points( builder, 3 ); 200 error = cff_check_points( builder, 3 );
201 » if (callbacks && callbacks->error) *callbacks->error = error;
202 » if (error) return;
194 203
195 cff_builder_add_point( builder, 204 cff_builder_add_point( builder,
196 params->pt1.x, 205 params->pt1.x,
197 params->pt1.y, 0 ); 206 params->pt1.y, 0 );
198 cff_builder_add_point( builder, 207 cff_builder_add_point( builder,
199 params->pt2.x, 208 params->pt2.x,
200 params->pt2.y, 0 ); 209 params->pt2.y, 0 );
201 cff_builder_add_point( builder, 210 cff_builder_add_point( builder,
202 params->pt3.x, 211 params->pt3.x,
203 params->pt3.y, 1 ); 212 params->pt3.y, 1 );
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 639
631 FT_ASSERT( decoder ); 640 FT_ASSERT( decoder );
632 641
633 cff_builder_close_contour( &decoder->builder ); 642 cff_builder_close_contour( &decoder->builder );
634 643
635 FT_GlyphLoader_Add( decoder->builder.loader ); 644 FT_GlyphLoader_Add( decoder->builder.loader );
636 } 645 }
637 646
638 647
639 /* END */ 648 /* END */
OLDNEW
« no previous file with comments | « core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cf2font.c ('k') | core/src/fxge/fx_freetype/fxft2.5.01/src/cff/cf2hints.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698