src/base


Log

Author Commit Date CI Message
Alexei Podtelezhnikov b6de8e66 2013-01-23T23:31:41 [base, truetype] New internal FT_Hypot function. * include/freetype/fttrigon.h (FT_Hypot): Declare it. * src/base/fttrigon.c (FT_Hypot): Define it. * src/truetype/ttgload.c (TT_Process_Composite_Component): Use it instead of explicit expressions. * src/truetype/ttinterp.c (Current_Ratio, Normalize): Use it instead of TT_VecLen. (TT_VecLen): Removed.
Alexei Podtelezhnikov dcc0d070 2013-01-23T23:09:59 Typo.
Alexei Podtelezhnikov da11e5e7 2013-01-23T20:11:40 [base] Fix integer overflow. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and outgoing vectors and use fixed point arithmetic.
Alexei Podtelezhnikov e1a2ac19 2013-01-23T19:51:28 [base] Fix integer overflow. * src/base/ftoutln.c (FT_Outline_Get_Orientation): Scale the coordinates down to avoid overflow.
Alexei Podtelezhnikov 869fb8c4 2013-01-23T19:43:28 [base] Split out MSB function. * src/base/fttrigon.c (ft_trig_prenorm): Borrow from here. * include/freetype/internal/ftcalc.h (FT_MSB): Declare here. * src/base/ftcalc.c (FT_MSB): Define here.
Werner Lemberg 71900980 2013-01-16T20:08:35 Minor.
Alexei Podtelezhnikov a692170a 2013-01-12T19:17:05 Call it fixed-point.
Werner Lemberg 53c0cb59 2013-01-11T08:29:22 Typos, whitespace.
Alexei Podtelezhnikov ad9d5c97 2013-01-10T22:29:07 [base] Update the overflow protection bit. The recent optimizations of CORDIC iterations drastically reduce the expansion factor. The vector components with MSB of 29 are now safe from overflow. * src/base/fttrigon.c (FT_TRIG_SAFE_MSB): New macro. (ft_trig_prenorm): Use it and remove dead code.
Werner Lemberg 4412e74d 2013-01-10T20:16:20 Minor comment improvements.
Alexei Podtelezhnikov 6b83a367 2013-01-09T00:25:32 [base, pshinter] Use FT_ABS, FT_MIN, and FT_MAX for readability. * src/base/ftbbox.c: Updated. * src/base/ftobjs.c: Updated. * src/base/fttrigon.c: Updated. * src/pshinter/pshalgo.c: Updated. * src/pshinter/pshrec.c: Updated.
Alexei Podtelezhnikov 09dbb059 2013-01-08T23:29:44 [base] Clean up trigonometric core. * src/base/fttrigon.c: Document the algorithm in a large comment. (FT_TRIG_COSCALE): Remove macro. (FT_Tan: Use `FT_TRIG_SCALE' instead. (FT_Cos, FT_Vector_Unit): Ditto and round the return values.
Alexei Podtelezhnikov 5dd9657f 2013-01-02T23:45:14 [base] Use rounding in CORDIC iterations. * src/base/fttrigon.c (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Improve accuracy by rounding.
Alexei Podtelezhnikov b4ac30b0 2013-01-02T22:21:37 [base] Reduce trigonometric algorithms. After we get within 45 degrees by means of true 90-degree rotations, we can remove initial 45-degree CORDIC iteration and start from atan(1/2) pseudorotation, reducing expansion factor thereby. * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macros. (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Update. * src/tools/cordic.py: Bring up to date with trigonometric core. * docs/CHANGES: Old typo.
Werner Lemberg 3ffb822e 2012-12-21T16:45:27 Check parameters of `FT_Outline_New'. Problem reported by Robin Watts <robin.watts@artifex.com>. * src/base/ftoutln.c (FT_Outline_New_Internal): Ensure that `numContours' and `numPoints' fit into FT_Outline's `n_points' and `n_contours', respectively.
Alexei Podtelezhnikov d7383b7b 2012-12-20T01:03:22 [base] Improve trigonometric core. FreeType used to rely on a 24-step iteration CORDIC algorithm to calculate trigonometric functions and rotate vectors. It turns out that once the vector is in the right half-plane, the initial rotation by 63 degrees is not necessary. The algorithm is perfectly capable to converge to any angle starting from the second 45 degree rotation. This patch removes the first rotation and makes it a 23-step CORDIC algorithm. * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macro values. (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Remove initial rotation.
Werner Lemberg 768590a9 2012-12-20T06:08:23 * src/base/ftobjs.c (ft_property_do): Fix compiler warning.
Alexei Podtelezhnikov 32fc416f 2012-12-19T23:05:32 * src/base/ftrfork.c (FT_Raccess_Guess): Switch to FT_Int counters.
Alexei Podtelezhnikov 06174dbb 2012-12-19T22:46:27 [base] Clean up trigonometric core. * src/base/fttrrigon.c (ft_trig_pseudo_polarize): Align algorithm with `ft_trig_pseudo_rotate'.
Alexei Podtelezhnikov 8ac5c5c8 2012-12-15T23:33:55 [base] Fix 11-year old bug. Since the initial commit (ebe85f59) the value of FT_TRIG_SCALE has always been slightly less than the correct value, which has been given in the comment as a hexadecimal. As a result, vector lengths were underestimated and rotated vectors were shortened.
Alexei Podtelezhnikov 72e976d4 2012-11-27T21:18:34 [ftstroke] Minor improvement. * src/base/ftstroke.c: Replace nested FT_DivFix and FT_MulFix with FT_MulDiv.
Werner Lemberg fa22ec1c 2012-11-17T11:45:24 * src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work.
Alexei Podtelezhnikov 0690d3d7 2012-11-15T20:50:59 [base] Fix integer overflows in dd5718c7d67a. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use FT_MulDiv.
Alexei Podtelezhnikov dd5718c7 2012-11-04T00:57:57 [base] Fortify emboldening code against egregious distortions. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Threshold emboldening strength when it leads to segment collapse.
Alexei Podtelezhnikov 48ce226a 2012-11-03T22:27:27 [base] Clean up emboldening code and improve comments there. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Replace sequential calls to FT_MulFix and FT_DivFix with FT_MulDiv. Mention that bisectors are used to figure out the shift direction.
Werner Lemberg 073a4cef 2012-09-15T09:10:06 Use `FT_Module' instead of `FT_Library' argument in property funcs. This internal change simplifies access to global module data. * include/freetype/internal/services/svprop.h (FT_Properties_SetFunc, FT_Properties_GetFunc): Change accordingly. * src/base/ftobjs.c (ft_property_do), src/autofit/afmodule.c (af_property_set, af_property_get): Updated.
Werner Lemberg 0f8fd88e 2012-08-30T23:31:55 Implement properties to control FreeType modules. * include/freetype/fterrdef.h (FT_Err_Missing_Property): New error code. * include/freetype/ftmodapi.h (FT_Property_Set, FT_Property_Get): New API. * include/freetype/internal/services/svprop.h: New file. * include/freetype/internal/ftserv.h (FT_SERVICE_PROPERTIES_H): New macro. * src/base/ftobjs.c: Include FT_SERVICE_PROPERTIES_H. (ft_property_do, FT_Property_Set, FT_Property_Get): New functions.
Werner Lemberg 328aa3b2 2012-08-27T11:23:41 [FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings. * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER), include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, FT_DEFINE_MODULE), include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2, FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4, FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6), src/autofit/afpic.c (autofit_module_class_pic_init), src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c (ft_create_default_module_classes), src/cff/cffparse.c (FT_Create_Class_cff_field_handlers), src/cff/cffpic.c (cff_driver_class_pic_init), src/pshinter/pshpic.c (pshinter_module_class_pic_init), src/psnames/pspic.c (psnames_module_class_pic_init), src/raster/rastpic.c (ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c (sfnt_module_class_pic_init), src/sfnt/ttcmap.c (FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c (ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c (tt_driver_class_pic_init): Initialize allocation variable.
Werner Lemberg d0841ea7 2012-08-27T06:57:05 [autofit] Some macro and variable renamings for orthogonality. * include/freetype/internal/autohint.h, src/base/ftobjs.c, src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h: s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/.
Werner Lemberg b355b569 2012-08-26T14:00:11 Fix Savannah bug #37178. * src/base/ftobjs.c (FT_Open_Face): Initialize `error' with `FT_Err_Missing_Module' before loop to indicate `no valid drivers'.
Werner Lemberg 68fe6a9a 2012-08-26T13:56:56 Formatting.
Werner Lemberg 04affa27 2012-08-17T09:28:28 * src/base/ftsynth.c (FT_GlyphSlot_Oblique): Fix shear angle. The old value was far too large (more than 20°). The new one corresponds to 12°, quite common in typography.
Alexei Podtelezhnikov bc5bcecf 2012-07-13T17:52:43 Revert the last commit 45337b07.
Alexei Podtelezhnikov 45337b07 2012-07-11T22:12:13 [ftstroke] Fix uninitialized return value. * src/base/ftstroke.c (FT_Stroker_New): Return FT_Err_Ok instead.
Gilles Espinasse 9123404c 2012-07-07T11:17:02 Fix strict-aliasing warning. * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Avoid double cast.
Werner Lemberg b6978dd0 2012-07-06T19:38:44 [autofit] Do some code cleanup. * src/autofit/afglobal.c (af_face_globals_new): Simplify. * src/autofit/afhints.c: Use `FT_TRACE7' instead of `printf' everywhere. (FT_COMPONENT): New macro. (af_glyph_hints_done): Simplify. * include/freetype/internal/fttrace.h: Updated.
Werner Lemberg 12470965 2012-06-27T08:44:30 Fix conditional compilation. * src/base/basepic.c: Use FT_CONFIG_OPTION_MAC_FONTS.
Alexei Podtelezhnikov cea9d7a6 2012-06-15T06:33:46 * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing. * docs/CHANGES: Updated.
Alexei Podtelezhnikov 2bdd0949 2012-05-28T23:11:03 * src/base/ftoutln.c (FT_Outline_Get_Orientation): Simplify. We now use the cross product of the direction vectors to compute the outline's orientation.
Alexei Podtelezhnikov f875fc71 2012-05-28T22:34:58 New function FT_Outline_EmboldenXY. * include/freetype/ftoutln.h (FT_Outline_EmboldenXY): Define it. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Implement it, using a simplified embolding algorithm. (FT_Outline_Embolden): Make it a special case of `FT_Outline_EmboldenXY'
Werner Lemberg ba67957d 2012-03-03T12:27:18 Fix Savannah bug #35660. For some divisions, we use casts to 32bit entities. Always guard against division by zero with these casts also. * src/base/ftcalc.c (ft_div64by32): Remove redundant cast. (FT_MulDiv, FT_MulDiv_No_Round): Add 32bit cast. (FT_DivFix): Add 32bit cast (this omission triggered the bug).
Alexei Podtelezhnikov b25265c5 2012-02-29T13:45:24 Avoid modulo operators against a power-of-two denominator. * src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c (ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_vvcurveto, cff_op_hhcurveto, cff_op_hvcurveto>, src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE), src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with `&' operator.
Werner Lemberg f24d0793 2012-02-11T09:37:46 Clean up `generic' fields. * include/freetype/internal/ftobjs.h (FT_ModuleRec, FT_LibraryRec): Remove `generic' field since users can't access it. * src/base/ftobjs.c (FT_Done_GlyphSlot): Call `generic.finalizer' as advertised in the documentation of FT_Generic. (Destroy_Module, FT_Done_Library): Updated to changes in `ftobjs.h'.
Werner Lemberg 02c0e526 2012-02-11T08:29:47 Formatting.
suzuki toshiya c7c4d68b 2012-01-17T15:13:50 [raccess] Modify for PIC build. Based on the patch provided by Erik Dahlstrom <ed@opera.com>, http://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00010.html Also `raccess_guess_table[]' and `raccess_rule_by_darwin_vfs()' are renamed with `ft_' suffixes. * src/base/ftbase.h: `raccess_rule_by_darwin_vfs()' is renamed to `ft_raccess_rule_by_darwin_vfs()'. * src/base/ftobjs.c: Ditto. * src/base/ftrfork.c: Declarations of FT_RFork_Rule, raccess_guess_rec, are moved to... * include/freetype/internal/ftrfork.h: Here. * include/freetype/internal/ftrfork.h: FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END} macros are defined to replace raccess_guess_table[] in both of PIC and non-PIC modes. * src/base/ftrfork.c: raccess_guess_table[] array is rewritten by FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END}. * src/base/basepic.h (BasePIC): Add `ft_raccess_guess_table' storage. (FT_RACCESS_GUESS_TABLE_GET): New macro to retrieve the function pointer from `ft_raccess_guess_table' storage in `BasePIC' structure. * src/base/ftrfork.c (FT_Raccess_Guess): Rewritten with FT_RACCESS_GUESS_TABLE_GET. (raccess_get_rule_type_from_rule_index): Add `library' as the first argument to the function, to retrieve the storage of `ft_raccess_guess_table' from it. Also `raccess_guess_table' is replaced by FT_RACCESS_GUESS_TABLE_GET. (ft_raccess_rule_by_darwin_vfs): Ditto.
suzuki toshiya 1749d8bc 2012-01-17T02:00:24 Remove trailing spaces.
suzuki toshiya c24f77ac 2012-01-16T21:13:05 Formatting PIC related sources. * src/autofit/afpic.c: Harmonize to FT2 coding conventions. * src/base/basepic.c: Ditto. * src/base/ftpic.c: Ditto. * src/cff/cffpic.c: Ditto. * src/pshinter/pshpic.c: Ditto. * src/psnames/pspic.c: Ditto. * src/raster/rastpic.c: Ditto. * src/sfnt/sfntpic.c: Ditto. * src/smooth/ftspic.c: Ditto. * src/truetype/ttpic.c: Ditto.
suzuki toshiya 3c966818 2012-01-15T23:35:31 Fix redundant declaration warning in PIC mode. Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were designed to declare xxx_pic_{free,init} by themselves. Because these macros are used at the end of the module interface (e.g. ttdriver.c) and the wrapper source to build a module as a single object (e.g. truetype.c) includes the PIC file (e.g. ttpic.c) before the module interface, these macros are expanded AFTER xxx_pic_{free,init} body when the modules are built as single object. The declaration after the implementation causes the redundant declaration warnings, so the declarations are moved to module PIC headers (e.g. ttpic.h). Separating to other header files are needed for multi build. * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER): Remove class_##_pic_free and class_##_pic_init declarations. * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, FT_DEFINE_MODULE): Ditto. * src/base/basepic.h: Insert a comment and fix coding style. * src/autofit/afpic.h: Declare autofit_module_class_pic_{free, init}. * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}. * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free, init}. * src/psnames/pspic.h: Declare psnames_module_class_pic_{free, init}. * src/raster/rastpic.h: Declare ft_raster{1,5}_renderer_class_pic_{free,init} * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}. * src/smooth/ftspic.h: Declare ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}. * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}.
suzuki toshiya 09f3e41c 2012-01-15T02:48:47 [base] Fix a dereference of uninitialized variable in PIC mode. * src/base/ftglyph.c (FT_Glyph_To_Bitmap): `glyph' must be set before derefering to obtain `library'. The initialization of `clazz', `glyph', `library' and NULL pointer check are reordered to minimize PIC conditonals.
suzuki toshiya 0614febc 2012-01-15T01:29:41 [base] Insert explict cast for GCC 4.6 in PIC mode. * src/base/ftinit.c (FT_Add_Default_Modules): Under PIC configuration, FT_DEFAULT_MODULES_GET returns FT_Module_Class** pointer, GCC 4.6 warns that const FT_Module_Class* const* variable is warned as inappropriate to store it. To calm it, explicit cast is inserted. Also `library' is checked to prevent the NULL pointer dereference in FT_DEFAULT_MODULES_GET.
Werner Lemberg 2fb22d56 2011-12-08T11:55:06 Fix serious scaling bug in `FT_Get_Advances'. * src/base/ftadvanc.c (FT_Get_Advances): Advance values returned by `FT_Load_Glyph' must be simply multiplied by 1024.
suzuki toshiya 714ee56a 2011-12-02T21:14:18 [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH. Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON was a configurable macro to disable Carbon-dependent code. Because now configure script sets DARWIN_NO_CARBON by default and disables Darwin & Carbon-dependent codes, these macros can be unified. FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON (defined by default) is removed, because DARWIN_NO_CARBON violates FT_XXX naming convention of public macros, and a macro configured by default is not portable for the building without configure (e.g. make devel). * builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based old Mac font support is requested and Carbon is available. * builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support for Mac OS X without Carbon (e.g. Mac OS X 10.4 for ppc64) is requested. * include/freetype/config/ftconfig.in: Ditto. * builds/vms/ftconfig.h: Ditto. * src/base/ftbase.h: Remove DARWIN_NO_CARBON. * src/base/ftbase.c: Ditto. * src/base/ftobjs.c: Ditto. * src/base/ftrfork.c: Ditto. * src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined (same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c). * builds/mac/ftmac.c: Ditto. * builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH. * builds/mac/FreeType.m68k_far.make.txt: Ditto. * builds/mac/FreeType.ppc_classic.make.txt: Ditto. * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
Werner Lemberg dfb475ab 2011-11-14T20:29:13 Fix compiler warning.
Chris Liddell 8b90cf0b 2011-11-13T16:30:59 Add FT_Get_PS_Font_Value() API. This allows a Type 1 font face to be interrogated to retrieve most of the dictionary keys (keys not relevant to FreeType's Type 1 interpreter are not available). * include/freetype/internal/services/svpsinfo.h (PS_GetFontValueFunc): New typedef. (PSInfo): Add `ps_get_font_value'. (FT_DEFINE_SERVICE_PSINFOREC): Updated. * include/freetype/internal/t1types.h (T1_EncodingType): Moved to... * include/freetype/t1tables.h: Here. (PS_Dict_Keys): New enumeration. (FT_Get_PS_Font_Value): New declaration. * src/base/fttype1.c (FT_Get_PS_Font_Value): New function. * src/type1/t1driver.c (t1_ps_get_font_value): This new function does the real job. (t1_service_ps_info): Add it. * src/cff/cffdrivr.c (cff_service_ps_info), src/cid/cidriver.c (cid_service_ps_info), src/type42/t42drivr.c (t42_service_ps_info): Updated.
suzuki toshiya 94ada3d8 2011-10-30T14:03:13 [raccess] Supplement for previous fix. * src/base/ftbase.h (raccess_rule_by_darwin_vfs): Do not declare it on native Mac OS X. * src/base/ftrfork.c (raccess_get_rule_type_from_rule_index): Hide raccess_get_rule_type_from_rule_index() on native Mac OS X too.
suzuki toshiya dbe330bc 2011-10-30T12:31:03 [raccess] Hide raccess_rule_by_darwin_vfs() on native Mac OS X. * src/base/ftrfork.c (raccess_rule_by_darwin_vfs): Do not compile on native Mac OS X because it is not used.
Kal Conley 72185cb5 2011-10-15T09:33:11 Fix handling of transformations if no renderer is present. * src/base/ftobjs.c (FT_Load_Glyph): Thinko.
Kal Conley 298608d1 2011-10-15T09:09:59 Fix conditions for autohinting. * src/base/ftobjs.c (FT_Load_Glyph): Handle FT_LOAD_IGNORE_TRANSFORM.
Werner Lemberg 9c98fbf6 2011-10-01T09:25:55 Handle some border cases. * include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro. * src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid value of `target->rows'. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for flex start. * src/raster/ftrend1.c (ft_raster1_render): Check `width' and `height'. * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against invalid values in `localpoints' array.
Werner Lemberg 57b6a614 2011-09-09T19:05:54 Better tracing of metrics. * src/base/ftobjs.c (FT_Request_Size, FT_Select_Size): Decorate with FT_TRACE.
Werner Lemberg c9a69022 2011-08-30T08:09:38 Typo.
Werner Lemberg 51ca771f 2011-08-30T07:42:19 Better tracing of metrics. * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Decorate with FT_TRACE.
David Bevan 864c426e 2011-08-15T17:34:01 Fix Savannah bug #33992. * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix border case.
Chris Morgan 3abf617b 2011-07-20T06:48:08 Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT. Useful for embedded systems which don't need file stream support. * src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement it.
Elton Chung 77f04ceb 2011-07-20T06:30:20 * src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo.
David Bevan aecbfe1b 2011-07-02T12:09:52 [ftstroke] Major revision. The main problems ----------------- o If FT_STROKER_LINEJOIN_BEVEL was specified, unlimited miter joins (not bevel joins) were generated. Indeed, the meanings of `miter' and `bevel' were incorrectly reversed (consistently) in both the code and comments. o The way bevel joins were constructed (whether specified explicitly, or created as a result of exceeding the miter limit) did not match what is required for stroked text in PostScript or PDF. The main fixes -------------- o The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected. o A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been introduced to support PostScript and PDF miter joins. o FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an alias for FT_STROKER_LINEJOIN_MITER. Additionally, a variety of stroking errors have been fixed. These would cause various artifacts (including points `at infinity'), especially when stroking poor quality fonts. See http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00001.html for example documents. The FreeType stroker now produces results very similar to that produced by GhostScript and Distiller for these fonts. Other problems -------------- The following problems have been resolved: o Inside corners could be generated incorrectly. Intersecting the inside corner could cause a missing triangular area and other effects. The intersection point can only be used if the join is between two lines and both lines are long enough. The `optimization' condition in `ft_stroker_inside' has been corrected; this requires the line length to be passed into various functions and stored in `FT_StrokerRec'. o Incorrect cubic curves could be generated. The angle calculations in `FT_Stroker_CubicTo' have been corrected to handle the case of the curve crossing the +/-PI direction. o If the border radius was greater than the radius of curvature of a curve, then the negative sector would end up outside (not inside) the border. This situation is now recognized and the negative sector is circumnavigated in the opposite direction. (If round line joins are being used, this code is disabled because the line join will always cover the negative sector.) o When a curve is split, the arcs may not join smoothly (especially if the curve turns sharply back on itself). Changes in direction between adjacent arcs were not handled. A round corner is now added if the deviation from one arc to the next is greater than a suitable threshold. o The current direction wasn't retained if a the outline contained a zero length lineto or a curve that was determined to be `basically a point'. This could cause a spurious join to be added. o Cubics with close control points could be mishandled. All eight cases are now distinguished correctly. Other improvements ------------------ o Borders for cubic curves could be too `flat'. FT_SMALL_CUBIC_THRESHOLD has been reduced a little to prevent this. o The handling and use of movable points has been simplified a little. o Various values are now computed only if the results are actually needed. o The directions of the outer and inner borders have been swapped, as recommended by Graham Asher. * src/base/ftstroke.c: Revised. * include/freetype/ftstroke.h: Updated.
suzuki toshiya 65a44988 2011-06-15T01:44:24 [base] Fix g++4.6 compiler warnings in src/base/*.c. Passing uninitialized pointer to the buffer allocator is not problematic theoretically (as far as the returned pointer is checked before writing), but g++4.6 dislikes it and warns by -Wuninitialized. Initialize them by NULL. * src/base/ftobjs.c (FT_Stream_New): Init `stream'. (new_memory_stream): Ditto. (FT_New_GlyphSlot): Init `slot'. (FT_CMap_New): Init `cmap'. (open_face_PS_from_sfnt_stream): Init `sfnt_ps'. (Mac_Read_POST_Resource): Init `pfb_data'. (Mac_Read_sfnt_Resource): Init `sfnt_data'. * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Init `offsets_internal' and `ref'. (raccess_guess_darwin_hfsplus): Init `newpath'. (raccess_guess_darwin_newvfs): Ditto. * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Init `buffer'. * src/base/ftstroke.c (FT_Stroker_New): Init `stroker'.
Kan-Ru Chen 21b1a0de 2011-04-12T09:26:43 Fix reading of signed integers from files on 64bit platforms. Previously, signed integers were converted to unsigned integers, but this can fail because of sign extension. For example, 0xa344a1eb becomes 0xffffffffa344a1eb. We now do the reverse which is always correct because the integer size is the same during the cast from unsigned to signed. * include/freetype/internal/ftstream.h, src/base/ftstream.c (FT_Stream_Get*): Replace with... (FT_Stream_GetU*): Functions which read unsigned integers. Update all macros accordingly. * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated.
Werner Lemberg 437fb8eb 2011-03-16T08:54:02 * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field. Suggested by Graham Asher.
Werner Lemberg c9bdfa7e 2011-03-06T18:35:37 Fix autohinting fallback. * src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs, ignoring CFF-based OTFs.
Kevin Kofler ff809507 2011-02-19T23:09:26 Fall back to autohinting if a TTF/OTF doesn't contain any bytecode. This is Savannah patch #7471. * src/base/ftobjs.c (FT_Load_Glyph): Implement it.
Werner Lemberg 312d26a4 2010-12-13T20:17:26 Fix parameter handling of `FT_Set_Renderer'. Reported by Kirill Tishin <siege@bk.ru>. * src/base/ftobjs.c (FT_Set_Renderer): Increment `parameters'.
suzuki toshiya ac09390a 2010-11-04T23:26:11 [UVS] Fix find_variant_selector_charmap(), Savannah bug #31545. Since 2010-07-04, find_variant_selector_charmap() returns the first cmap subtable always under rogue-compatible configuration, it causes NULL pointer dereference and make UVS-related functions crashed. * src/base/ftobjs.c (Fix find_variant_selector_charmap): Returns UVS cmap correctly.
suzuki toshiya b72e0460 2010-11-04T23:09:05 [UVS] Remove non-essential pointer checking in previous commit.
suzuki toshiya e891e4d6 2010-11-04T21:53:11 [UVS] Stabilizes UVS supporting functions against non-UVS fonts. UVS supporting functions assume the variation handler functions are valid. When a font without cmap format 14 is given, these function pointers are left as NULL, so calling these functions causes NULL pointer dereference. * src/base/ftobjs.c (FT_Face_GetCharVariantIndex): Check the pointer FT_CMap_Class->char_var_index before calling it. (FT_Face_GetCharVariantIsDefault): Check the pointer FT_CMap_Class->char_var_default before calling it. (FT_Face_GetVariantSelectors): Check the pointer FT_CMap_Class->variant_list before calling it. (FT_Face_GetVariantsOfChar): Check the pointer FT_CMap_Class->charvariant_list before calling it. (FT_Face_GetCharsOfVariant): Check the pointer FT_CMap_Class->variantchar_list before calling it.
suzuki toshiya b8b498f2 2010-10-25T00:35:59 Change the type of FT_MEM_VAL() from FT_ULong to FT_PtrDist. On LLP64 platforms (e.g. Win64), unsigned long (32-bit) cannot cover the memory address (64-bit). FT_MEM_VAL() is used for hashing only and not dereferred, so using signed type FT_PtrDist is safe. * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the return value from FT_ULong to FT_PtrDist. (ft_mem_table_resize): The type of hash is changed to FT_PtrDist. (ft_mem_table_get_nodep): Ditto.
suzuki toshiya 463dddad 2010-10-13T17:20:27 [raccess] Skip unrequired resource access rules by Darwin VFS. When a resource fork access rule by Darwin VFS could open the resource fork but no font is found in it, the rest of rules by Darwin VFS are skipped. It reduces the warnings of the deprecated resource fork access method by recent Darwin kernel. Fix MacPorts ticket #18859: http://trac.macports.org/ticket/18859 * src/base/ftobjs.c (load_face_in_embedded_rfork): When FT_Stream_New() returns FT_Err_Cannot_Open_Stream, it means that the file is possible to be fopen()-ed but zero-sized. Also there is a case that the resource fork is not zero-sized, but no supported font exists in it. If a rule by Darwin VFS falls into such cases, there is no need to try other Darwin VFS rules anymore. Such cases are marked by vfs_rfork_has_no_font. If it is TRUE, the Darwin VFS rules are skipped.
suzuki toshiya c081a4a9 2010-10-13T17:05:42 [raccess] Grouping resource access rules based on Darwin VFS. MacOS X/Darwin kernel supports a few tricky methods to access a resource fork via ANSI C or POSIX interface. Current resource fork accessor tries all possible methods to support all kernels. But if a method could open a resource fork but no font is found, there is no need to try other methods older than tested method. To determine whether the rule index is for Darwin VFS, a local function ftrfork.c::raccess_rule_by_darwin_vfs() is introduced. To use this function in ftobjs.c etc but it should be inlined, it is exposed by ftbase.h. * src/base/ftrfork.c (FT_RFork_Rule): New enum type to identify the rules to access the resource fork. (raccess_guess_rec): New structure to bind the rule function and rule enum type. (FT_Raccess_Guess): The list of the rule functions is replaced by (raccess_guess_table): This. This is exposed to be used by other intra module functions. (raccess_rule_by_darwin_vfs): A function to return a boolean if the rule specified by the rule index is based on Darwin VFS.
suzuki toshiya 4b718714 2010-10-13T16:21:59 Prevent to open a FT_Stream for zero-sized file on non-Unix. builds/unix/ftsystem.c prevents to open an useless stream from zero-sized file and returns FT_Err_Cannot_Open_Stream, but the stream drivers for ANSI C, Amiga and VMS return useless streams. For cross-platform consistency, all stream drivers should act same. * src/base/ftsystem.c (FT_Stream_Open): If the size of the opened file is zero, FT_Err_Cannot_Open_Stream is returned. * builds/amiga/src/base/ftsystem.c (FT_Stream_Open): Ditto. * src/vms/ftsystem.c (FT_Stream_Open): Ditto.
Werner Lemberg 5220ef58 2010-09-13T07:32:22 Fix minor issues reported by <muktha.narayan@wipro.com>. * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove redundant conditional check. * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto. * src/cff/cffload.c (cff_encoding_load): Remove conditional check which always evaluates to `true'. * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points): Ditto. * src/truetype/ttinterp.c (Ins_IUP): Ditto. * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if value is already dereferenced. * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
Werner Lemberg ba95440c 2010-08-06T20:07:36 Minor doc fixes, formatting.
suzuki toshiya 44524158 2010-08-07T01:46:56 Fix Savannah bug #30648. * src/base/ftobjs.c (FT_Done_Library): Specify the order of font drivers in face closing process. Type42 faces should be closed before TrueType faces, because a Type42 face refers another internal TrueType face which is created from sfnt[] array on the memory.
suzuki toshiya 81f3472c 2010-08-06T14:11:54 Fix Savannah bug #30658. * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the total length of collected POST segments does not overrun the allocated buffer.
Werner Lemberg 45a3c76b 2010-08-04T15:54:55 Fix Savannah bug #30644. * src/base/ftstream.c (FT_Stream_EnterFrame): Fix comparison.
Werner Lemberg fe3433c7 2010-07-18T18:41:47 Add reference counters and to FT_Library and FT_Face objects. * include/freetype/freetype.h (FT_Reference_Face): New function. * include/freetype/ftmodapi.h (FT_Rererence_Library): New function. * include/freetype/internal/ftobjs.h (FT_Face_InternalRec, FT_LibraryRec): New field `refcount'. * src/base/ftobjs.c (FT_Open_Face, FT_New_Library): Handle `refcount'. (FT_Reference_Face, FT_Reference_Library): Implement new functions. (FT_Done_Face, FT_Done_Library): Handle `refcount'. * docs/CHANGES: Updated.
Werner Lemberg c8f5b98b 2010-07-12T21:13:22 Remove C++ warnings. */*: Initialize pointers where necessary to make g++ happy.
Eugene A. Shatokhin b33b856a 2010-07-05T22:36:30 Fix Savannah bug #27648. * src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call `raster_done' only if we have an outline glyph format. Fix comment typo.
suzuki toshiya 0ae32718 2010-07-04T20:14:18 Restrict the number of the charmaps in a rogue-compatible mode. Fix for Savannah bug #30059. * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the minimum character code passed by a legacy rogue client by... * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE): This. It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is undefined (thus the rogue client compatibility is not required). * src/cff/cffobjs.c (cff_face_init): Abort the automatic selection or synthesis of Unicode cmap subtable when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE. * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. (find_variant_selector_charmap): When UVS charmap is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one. (FT_Select_Charmap): When a charmap matching with requested encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search earlier one. (FT_Set_Charmap): When a charmap matching with requested charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search earlier one. (FT_Get_Charmap_Index): When a requested charmap is found after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap index.
suzuki toshiya b2ea64bc 2010-07-02T18:16:02 Additional fix for Savannah bug #30306. * src/base/ftobjs.c (Mac_Read_POST_Resource): If the type of the POST fragment is 0, the segment is completely ignored. The declared length of the segment is not cared at all. According to Adobe Technical Note 5040, type 0 segment is comment only and should not be loaded for the interpreter. Reported by Robert Swiecki.
suzuki toshiya 5ef20c8c 2010-07-01T18:39:04 Initial fix for Savannah bug #30306. * src/base/ftobjs.c (Mac_Read_POST_Resource): Check `rlen' the length of fragment declared in the POST fragment header and prevent an underflow in length calculation. Some fonts set the length to zero in spite of the exist of following 16bit `type'. Reported by Robert Swiecki.
suzuki toshiya f29f741e 2010-07-01T17:31:03 Additional fix for Savannah bug #30248 and #30249. * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the buffer size during gathering PFB fragments embedded in LaserWriter PS font for Macintosh. Reported by Robert Swiecki.
Werner Lemberg 8bebaa74 2010-06-27T15:10:15 Fix valgrind warning. * src/base/ftoutln.c (FT_Outline_Get_Orientation): Initialize `result' array.
Werner Lemberg 75787c19 2010-06-26T09:24:08 Add some memory checks (mainly for debugging). * src/base/ftstream.c (FT_Stream_EnterFrame): Exit with error if the frame size is larger than the stream size. * src/base/ftsystem.c (ft_ansi_stream_io): Exit with error if seeking a position larger than the stream size.
suzuki toshiya c69891a1 2010-06-25T09:02:18 Initial fix for Savannah bug #30248 and #30249. * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the error during reading a PFB fragment embedded in LaserWriter PS font for Macintosh. Reported by Robert Swiecki.
Werner Lemberg 370aea80 2010-06-08T08:37:11 Formatting.
Werner Lemberg d087199f 2010-06-07T08:46:01 Fix Savannah bug #30052. This bug has been introduced with commit 2415cbf3. * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Protect against endless loop in case of corrupted font header data.
Werner Lemberg e30de299 2010-05-22T20:03:41 Fix various memory problems found by linuxtesting.org. * src/base/ftgxval.c (FT_TrueTypeGX_Free, FT_ClassicKern_Free), src/base/ftotval.c (FT_OpenType_Free), src/base/ftpfr.c (ft_pfr_check): Check `face'. * src/base/ftobjs.c (FT_Get_Charmap_Index): Check `charmap' and `charmap->face'. (FT_Render_Glyph): Check `slot->face'. (FT_Get_SubGlyph_Info): Check `glyph->subglyphs'. Improve API documentation.
Werner Lemberg 460d23f1 2010-04-05T08:46:26 Add new function `FT_Library_SetLcdFilterWeights'. This is based on code written by Lifter <http://unixforum.org/index.php?showuser=11691>. It fixes FreeDesktop bug #27386. * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): New function. * include/freetype/ftlcdfil.h: Updated. * docs/CHANGES: Updated.
suzuki toshiya 199f04f3 2010-03-12T14:48:57 Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c.
Werner Lemberg e0717d4f 2010-02-27T08:10:11 Simplify code. Suggested by Behdad. * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we call FT_Get_Next_Char anyway if necessary.