src/base/ftstroke.c


Log

Author Commit Date CI Message
Werner Lemberg 76abc75c 2015-02-16T22:00:27 [base] Finish compiler warning fixes for signedness issues. * src/base/ftglyph.c, src/base/ftlcdfil.c, src/base/ftstroke.c: Apply.
Werner Lemberg f57fc59e 2015-01-17T20:41:43 Run `src/tools/update-copyright'.
Werner Lemberg 9870d6da 2014-12-07T09:40:47 */*: Decorate hex constants with `U' and `L' where appropriate.
Werner Lemberg f34f1925 2014-11-26T21:59:21 * src/*: Add checks for parameters of API functions where missing. `API functions' are functions tagged with `FT_EXPORT_DEF'. Besides trivial fixes, the following changes are included, too. * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set error code if no service is available. * src/base/ftinit.c (FT_Done_FreeType): Change return value for invalid `library' parameter to `Invalid_Library_Handle'. * src/base/ftobjs.c (FT_New_Size): Change return value for invalid `asize' parameter to `Invalid_Argument'. * src/base/ftoutln.c (FT_Outline_Copy): Change return value for invalid `source' and `target' parameters to `Invalid_Outline'. (FT_Outline_Done_Internal): Change return value for invalid `outline' parameter to `Invalid_Outline'.
Werner Lemberg f4f9e688 2014-11-25T11:11:55 */*: s/Invalid_Argument/Invalid_Library_Handle/ where appropriate.
Werner Lemberg 04c2aa18 2014-11-25T10:22:12 */*: s/Invalid_Argument/Invalid_Outline/ where appropriate.
Werner Lemberg b24e8ba2 2014-11-25T08:30:49 [Savannah bug #43682] Add/remove `void' casts to some functions. We use a cast to indicate that we intentionally ignore a function's return value. However, this doesn't apply to API functions where errors can only happen for trivially invalid input. * src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder), src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c (cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning), src/type1/t1load.c (parse_encoding), src/type42/t42parse.c (t42_parse_encoding): Do it.
Werner Lemberg 0e73d218 2014-11-09T01:27:38 * src/base/ftstroke.c (ft_stroker_inside): Fix border intersections. One more place to check whether `radius' is zero. Problem reported by Marco Wertz <marco.wertz@gmx.de>.
Werner Lemberg 89f50647 2013-03-14T17:50:49 */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate. FT_Err_XXX and friends are no longer directly used in the source code.
Werner Lemberg 059bc335 2013-03-14T10:27:35 */*: Use `FT_THROW'. This is essentially a mechanical conversion, adding inclusion of `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for stand-alone compiling modes of the rasterizer modules. To convert the remaining occurrences of FT_Err_XXX and friends it is necessary to rewrite the code. Note, however, that it doesn't harm if some cases are not handled since FT_THROW is a no-op.
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.
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.
David Bevan 864c426e 2011-08-15T17:34:01 Fix Savannah bug #33992. * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix border case.
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'.
Werner Lemberg 437fb8eb 2011-03-16T08:54:02 * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field. Suggested by Graham Asher.
Werner Lemberg fc58155a 2010-01-05T20:00:35 Apply reports from clang static analyzer. * src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c (FT_Stroker_ParseOutline), src/base/ftsynth.c (FT_GlyphSlot_Embolden): Remove dead code. * src/base/ftpatent.c (_tt_check_patents_in_table): Initialize `offset_i'.
Werner Lemberg a5e9dbd5 2009-11-20T09:33:57 Fix Savannah bug #27742. * src/base/ftstroke.c (ft_stroker_outside): Avoid silent division by zero, using a threshold for `theta'.
Michael Zucchi f33b237c 2009-06-08T17:12:40 Handle FT_STROKER_LINECAP_BUTT. This fixes Savannah bug #26757. * src/base/ftstroke.c (ft_stroker_cap): Implement it.
Oran Agra 636c294b 2009-04-05T17:59:26 Position Independent Code (PIC) support and infrastructure in base. * include/freetype/config/ftoption.h add FT_CONFIG_OPTION_PIC * include/freetype/internal/ftobjs.h Add pic_container member to FT_LibraryRec. Add macros to declare and init instances of FT_CMap_ClassRec. Add macros to init instances of FT_Outline_Funcs and FT_Raster_Funcs. Add macros to declare, allocate and initialize modules (FT_Module_Class). Add macros to declare, allocate and initialize renderers (FT_Renderer_Class). Add macro to init instances of FT_Glyph_Class. Add macros to declare, allocate and initialize drivers (FT_Driver_ClassRec). * include/freetype/internal/ftpic.h new file to declare the FT_PIC_Container struct and the functions to allocate and detroy it. * include/freetype/internal/ftserv.h add macros to allocate and destory arrays of FT_ServiceDescRec. * include/freetype/internal/internal.h define macro to include ftpic.h. New Files: * src/base/ftpic.c implement functions to allocate and destory the global pic_container. * src/base/basepic.h declare struct to hold PIC globals for base and macros to access them. * src/base/basepic.c implement functions to allocate, destroy and initialize PIC globals for base. * src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement functions that allocate and destroy ft_default_modules according to FT_CONFIG_MODULES_H in the pic_container instead of the global scope and use macro from basepic.h to access it. * src/base/ftobjs.c add calls to the functions that allocate and destroy the global pic_container when the library is created and destroyed. * src/base/jamfile add new files to FT2_MULTI build: ftpic.c and basepic.c. * src/base/ftbase.c add new files to build: ftpic.c and basepic.c. * src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined ft_bitmap_glyph_class and ft_outline_glyph_class will be allocated in the pic_container instead of the global scope and use macros from basepic.h to access them. * src/base/ftbbox.c allocate bbox_interface stract on the stack instead of the global scope when FT_CONFIG_OPTION_PIC is defined. * src/base/ftstroke.c access ft_outline_glyph_class allocated in ftglyph.c via macros from basepic.h
Oran Agra 3da7e68f 2009-04-05T17:30:14 Minor change in ftstroke.c. * src/base/ftstroke.c (FT_StrokerRec): Replace `memory' member with `library' needed for PIC version. Update all callers.
Werner Lemberg b66efefd 2009-03-12T08:07:49 Fix some FreeType Coverity issues as reported for Ghostscript. * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize `args.stream' (#3874, #3875). (open_face_PS_from_sfnt_stream): Improve error management (#3786). * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice' (#3870). * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead code (#3790). * src/base/ftrfork.c (raccess_guess_apple_generic): Check error value of `FT_Stream_Skip' (#3784). * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing it (#3872) * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing it (#3871). * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of `pcf_get_metric' (#3789, #3782). (pcf_get_properties): Use FT_STREAM_SKIP (#3783). * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of `acache' (#3797) * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff' (#3796). * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795). * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794). * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom' (#3793). (_bdf_parse_start): Add comment (#3792). * src/raster/ftraster.c (Finalize_Profile_Table): Check `ras.fProfile' (#3791). * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785). * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore seek error (#3781).
Werner Lemberg 4afcfd30 2008-09-16T17:32:02 beautifying, doc fixes.
Werner Lemberg 2b0b4221 2008-05-28T22:17:28 Cosmetic code changes.
Werner Lemberg 8a8c6022 2006-04-22T12:24:52 Formatting, copyright years, documentation.
David Turner 7dc7f215 2006-04-13T16:31:02 doc updates - fixing FT_Stroker_New to use a FT_Library instead of a FT_Memory i know, i know, the ChangeLog will be updated later
Werner Lemberg 3d7b1d55 2005-06-01T15:30:44 * src/base/ftstroke.c (ft_stroker_inside): Revert `sigma' patch from 2004-07-11; this gives much better results under normal circumstances.
Werner Lemberg 22ad9ef0 2005-05-09T22:11:36 Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck Blaskey). * src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'. * src/sfnt/ttcmac.c: Use SFNT_Err_Ok where appropriate. (tt_cmap0_validate, tt_cmap2_validate, tt_cmap6_validate, tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate): Use `FT_Error' as return type. (tt_cmap4_validate): Use `FT_Error' as return type. Return error code for unsorted cmap. (tt_cmap4_char_index, tt_cmap4_char_next): Use old code for unsorted cmaps. (tt_face_build_cmaps): Set `unsorted' variable in cmap. Minor formatting.
David Turner 750fa961 2005-05-01T10:11:32 * Jamfile: removing otvalid from the list of compiled modules * include/freetype/internal/ftserv.h: added compiler pragmas to get rid of annoying warnings with Visual C++ compiler in maximum warning mode * src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftstroke.c, src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcmanag.c, src/cff/cffload.c, src/cid/cidload.c, src/lzw/zopen.c, src/otvalid/otvgdef.c, src/pcf/pcfread.c, src/sfnt/sfobjs.c, src/truetype/ttgxvar.c: removing compiler warnings
Werner Lemberg ece8b20e 2004-12-13T23:16:59 Documentation updates, whitespace.
Werner Lemberg 43f0e26c 2004-07-17T16:45:21 * docs/CHANGES: Updated. * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix compiler warning.
David Turner 0634a876 2004-07-15T21:08:13 * src/base/ftstroke (FT_Stroker_ParseOutline): single points are not stroked, preventing a bug with pala.ttf and other fonts.
Werner Lemberg f68cfd09 2004-07-14T21:30:34 * src/base/ftstroke (ft_stroke_border_reverse): Removed. Unused.
David Turner 77c001e5 2004-07-12T20:48:31 * src/base/ftstroke.c: last (?) bugfixes to the stroker.
David Turner 629d7df9 2004-07-11T21:09:06 * src/base/ftstroke.c: fixed a bug that prevented the stroker to correctly generate stroked paths from closed paths, i.e. nearly all glyphs in vectorial fonts :-) The code is still _very_ buggy though, treat with special care.
Werner Lemberg 8f1edf74 2004-02-20T01:39:05 * src/base/ftstroke.c (FT_Glyph_StrokeBorder): Fix enum handling. * src/cff/cffdrivr.c (cff_get_cmap_info): Remove compiler warning.
Werner Lemberg 6cda9c48 2004-01-22T09:07:12 * include/freetype/ftcache.h: Delete duplicated definition of FTC_FaceID. * src/cff/cffdrivr.c (cff_get_cmap_info): Call sfnt module's TT CMap Info service function if the cmap comes from sfnt. Return 0 if the cmap is sythesized in cff module. Formatting; updating copyright.
David Turner fa0346d6 2004-01-16T08:57:05 * src/base/ftstroke.c, include/freetype/ftstroke.h: fixing bugs and adding FT_Glyph_Stroke and FT_Glyph_StrokerBorder APIs
David Turner 4632fccb 2004-01-15T19:07:44 * include/freetype/internal/ftmemory.h, src/autohint/ahhint.c, src/base/ftgloadr.c, src/base/ftglyph.c, src/base/ftoutln.c, src/base/ftstroke.c, src/cff/cffload.c, src/truetype/ttgload.c, src/truetype/ttinterp.c: introducing the new FT_ARRAY_COPY and FT_ARRAY_MOVE macros to make copying arrays easier
Werner Lemberg 80cfbd70 2003-12-26T07:26:08 * src/base/fttrigon.c, src/base/ftgloadr.c: Inlude FT_INTERNAL_OBJECTS_H. * src/base/ftstroke.c (FT_Outline_GetInsideBorder, FT_Outline_GetOutsideBorder): s/or/o/ to make it compile with C++ compilers. * src/cache/ftcmru.c, include/freetype/cache/ftcmru.h: s/select/selection/ to avoid compiler warning. * src/cff/cffload.h: s/select/ftselect/ to avoid potential compiler warning. Formatting.
David Turner 57ecae22 2003-12-19T21:23:58 new version of the cache sub-system - still under debugging
Werner Lemberg 499053c1 2003-06-07T04:02:21 * include/freetype/ftstroker.h: Renamed to... * include/freetype/ftstroke.h: This. * src/base/ftstroker.c: Renamed to... * src/base/ftstroke.c: This. * include/freetype/config/ftheader.h (FT_STROKER_H): Updated. * src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk: Updated. * src/pcf/pcfdriver.c: Renamed to... * src/pcf/pcfdrivr.c: This. * src/pcf/pcfdriver.h: Renamed to... * src/pcf/pcfdrivr.h: This. * src/pcf/Jamfile, src/pcf/rules.mk: Updated.