src/base


Log

Author Commit Date CI Message
Sean McBride 7be2a94a 2014-02-08T13:55:38 Fix clang static analyzer and compiler warnings. * src/autofit/afhints.c (af_glyph_hints_align_weak_points), src/autofit/afloader (af_loader_load_g) <FT_GLYPH_FORMAT_COMPOSITE>, src/base/ftcalc.c (FT_MSB), src/base/ftoutln.c (FT_Outline_Decompose), src/bdf/bdfdrivr.c (bdf_interpret_style), src/cff/cffparse.c (cff_parse_integer), src/cid/cidparse.c (cid_parser_new), src/pfr/pfrload.c (pfr_phy_font_load), src/raster/ftraster.c (Decompose_Curve), src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/ttcmap.c (tt_cmap12_next, tt_cmap13_next), src/smooth/ftgrays.c (gray_hline): Remove dead code. * src/autofit/afmodule.c (af_property_get_face_globals, af_property_set, af_property_get), src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Make functions static. * src/base/ftobjs.c (ft_remove_renderer): Protect against library == NULL. (ft_property_do): Make function static. * src/base/ftrfork.c: Include `ftbase.h'. * src/sfnt/ttsbit.c (tt_face_load_sbix_image) [!FT_CONFIG_OPTION_USE_PNG], src/type1/t1gload.c (T1_Compute_Max_Advance): Avoid compiler warning. * src/truetype/ttinterp.c (TT_New_Context): Reduce scope of variable.
Werner Lemberg aae0f1af 2014-01-19T18:27:18 Minor.
Werner Lemberg 00a7b51f 2013-12-27T19:18:49 Minor.
suzuki toshiya e2d2b154 2013-12-27T16:44:24 [ftrfork] Fix the face order difference between POSIX and Carbon. The fragmented resources in Suitcase and .dfont should be reordered when post resource for Type1 is being restored, but reordering of sfnt resources induces the different face order. Now the ordering is restricted to post resource only, to prevent the different order issue (e.g. the face index in the fontconfig cache generated with Carbon framework is incompatible with that by FreeType2 without Carbon framework.) Found by Khaled Hosny and Hin-Tak Leung. http://lists.gnu.org/archive/html/freetype-devel/2013-02/msg00035.html http://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch `sort_by_res_id' to control the fragmented resource ordering. * include/internal/ftrfork.h: Daclare new switch. * src/base/ftobjs.c (IsMacResource): Enable the soring for post resource, and disable the sorting for sfnt resource.
Werner Lemberg bd413862 2013-12-21T08:14:25 Fix PIC linking. * include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix generated function name. * src/base/basepic.c (FT_Init_Table_raccess_guess_table): Rename to ... (FT_Init_Table_ft_raccess_guess_table): ... this so that the function name correctly corresponds to what the macro framework expects. * src/psnames/rules.mk (PSNAMES_DRV_SRC_S): Use correct file name so that PIC functions are compiled also.
Werner Lemberg c4e968ed 2013-12-21T07:23:08 [base] Add missing dependencies to Makefile. * src/base/rules.mk (BASE_SRC): Add `basepic.c' and `ftpic.c'. (BASE_H): Add `basepic.h'.
Werner Lemberg a44b784b 2013-12-02T09:52:38 Formatting.
Werner Lemberg 28626869 2013-11-20T21:06:18 [truetype] Don't trust `maxp's `maxSizeOfInstructions'. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>; see http://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html for details. * src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep' tables also for setting `autohint'. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from `TT_Process_Composite_Glyph' for handling unreliable values of `maxSizeOfInstructions'.
Werner Lemberg fae38207 2013-11-13T08:55:46 Simplify header file hierarchy. This large patch changes the header file directory layout from `include/freetype/...' to `include/...', effectively removing one level. Since the file `ft2build.h' is also located in `include' (and it stays there even after installation), all FreeType header files are now in a single directory. Applications that use (a) `freetype-config' or FreeType's `pkg-config' file to get the include directory for the compiler, and (b) the documented way for header inclusion like #include <ft2build.h> #include FT_FREETYPE_H ... don't need any change to the source code. * include/freetype/*: Move up to... * include/*: ... this directory. * builds/amiga/include/freetype/*: Move up to... * builds/amiga/include/*: ... this directory. */*: Essentially do `s@/freetype/@/@' where appropriate. * CMakeList.txt: Simplify. * builds/unix/freetype-config.in, builds/unix/freetype2.in: For `--cflags', return a single directory. * builds/unix/install.mk (install): No longer try to remove `cache' and `internal' subdirectories; instead, remove the `freetype' subdirectory.
Werner Lemberg 604838d5 2013-10-22T01:10:10 * src/base/md5.c, src/base/md5.h: Updated to recent version. * src/base/ftobjs.c: Updated; `md5.c' no longer uses `free'.
Behdad Esfahbod 31e726d9 2013-09-20T07:20:53 Fix vertical size of emboldened glyphs. Cf. https://bugzilla.gnome.org/show_bug.cgi?id=686709 * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Adjust `horiBearingY' also.
Werner Lemberg d689d1cf 2013-08-29T17:53:40 Implement support for WOFF containers. We simply synthesize a SFNT from the WOFF, create a memory stream for the new data, and load the SFNT as usual. Does NOT add any API to access WOFF metadata or private blocks. * include/freetype/internal/tttypes.h (WOFF_HeaderRec, WOFF_TableRec): New structures. * include/freetype/tttags.h (TTAG_wOFF): New macro. * src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling `open_face'. * src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include `FT_GZIP_H'. (WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for writing to a stream. (sfnt_stream_close, compare_offsets, woff_open_font): New functions. (sfnt_open_font): Handle `TTAG_wOFF'. (sfnt_init_face): Set `stream' after calling `sfnt_open_font'. * src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling `sfnt->init_face'. * src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an argument so that a changed stream survives. Update callers.
Behdad Esfahbod bd3849e7 2013-08-27T21:43:38 FT_Open_Face: Improve external stream handling. If the font's `clazz->init_face' function wants to swap to new stream, handling of whether original stream was external could result to either memory leak or double free. Mark externality into face flags before calling `init_face' such that the clazz can handle external streams properly. * src/base/ftobjs.c (FT_Open_Face): Move code to set FT_FACE_FLAG_EXTERNAL_STREAM to... (open_face): This function.
Werner Lemberg bcd8c0b0 2013-08-27T21:36:03 Remove `FT_SqrtFixed' function. It's no longer used. * include/freetype/internal/ftcalc.h, src/base/ftcalc.c: Do it.
Werner Lemberg 71c0ad65 2013-08-27T21:30:09 Whitespace.
Alexei Podtelezhnikov fc32e1c8 2013-08-19T22:57:05 [base] Enable new algorithm for BBox_Cubic_Check. * src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove the old one. Improve comments.
Alexei Podtelezhnikov 32a7d870 2013-08-17T22:19:21 [base] Clean up BBox_Conic_Check. * src/base/ftbbox.c (BBox_Conic_Check): Remove redundant checks for extremum at the segment ends, which are already within the bbox. Slightly modify calculations.
Alexei Podtelezhnikov 1a9c3d14 2013-08-15T22:51:42 [base] Finish experimental (disabled) BBox_Cubic_Check implementation. * src/base/ftbbox.c (BBox_Cubic_Check): Scale arguments to improve accuracy and avoid overflows.
Alexei Podtelezhnikov 61a65510 2013-08-13T22:28:57 [base] Refactor experimental (disabled) BBox_Cubic_Check. * src/base/ftbbox.c (BBox_Cubic_Check): Implement the minimum search as the mirror image of the maximum search.
Werner Lemberg ba9cf52d 2013-08-05T07:00:59 Comment typo.
Werner Lemberg fb09a51f 2013-08-04T18:24:02 Add comments to `ft_corner_is_flat'.
Werner Lemberg e8ed2d62 2013-08-01T12:20:20 Another round of cppcheck nitpicks. The call was (from the top-level of the FreeType tree): cppcheck --force \ --enable=all \ -I /usr/include \ -I /usr/local/include \ -I /usr/lib/gcc/i586-suse-linux/4.7/include \ -I include \ -I include/freetype \ -I include/freetype/config \ -I include/freetype/internal \ -DFT2_BUILD_LIBRARY \ . &> cppcheck.log using cppcheck git commit f7e93f99. Note that cppcheck still can't handle `#include FOO' (with `FOO' a macro). */* Improve variable scopes. */* Remove redundant initializations which get overwritten. * src/gxvalid/*: Comment out redundant code or guard it with FT_DEBUG_LEVEL_TRACE.
Werner Lemberg cc34efca 2013-07-31T22:55:50 Minor.
suzuki toshiya f2e7f1e1 2013-07-30T13:32:57 2013-07-30 Behdad Esfahbod <behdad@google.com> Prevent division by zero by a transparent color. * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Return 0 immediately, when alpha channel is zero.
Werner Lemberg 25b7da53 2013-06-19T10:23:36 * Version 2.5.0 released. ========================= Tag sources with `VER-2-5-0'. * docs/VERSION.DLL: Update documentation and bump version number to 2.5.0. * README, Jamfile (RefDoc), builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html, builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html, builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html, builds/win32/visualc/freetype.dsp, builds/win32/visualc/freetype.vcproj, builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp, builds/win32/visualce/freetype.vcproj, builds/win32/visualce/index.html, builds/wince/vc2005-ce/freetype.vcproj, builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/freetype.vcproj, builds/wince/vc2008-ce/index.html: s/2.4.12/2.5.0/, s/2412/250/. * include/freetype/freetype.h (FREETYPE_MINOR): Set to 5. (FREETYPE_PATCH): Set to 0. * builds/unix/configure.raw (version_info): Set to 16:2:10. * src/base/ftobjs.c (FT_Open_Face): Pacify compiler. * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIRP): Ditto.
Werner Lemberg f56691a8 2013-06-18T10:17:48 Fix Savannah bug #39269. * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Free memory in case of reacollocation failures.
Andrew Church 67cf7a88 2013-06-18T09:35:34 Fix Savannah bug #39266. If memory allocations fail at certain points while opening a font, FreeType can either crash due to a NULL dereference or leak memory. * include/freetype/internal/ftobjs.c (FT_Face_InternalRec, FT_LibraryRec): Make `refcount' a signed integer. If, for example, FT_Open_Face() fails in a memory allocation before the face's reference count is set to 1, a subsequent `FT_Done_Library' call would otherwise loop over `FT_Done_Face' 2^32 times before freeing the face. * src/base/ftobjs.c (open_face): Initialize `stream' and friends earlier. (FT_Open_Face) <Fail>: Behave correctly if `node' is NULL. (FT_Destroy_Module) <Fail>: Check that `renderer_clazz' is valid.
Werner Lemberg c06889eb 2013-06-12T10:58:06 More compiler warning fixes. */*: Use cast to `FT_Bool' (or `Bool') where appropriate.
Werner Lemberg a25ecfdd 2013-06-10T12:57:16 [sfnt] Improve embedded bitmap tracing. * src/base/ftobjs.c (FT_Request_Size): Move trace message regarding bitmap strike match to... (FT_Match_Size): This function. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics, tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png, tt_sbit_decoder_load_image): Decorate with tracing messages.
Werner Lemberg 3f6e0e0c 2013-06-07T18:10:40 Add and improve pragmas for MSVC compiler. * include/freetype/internal/ftdebug.h: Remove pragmas. * include/freetype/internal/ftserv.h: Use push and pop for pragmas. * include/freetype/internal/ftvalid.h: Handle warning C4324. * src/base/ftobjs.c: Use push and pop for pragmas. * src/gzip/ftgzip.c: Handle warning C4244.
Werner Lemberg badf3178 2013-06-06T09:16:38 Next round of compiler fixes. * builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init): Add proper cast. * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix cast. * include/freetype/internal/ftstream.h: Decorate stream and frame macros with `FT_Long' and `FT_ULong' as appropriate. * src/base/ftrfork.c (raccess_guess_darwin_hfsplus, raccess_guess_darwin_newvfs): Use cast. * src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast. * src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast. * src/cache/ftcmanag.h (FTC_ManagerRec): Ditto. * src/cff/cf2arrst.c (cf2_arrstack_setNum_Elements): Use cast. * src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto. * src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto. * src/cid/cidparse.c (cid_parser_new): Use cast. * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast. * src/psaux/psobjs.c (reallocate_t1_table): Fix argument type. * src/raster/ftraster.c (ft_black_reset): Use cast. * src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast. (ALL_POINTS): Fix cast. * src/type1/t1driver.c (t1_ps_get_font_value): Add casts. * src/type1/t1parse.c (T1_Get_Private_Dict): Add cast.
Dave Arnold c378249e 2013-06-05T19:57:55 Fix more MSVC Win32 compiler warnings. * src/base/ftobjs.c: Fix typo in MS pragma. * src/base/bdflib.c (_bdf_set_default_spacing, _bdf_add_property): `lineno' is only used in debug mode. * src/cff/cf2ft.c (cf2_builder_moveTo): `params' is only used in debug mode.
Werner Lemberg 45392b77 2013-06-05T13:43:20 Fix compiler warnings. * include/freetype/internal/ftmemory.h: Decorate memory allocation macros with `FT_Long' where appropriate. Remove duplicate of FT_MEM_QRENEW_ARRAY definition. * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use cast. * src/base/ftobjs.c: Add warning disabling pragma for MSVC while including `md5.c'. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add cast. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts. (tt_sbit_decoder_load_bitmap): Beautification. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize variables (earlier). * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants where appropriate. * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
Werner Lemberg 8d8508e4 2013-06-04T13:09:01 Missed some cppcheck items.
Werner Lemberg dc624ca4 2013-06-04T10:30:48 Apply fixes for cppcheck nitpicks. http://cppcheck.sourceforge.net/ Note that the current version heavily chokes on FreeType, delivering even wrong results. I will report those issues to the cppcheck team so that a newer version gives improved results hopefully. */* Improve variable scopes. */* Remove redundant initializations which get overwritten. * src/base/ftmac.c ,builds/mac/ftmac.c (count_faces_scalable): Remove unused variable. * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero. * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate): Remove functionless code. * src/tools/ftrandom.c (main): Fix memory leak.
Behdad Esfahbod 760d342d 2013-05-29T11:36:18 Add support for color embedded bitmaps (eg. color emoji). A new load flag, FT_LOAD_COLOR, makes FreeType load color embedded-bitmaps, following this draft specification https://color-emoji.googlecode.com/git/specification/v1.html which defines two new SFNT tables, `CBDT' and `CBLC' (named and modeled after `EBDT' and `EBLC', respectively). The color bitmaps are stored in the new FT_PIXEL_MODE_BGRA format to represent BGRA pre-multiplied sRGB images. If PNG support is available, PNG color images as defined in the same proposed specification are supported also. Note that color bitmaps are converted to grayscale if client didn't ask for color. * builds/unix/configure.raw: Search for libpng. Add `--without-png' option. * devel/ftoption.h, include/freetype/config/ftoption.h (FT_CONFIG_OPTION_USE_PNG): New macro. * include/freetype/freetype.h (FT_LOAD_COLOR): New load flag. * include/freetype/ftimage.h (FT_Pixel_Mode): Add `FT_PIXEL_MODE_BGRA'. * include/freetype/tttags.h (TTAG_CBDT, TTAG_CBLC): New tags. * src/base/ftbitmap.c (FT_Bitmap_Embolden): Updated. (ft_gray_for_premultiplied_srgb_bgra): New function. (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_BGRA. * src/sfnt/pngshim.c, src/sfnt/pngshim.h: New files. * src/sfnt/sfnt.c: Include `pngshim.c'. * src/sfnt/ttsbit.c: Include FT_BITMAP_H and `pngshim.h' (tt_face_load_eblc): Load `CBLC'. (tt_sbit_decoder_init): Load `CBDT'. (tt_sbit_decoder_alloc_bitmap): Pass load flags to select between color and grayscale bitmaps. Set `num_grays'. This is used by `ftview' to choose the blending algorithm. (tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound, tt_sbit_decoder_load_image): Pass load flag. s/write/pwrite/. Don't call `tt_sbit_decoder_alloc_bitmap'. Updated. (tt_sbit_decoder_load_png) [FT_CONFIG_OPTION_USE_PNG]: New function. (tt_sbit_decoder_load_bitmap): Pass load flag. Handle new glyph formats 17, 18, and 19. Call `tt_sbit_decoder_alloc_bitmap'. Flatten color bitmaps if necessary. (tt_face_load_sbit_image): Updated. * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `pngshim.c'. * docs/CHANGES: Updated.
Brian Nixon 8d6025c8 2013-05-13T09:06:42 Fix Savannah bug #38970. * src/base/ftdebug.c, builds/win32/ftdebug.c, builds/wince/ftdebug.c, builds/amiga/src/base/ftdebug.c (ft_debug_init): Don't read past the environment variable FT2_DEBUG.
Werner Lemberg b112fa41 2013-05-12T07:29:04 Fix Savannah bug #38967. * src/base/ftcalc.c (FT_DivFix) [FT_LONG64]: Fix cast.
Werner Lemberg d51ac9c7 2013-05-12T06:00:27 Fix Savannah bug #38968. * include/freetype/ftmodapi.h: Add `FT_EXPORT' to FT_Property_{Set,Get}. * src/base/ftobjs.c: Add `FT_EXPORT_DEF' to FT_Property_{Set,Get}.
Werner Lemberg f6aa089f 2013-05-10T07:58:47 */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.
Werner Lemberg dd192ef0 2013-05-05T16:13:01 Fix compilation with C++. * src/base/md5.c (body): Use proper cast.
Werner Lemberg d135e27c 2013-05-05T10:44:21 Fix 64bit compilation issues. * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef `FT_Int64' here. * src/base/ftcalc.c: Remove typedef of `FT_Int64'. (FT_DivFix): Fix cast. * src/base/fttrigon.c: Remove typedef of `FT_Int64'.
Werner Lemberg e6e83627 2013-05-04T18:57:56 Fix clang fixes. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate): Use correct types. * src/cff/cf2intrp.c (cf2_interpT2CharString) <default>: Force unsigned for computations. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Ditto. * src/cff/cffparse.c (cff_parse_integer): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
Werner Lemberg 94152819 2013-05-04T16:40:12 More fixes for clang's `sanitize' feature. * src/base/ftcalc.c (FT_DivFix): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate, FT_Vector_Length, FT_Vector_Polarize): Ditto. * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify. * src/cff/cffload.c (cff_subfont_load): Fix constant. * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed, cff_parse_fixed_dynamic): Use unsigned values for computations which use the left shift operator and convert to signed as the last step. * src/cid/cidload.c (cid_get_offset): Ditto. * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto. * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto.
Werner Lemberg 138068fd 2013-05-04T15:26:24 Formatting.
Werner Lemberg 2dc26621 2013-04-12T20:11:38 Add output bitmap checksums. Use `FT2_DEBUG=bitmap:3' for tracing. * src/base/md5.c, src/base/md5.h: New files, taken from http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 * include/freetype/internal/fttrace.h: Add `bitmap'. * src/base/ftobjs.c [FT_DEBUG_LEVEL_TRACE]: Include `md5.c' (FT_Render_Glyph_Internal) [FT_DEBUG_LEVEL_TRACE]: For tracing, convert resulting bitmap to a uniform format and compute a checksum. Use `bitmap' category for the tracing message. * src/base/rules.mk (BASE_H): Updated. * docs/LICENSE.TXT: Updated.
Werner Lemberg b114b7c0 2013-03-17T22:42:07 Fix Savannah bug #38538. * builds/amiga/src/base/ftdebug.c, builds/win32/ftdebug.c, builds/wince/ftdebug.c (FT_Throw): Add function.
Werner Lemberg 5ea06ce0 2013-03-17T08:14:46 Whitespace.
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.
Werner Lemberg c58ce3be 2013-03-13T11:06:39 Introduce `FT_THROW' macro. The idea is to replace code like return FT_Err_Foo_Bar; or return CFF_Err_Foo_Bar; with return FT_THROW( Foo_Bar ); The FT_THROW macro has two functions: . It hides the module specific prefix. . In debug mode, it calls the empty function `FT_Throw' which can be thus used to set a breakpoint. * include/freetype/internal/ftdebug.h (FT_THROW): New macro. (FT_Throw): New prototype. * src/base/ftdebug.c (FT_Throw): New function.
Alexei Podtelezhnikov 2ba18ba1 2013-02-22T23:58:57 [base] Fix commit ab02d9e8. * src/base/ftbbox.c (BBox_Cubic_Check): Change scaling to msb of 22.
Alexei Podtelezhnikov f9434dba 2013-02-19T21:27:18 [base] New bisecting BBox_Cubic_Check (disabled). * src/base/ftbbox.c (BBox_Cubic_Check): New bisecting algorithm for extremum search built around simple condition that defines which half contains the extremum.
Werner Lemberg 30f1e6ca 2013-02-01T14:50:08 Fix Savannah bug #38221. This complements commit 83c0ebab. * src/base/ftcalc.c (FT_MulDiv_No_Round): Don't enclose with `TT_USE_BYTECODE_INTERPRETER'.
Alexei Podtelezhnikov fba917d0 2013-01-30T20:14:18 Improve comments.
Alexei Podtelezhnikov d56e544d 2013-01-28T22:29:51 Add an important comment. Thanks to Hin-Tak Leung for the analysis.
Alexei Podtelezhnikov ab02d9e8 2013-01-28T06:35:19 [base] Small optimization of BBox calculation. * src/base/ftbbox.c (BBox_Cubic_Check): Use FT_MSB function in scaling algorithm.
Alexei Podtelezhnikov 610ee58e 2013-01-25T23:33:00 [base] Fix broken emboldening at small sizes. * src/base/ftoutln.c (FT_Outline_EmboldenXY): Do not attempt to normalize zero-length vectors.
Werner Lemberg 817caa9f 2013-01-25T00:40:56 Fix `make multi' * src/base/ftoutln.c, src/base/fttrigon.c: Include FT_INTERNAL_CALC_H.
Werner Lemberg 4cd5fd46 2013-01-24T13:33:06 Remove trailing whitespace.
Werner Lemberg e9f330ad 2013-01-24T09:12:56 [base] Make `FT_Hypot' really internal. * include/freetype/fttrigon.h (FT_Hypot): Move to... * include/freetype/internal/ftcalc.h: This file. * src/base/fttrigon.c (FT_Hypot): Move to... * src/base/ftcalc.c: This file. Include FT_TRIGONOMETRY_H. * src/truetype/ttgload.c: Don't include FT_TRIGONOMETRY_H.
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.