src/sfnt


Log

Author Commit Date CI Message
Werner Lemberg c95b7652 2016-09-17T17:12:50 s/0/NULL/ for function pointers; comments, formatting.
Werner Lemberg e421a0bf 2016-09-10T08:02:30 [sfnt] Fix previous commit. Problems reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40 We now map the strike index right before accessing the physical data, not earlier. * src/sfnt/sfobjs.c (sfnt_load_face): Set `face->sbit_strike_map' after creating the map so that... * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): ... this function can be used before and after setting up `sbit_strike_map'. (tt_face_set_sbit_strike): Revert change. (tt_sbit_decoder_init, tt_face_load_sbix_image): Map strike index. * src/truetype/ttdriver.c (tt_size_select): Revert change.
Werner Lemberg d609b7c1 2016-09-09T22:11:07 [sfnt] Don't provide (completely) broken strike data. FreeType tries to sanitize strike header data; we now reject completely broken ones. * include/freetype/internal/tttypes.h (TT_FaceRec): New `sbit_strike_map' array pointer. * src/base/ftobjs.c (FT_Match_Size): Reject matches where either width or height would be zero. Add tracing message in case of error. * src/sfnt/sfobjs.c (sfnt_load_face): Populate `sbit_strike_map', only using (more or less) valid strike header data for FT_Face's `available_sizes' array. (sfnt_done_face): Updated. * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use `sbit_strike_map'. (tt_face_load_strike_metrics): Improve tracing. * src/truetype/ttdriver.c (tt_size_select): Use `sbit_strike_map'.
Werner Lemberg d8ef7266 2016-09-02T23:27:50 [sfnt] Avoid left shift of negative value (#48980). * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Use unsigned constant.
Werner Lemberg f3e71bab 2016-08-26T10:31:30 [sfnt] Cache offset and size to bitmap data table. This commit avoids `EBDT' and friends being looked up again and again while loading a single embedded bitmap. * include/freetype/internal/tttypes.h (TT_FaceRec) [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New fields `ebdt_start' and `ebdt_size'. * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Move table lookup to ... (tt_face_load_sbit): ... this function; also store the table size and offset.
Werner Lemberg 1034ff4a 2016-08-26T08:42:27 [sfnt] Comments.
Werner Lemberg 69ce9739 2016-08-25T19:49:52 [sfnt] Fix previous commit (#48901). * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Thinkos.
Werner Lemberg acd18798 2016-08-25T17:12:46 [sfnt] Speed up handling of invalid format 4 cmaps. * src/sfnt/ttcmap.c (tt_cmap4_next, tt_cmap4_char_map_binary): Add tests for `num_glyph' from `tt_cmap4_char_map_linear'.
Werner Lemberg 5224aae8 2016-08-10T19:47:29 [sfnt] Use correct type for `italicAngle' field (#48732). * src/sfnt/ttload.c (tt_face_load_post): Fix types.
Werner Lemberg 53059f92 2016-08-07T09:01:33 [sfnt] Fix `FT_Get_Advance' for bitmap strikes. `FT_Get_Advance' returns 0 for bitmap fonts. It first gets the advance value from the font table and then scales it by the `font->size->metrics->x_scale' field. But `FT_Select_Size' doesn't set that value for bitmap fonts and the advance gets scaled to zero. Taken from https://github.com/behdad/harfbuzz/issues/252 * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) <TT_SBIT_TABLE_TYPE_EBLC>: Set scale values.
Werner Lemberg fae4ec05 2016-07-29T06:43:32 [sfnt, truetype] Don't abort on invalid `maxComponentDepth'. Since 2016-05-16 we detect infinite recursion directly. * src/sfnt/ttload.c (tt_face_load_maxp): Don't adjust `maxComponentDepth'. * src/truetype/ttgload.c (load_truetype_glyph): Don't abort if `maxComponentDepth' is not valid. Instead, simply adjust its value and emit a tracing message.
Werner Lemberg ee3f36f6 2016-07-14T10:25:20 [sfnt] Fix `face_index' value in `FT_Face' for named instances. * src/sfnt/sfobjc.s (sfnt_init_face): Don't strip off higher 16bits.
Alexei Podtelezhnikov bbcb9779 2016-04-13T00:11:52 Typos.
Werner Lemberg 351fc4b4 2016-03-29T09:13:13 [pfr] Fix binary search (#47514). * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Handle border conditions correctly.
Werner Lemberg 32950391 2016-02-15T12:54:40 Whitespace.
Werner Lemberg 813aca51 2016-02-14T16:03:15 [cff] Make old CFF engine show MM CFFs (without variations). The new code only displays the first master in the font. * src/cff/cffgload.c (cff_decode_parse_charstrings): Add new parameter to allow function calls from dictionaries also. <cff_op_blend>: Partially implement it. Update all callers. * src/cff/cffgload.h: Updated. * src/cff/cffparse.c (cff_parser_init): Add new parameter to pass the number of Multiple Master designs. Update all callers. (cff_parse_multiple_master): New function to rudimentarily parse operator. (cff_parser_run): Handle `T2' operator. * src/cff/cffparse.h: Updated. (CFF_ParserRec): Add `num_designs' field. * src/cff/cffload.c: Updated. * src/cff/cfftoken.h: Handle `MultipleMaster' operator. * src/cff/cfftypes.h (CFF_FontRecDictRec): Add `num_designs' field. * src/sfnt/sfobjs.c (sfnt_init_face): Don't handle `fvar' table for MM CFFs.
Werner Lemberg 9adeab64 2016-01-13T11:54:10 Update copyright year.
Werner Lemberg 37412ff9 2016-01-12T21:37:13 Don't use macro names that contain `__' [1/2]. Such macro names are reserved for both C and C++. */*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
Behdad Esfahbod abb33121 2015-11-08T10:00:34 [sfnt] Accept version 3 of `EBLC' and `CBLC' tables also. * src/sfnt/ttsbit.c (tt_face_load_sbit): Implement it.
Werner Lemberg 0f0a6bb8 2015-11-05T13:48:11 [sfnt] Ignore embedded bitmaps with zero size (#46379). * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Implement it.
Werner Lemberg aae88087 2015-11-03T17:30:36 [sfnt] Protect against zero-size bitmaps (#46345). * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Check `glyph_size'.
Werner Lemberg 40cb1dc3 2015-10-31T19:08:27 Formatting.
Werner Lemberg 57cbb8c1 2015-10-31T18:47:26 [sfnt] Fix cmap 14 validation (#46346). * src/sfnt/ttcmap.c (tt_cmap14_validate): Check limit before accessing `numRanges' and `numMappings'. Fix size check for non-default UVS table.
Werner Lemberg 009cc150 2015-10-31T17:52:56 [sfnt] Handle infinite recursion in bitmap strikes (#46344). * src/sfnt/ttsbit.c (TT_SBitDecoder_LoadFunc, tt_sbit_decoder_load_bitmap, tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_png): Add argument for recursion depth. (tt_sbit_decoder_load_compound): Add argument for recursion depth. Increase recursion counter for recursive call. (tt_sbit_decoder_load_image): Add argument for recursion depth. Check recurse depth. (tt_face_load_sbit_image): Updated.
Werner Lemberg 4188deac 2015-10-30T08:07:56 Comments.
Werner Lemberg 07f27e1e 2015-10-24T15:22:13 Thinkos and omissions.
Werner Lemberg 6f09011f 2015-10-24T10:10:22 [sfnt] Sanitize bitmap strike glyph height. Problem reported by Nikolay Sivov <bunglehead@gmail.com>. * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Avoid zero value for `metrics->height' by applying some heuristics.
Werner Lemberg e93d326c 2015-10-22T10:17:20 [sfnt, type42] Fix clang compiler warnings. * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `offset'. * src/type42/t42parse.c (t42_parse_sfnts): Use proper cast.
Werner Lemberg e6593389 2015-10-21T08:04:29 [sfnt] Avoid unnecessarily large allocation for WOFFs (#46257). * src/sfnt/sfobjs.c (woff_open_font): Use WOFF's `totalSfntSize' only after thorough checks. Add tracing messages.
Werner Lemberg 4f7f6f6e 2015-10-11T07:55:25 [sfnt] Improve extraction of number of named instances. * src/sfnt/sfobjs.c (sfnt_init_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Check number of instances against `fvar' table size.
Werner Lemberg 8de39a79 2015-10-10T13:34:11 [sfnt] Fix infinite loops with broken cmaps (#46167). * src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next): Take care of border condidions (i.e., if the loops exit naturally).
Werner Lemberg 983b00ec 2015-10-08T18:44:45 [sfnt] Fix some signed overflows (#46149). * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) <TT_SBIT_TABLE_TYPE_SBIX>: Use `FT_MulDiv'.
Werner Lemberg 90e437e3 2015-10-01T20:00:27 [sfnt] Make `tt_cmap4_char_map_linear' more robust (#46078). * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Take care of border conditions (i.e., if the loop exits naturally).
Werner Lemberg 5f8f44d2 2015-10-01T14:16:03 [sfnt] Make `tt_cmap4_char_map_linear' faster (#46078). * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Use inner loop to reject too large glyph indices.
Werner Lemberg 2ff83a5c 2015-09-30T14:44:29 [sfnt] Rewrite `tt_cmap4_char_map_linear' (#46078). * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Add code to better skip invalid segments. If searching the next character, provide a more efficient logic to speed up the code.
Werner Lemberg 5339c75e 2015-09-24T13:39:44 [sfnt] Better checks for invalid cmaps (2/2) (#46019). While the current code in `FT_Get_Next_Char' correctly rejects out-of-bounds glyph indices, it can be extremely slow for malformed cmaps that use 32bit values. This commit tries to improve that. * src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next, tt_cmap12_char_map_binary, tt_cmap13_next, tt_cmap13_char_map_binary): Reject glyph indices larger than or equal to the number of glyphs.
Werner Lemberg c409eb18 2015-09-24T12:39:38 [base, sfnt] Better checks for invalid cmaps (1/2). * src/base/ftobjs.c (FT_Get_Char_Index): Don't return out-of-bounds glyph indices. (FT_Get_First_Char): Updated. * src/sfnt/ttcmap.c (tt_cmap6_char_next): Don't return character codes greater than 0xFFFF. (tt_cmap8_char_index): Avoid integer overflow in computation of glyph index. (tt_cmap8_char_next): Avoid integer overflows in computation of both next character code and glyph index. (tt_cmap10_char_index): Fix unsigned integer logic. (tt_cmap10_char_next): Avoid integer overflow in computation of next character code. (tt_cmap12_next): Avoid integer overflows in computation of both next character code and glyph index. (tt_cmap12_char_map_binary): Ditto. (tt_cmap12_char_next): Simplify. (tt_cmap13_char_map_binary): Avoid integer overflow in computation of next character code. (tt_cmap13_char_next): Simplify.
Werner Lemberg cbdf13e5 2015-09-24T12:14:38 Formatting, documentation improvements.
Werner Lemberg 730b6d74 2015-09-19T12:41:12 [sfnt] Improve handling of invalid SFNT table entries (#45987). This patch fixes weaknesses in function `tt_face_load_font_dir'. - It incorrectly assumed that valid tables are always at the beginning. As a consequence, some valid tables after invalid entries (which are ignored) were never seen. - Duplicate table entries (this is, having the same tag) were not rejected. - The number of valid tables was sometimes too large, leading to access of invalid tables. * src/sfnt/ttload.c (check_table_dir): Add argument to return number of valid tables. Add another tracing message. (tt_face_load_font_dir): Only allocate table array for valid entries as returned by `check_table_dir'. Reject duplicate tables and adjust number of valid tables accordingly.
Werner Lemberg 14d6b5d7 2015-08-13T15:22:17 [truetype] Introduce named instance access to GX fonts. For functions querying a face, bits 16-30 of the face index can hold the named instance index if we have a GX font. The indices start with value 1; value 0 indicates font access without GX variation data. * include/freetype/freetype.h (FT_FaceRec): Update documentation. * include/freetype/internal/sfnt.h: Ditto. * src/sfnt/sfobjs.c (sfnt_init_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Get number of named instances and do argument checks. (sfnt_load_face): Updated. * src/truetype/ttobjs.c (tt_face_init) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Use named instance, overwriting the style name. * src/base/ftobjs.c (open_face_from_buffer, open_face_PS_from_sfnt_stream): Updated. * src/bdf/bdfdrivr.c (BDF_Face_Init): Updated. * src/cff/cffload.c (cff_font_load): Updated. * src/cff/cffobjs.c (cff_face_init): Make function exit early for pure CFF fonts if `font_index < 0'. Updated. * src/cid/cidobjs.c (cid_face_init): Updated. * src/pcf/pcfdrivr.c (PCF_Face_Init): Updated. * src/pfr/pfrobjs.c (pfr_face_init): Updated. * src/type1/t1objs.c (T1_Face_Init): Updated. * src/type42/t42objs.c (T42_Face_Init): Updated. * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init): Updated. * docs/CHANGES: Updated.
Werner Lemberg 6343ba22 2015-08-01T07:53:48 Fix some bugs found by clang's `-fsanitize=undefined' (#45661). * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Only accept positive values from header. Check overflow. * src/base/ftoutln.c (SCALED): Correctly handle left-shift of negative values. * src/bdf/bdf.h (_bdf_glyph_modified, _bdf_set_glyph_modified, _bdf_clear_glyph_modified): Use unsigned long constant. * src/bdf/bdfdrivr.c (BDF_Size_Select, BDF_Glyph_Load): Don't left-shift values that can be negative. * src/pcf/pcfdrivr.c (PCF_Size_Select, PCF_Glyph_Load): Don't left-shift values that can be negative. * src/raster/ftraster.c (SCALED): Correctly handle left-shift of negative values. * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Don't left-shift values that can be negative. * src/truetype/ttgload.c (TT_Load_Composite_Glyph, compute_glyph_metrics, load_sbit_image): Don't left-shift values that can be negative.
Werner Lemberg f9be567f 2015-07-09T15:10:31 Better support of user-supplied C++ namespaces. See http://lists.nongnu.org/archive/html/freetype-devel/2015-07/msg00008.html for a rationale. * src/autofit/afpic.h, src/base/basepic.h, src/cff/cffpic.h, src/pshinter/pshpic.h, src/psnames/pspic.h, src/raster/rastpic.h, src/sfnt/sfntpic.h, src/smooth/ftspic.h, src/truetype/ttpic.h (FT_BEGIN_HEADER, FT_END_HEADER): Move macro calls to not enclose header files that contain FT_{BEGIN,END}_HEADER macros by themselves. * src/autofit/aftypes.h [FT_DEBUG_AUTOFIT]: Include FT_CONFIG_STANDARD_LIBRARY_H earlier. * src/truetype/ttpic.h: Include FT_INTERNL_PIC_H.
Werner Lemberg 1cdac10d 2015-07-07T14:04:44 [sfnt] Make `tt_face_get_name' member of the SFNT interface. * include/freetype/internal/sfnt.h (TT_Get_Name_Func): New prototype. (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): New member `get_name'. * src/sfnt/sfdriver.c (sfnt_interface): Updated. * src/sfnt/sfobjs.c (tt_face_get_name): Tag it with `LOCAL_DEF'. * src/sfnt/sfobjs.h: Add prototype for it.
Werner Lemberg 31d97df9 2015-06-21T19:12:12 Make Jam support work again. This is just very basic stuff and just a little bit tested on GNU/Linux only. I won't delve into this since I'm not a Jam user. * Jamfile: Call `HDRMACRO' for `ftserv.h' also. (DEFINES): Replace with... (CCFLAGS): ... this. * src/Jamfile: Don't call `HDRMACRO' for `internal.h'; this is already handled in the top-level Jamfile. * src/autofit/Jamfile (DEFINES): Replace with... (CCFLAGS): ... this. (_sources): Add missing files. * src/cache/Jamfile: Don't call `HDRMACRO' for `ftcache.h'; it no longer contains macro header definitions. * src/base/Jamfile, src/cff/Jamfile, src/sfnt/Jamfile, src/truetype/Jamfile (_sources): Add missing files.
Werner Lemberg 1a147ac0 2015-06-16T10:20:07 Fix Savannah bug #45326. * src/sfnt/sfntpic.h (SFNT_SERVICES_GET): Remove duplicate definitions.
Alexei Podtelezhnikov 792db0b9 2015-04-15T23:20:23 [cff,cid,pfr,sfnt,winfonts] NULL.
Werner Lemberg eee7d8ba 2015-03-10T11:15:15 [base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'. * include/ftbitmap.h, src/base/ftbitmap.c: Implement it. Update all callers. * docs/CHANGES: Updated.
Werner Lemberg 493cc037 2015-03-06T05:38:31 * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning. Found by Alexei.
Werner Lemberg 851e8151 2015-03-01T19:27:09 Various compiler warning fixes for `make multi'. * src/autofit/afcjk.c (af_cjk_hints_compute_blue_edges), src/autofit/aflatin.c (af_latin_hint_compute_blue_edges, af_latin_hint_edges), src/autofit/aflatin2.c (af_latin2_hints_compute_blue_edges, af_latin2_hint_edges): Declare as `static'. * src/cache/ftccmap.c (FTC_CMAP_QUERY_HASH, FTC_CMAP_NODE_HASH): Removed. Unused. * src/cache/ftcimage.c: Include FT_INTERNAL_OBJECTS_H. * src/cache/ftcmanag.c (FTC_LRU_GET_MANAGER): Removed. Unused. * src/cff/cf2intrp.c: Include `cf2intrp.h'. * src/cff/cffdrivr.c (PAIR_TAG): Removed. Unused. * src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed. Unused. * src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'. * src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX): Removed. Unused. * src/raster/ftraster.c (Render_Glyph): Declare as `static'. * src/sfnt/ttpost.c (load_format_20): Fix signedness warning. * src/truetype/ttdriver.c (PAIR_TAG): Removed. Unused. * src/truetype/ttsubpix.c (is_member_of_family_class, is_member_of_style_class): Declare as `static'. * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Declare as `static'. * src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): Declare as `static'. (T1_FIELD_COUNT): Removed. Unused. * src/type1/t1parse.h (T1_Done_Table): Removed. Unused. * src/type42/t42parse.c (T1_Done_Table): Removed. Unused.
Werner Lemberg b0ebcdc8 2015-02-22T20:42:49 * src/sfnt/ttpost.c (load_format_20): Fix error tracing message. Bug introduced 6 commits earlier.
Werner Lemberg 01f0842e 2015-02-22T12:03:28 [sfnt] Signedness fixes. * src/sfnt/pngshim.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap.c, src/sfnt/ttkern.c, src/sfnt/ttload.c, src/sfnt/ttpost.c, src/sfnt/ttsbit.c: Apply. * src/sfnt/sfdriver.c: Apply. (sfnt_get_ps_name): Simplify.
Werner Lemberg 92359bd8 2015-02-07T09:47:23 [sfnt] Fix Savannah bug #44184. * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir): No longer reject `htmx' and `vmtx' tables with invalid length but sanitize them.
Werner Lemberg f57fc59e 2015-01-17T20:41:43 Run `src/tools/update-copyright'.
Werner Lemberg f796cf6c 2015-01-17T20:11:10 Normalize copyright notice format.
Werner Lemberg 36d03c9f 2015-01-12T11:26:30 Fix Savannah bug #43976. Assure that FreeType's internal include directories are found before `CPPFLAGS' (which might be set by the user in the environment), and `CPPFLAGS' before `CFLAGS'. * builds/freetype.mk (FT_CFLAGS): Don't add `INCLUDE_FLAGS'. (FT_COMPILE): Make this a special variable for compiling only the files handled in `freetype.mk'. (.c.$O): Removed, unused. * src/*/rules.mk (*_COMPILE): Fix order of include directories.
Werner Lemberg 5018477f 2014-12-07T08:17:12 Minor.
Werner Lemberg ed6a9df0 2014-12-06T23:28:58 Whitespace.
Werner Lemberg 16188ebf 2014-12-03T10:18:34 FT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality. All public FreeType enumeration and flag values are uppercase... * include/tttables.h (FT_Sfnt_Tag): Implement it. For backwards compatilibity, retain the old values as macros. * src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c (get_sfnt_table): Updated.
Werner Lemberg ef439fd2 2014-11-25T08:14:15 [Savannah bug #43682] Change some signatures to `void' return type. * include/internal/pshints.h (PSH_Globals_SetScaleFunc), include/internal/sfnt.h (TT_Get_Metrics_Func), src/pshinter/pshglob.c (psh_globals_set_scale), src/pshinter/pshrec.c (ps_hints_init), src/sfnt/ttmtx.c (tt_face_get_metrics), src/truetype/ttinterp.c (TT_Goto_CodeRange, TT_Set_CodeRange, TT_Clear_CodeRange, TT_Done_Context, TT_Save_Context): Do it. * src/pshinter/pshglob.h, src/pshinter/pshrec.h, src/sfnt/ttmtx.h, src/truetype/ttgload.c (TT_Hint_Glyph), src/truetype/ttinterp.c (TT_Run_Context), src/truetype/ttinterp.h, src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Updated.
Werner Lemberg 6889f7b7 2014-11-24T17:16:08 Remove all code related to FT_MAX_CHARMAP_CACHEABLE. This is no longer used. * src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c, src/sfnt/ttcmap.c: Do it.
Werner Lemberg f0292bb9 2014-11-24T10:51:21 [sfnt] Fix Savannah bug #43680. This adds an additional constraint to make the fix from 2013-01-25 really work. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image) <index_format==4>: Check `p' before `num_glyphs'.
Werner Lemberg f70d9342 2014-11-24T09:31:32 [sfnt] Fix Savannah bug #43672. * src/sfnt/ttkern.c (tt_face_load_kern): Use correct value for minimum table length test.
Werner Lemberg 9bd20b73 2014-11-22T06:24:45 [sfnt] Fix Savannah bug #43656. * src/sfnt/ttcmap.c (tt_cmap4_validate): Fix order of validity tests.
Werner Lemberg 23c093fc 2014-11-21T08:41:39 Minor.
Werner Lemberg b3500af7 2014-11-19T21:28:21 Change some fields in `FT_Bitmap' to unsigned type. This doesn't break ABI. * include/ftimage.h (FT_Bitmap): Make `rows', `width', `num_grays', `pixel_mode', and `palette_mode' unsigned types. * src/base/ftbitmap.c: Updated. (FT_Bitmap_Copy): Fix casts. * src/cache/ftcsbits.c, src/raster/ftraster.c, src/sfnt/pngshim.c: Updated.
Werner Lemberg 54abd228 2014-11-15T09:05:22 [sfnt] Fix Savannah bug #43597. * src/sfnt/pngshim.c (Load_SBit_Png): Protect against too large bitmaps.
Werner Lemberg 257c270b 2014-11-12T21:42:13 [sfnt] Fix Savannah bug #43591. * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Protect against addition and multiplication overflow.
Werner Lemberg 677ddf4f 2014-11-12T21:26:44 [sfnt] Fix Savannah bug #43590. * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir): Protect against addition overflow.
Werner Lemberg f46add13 2014-11-12T21:06:08 [sfnt] Fix Savannah bug #43589. * src/sfnt/sfobjs.c (woff_open_font): Protect against addition overflow.
Werner Lemberg 602040b1 2014-11-12T20:51:20 [sfnt] Fix Savannah bug #43588. * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate, tt_cmap13_validate, tt_cmap14_validate): Protect against overflow in additions and multiplications.
Werner Lemberg cc7bb80b 2014-10-20T08:35:50 [sbit] Minor fixes. * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]: Accept overlay format also, but emit warning message in that case. (tt_sbit_decoder_load_metrics): Add missing newline to error message. (tt_sbit_load_sbix_image): Add `rgbl' graphic type (as used on iOS 7.1) to the list of unsupported formats.
Werner Lemberg 03987bfd 2014-10-16T07:19:46 A better fix for Savannah bug #43392. Suggested by Doug Felt <dougfelt@gmail.com>. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set `vertAdvance' to zero... * src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default value for `vertAdvance' based on `linearVertAdvance' in case `vertAdvance' is zero. Note that the previous computed ad-hoc value for `linearVertAdvance' was apparently not tested in a real-life situation.
Werner Lemberg 1ca5fa15 2014-10-12T08:31:32 [sfnt] Fix Savannah bug #43392. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let vertical metrics uninitialized.
Werner Lemberg 3897556a 2014-06-27T06:55:56 Fix Apple standard glyph names. * src/sfnt/ttpost.c (tt_post_default_names): Synchronize with `tools/glnames.py' Problem reported by Adam Twardoch <adam@fontlab.com>.
Werner Lemberg d708658c 2014-06-13T15:56:11 And another warning from Wojciech.
Werner Lemberg e5c0fff5 2014-06-13T14:01:20 Fix more compiler warnings. Reported by Wojciech Mamrak <wmamrak@gmail.com>. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage): Make integer constant unsigned. * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) <TT_SBIT_TABLE_TYPE_SBIX>: Fix types. (tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper casts.
Werner Lemberg 6497b9c5 2014-06-13T09:28:00 Fix compiler warnings. Reported by Wojciech Mamrak <wmamrak@gmail.com>. * src/autofit/afglobal.c (af_face_globals_compute_style_coverage), src/autofit/afmodule.c (af_property_set): Fix `signed' vs. `unsigned' issues. * src/autofit/aflatin.c (af_latin_metrics_init_blues): Make compiler happy. * src/base/ftlcdfil.c (_ft_lcd_filter_fir): Use only four elements for `fir'. Fix `signed' vs. `unsigned' issues. * src/sfnt/sfobjs.c (WRITE_BYTE): Removed, unused. (WRITE_USHORT, WRITE_ULONG): Add proper casts. * src/truetype/ttgload.c (TT_Get_VMetrics): Add proper casts. * src/truetype/ttinterp.c (Ins_DELTAP): Add proper casts for `B1' and `B2'.
Werner Lemberg d9b4470e 2014-04-22T07:33:07 * src/sfnt/pngshim.c (error_callback): s/longjmp/ft_longjmp/.
Werner Lemberg f8555b5d 2014-04-03T05:45:38 Don't require `gzip' module for `sfnt'. Reported by Preet <prismatic.project@gmail.com>. * src/sfnt/sfobjs.c (woff_open_font): Guard use of FT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB.
Werner Lemberg 1a69dc7c 2014-03-09T06:06:58 * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning.
Werner Lemberg a2b5f66b 2014-02-26T19:50:18 [sfnt] Fix Savannah bug #41696. * src/sfnt/ttcmap.c (tt_cmap0_validate, tt_cmap2_validate, tt_cmap4_validate, tt_cmap14_validate): Fix limit tests.
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.
Eugen Sawin a8ceae40 2014-02-08T06:30:06 Fix Savannah bug #41507. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) [!FT_CONFIG_OPTION_USE_PNG] <17, 17, 19>: Fix error handling.
Werner Lemberg 752f3912 2014-01-23T09:14:25 Fix Savannah bug #41310. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) <glyph_format==5>: Don't check metrics, which this format doesn't have. This is another correction to the commit from 2013-11-21.
Werner Lemberg 64b395cc 2013-12-04T06:18:56 [sfnt] Fix handling of embedded bitmap strikes. This corrects the commit from 2013-11-21. Problem reported by Andrey Panov <panov@canopus.iacp.dvo.ru>. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Fix logic to detect excessive bytes for bit-aligned bitmaps.
Werner Lemberg a44b784b 2013-12-02T09:52:38 Formatting.
Werner Lemberg 9326cafa 2013-11-23T23:59:25 * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Typo.
Werner Lemberg 8af2a1cd 2013-11-21T13:13:12 [truetype] Typo. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/sfnt/sfobjs.c (sfnt_load_face): Return correct `bsize->width' value if the font lacks an `OS/2' table.
Werner Lemberg 427b1768 2013-11-21T13:10:56 [truetype] Improve handling of buggy embedded bitmap strikes. We are now able to successfully load `AppleMyoungJo.ttf'. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph format.
Werner Lemberg bc25de66 2013-11-16T07:52:20 [sfnt] Fix `OS/2' table version 5 support. We now follow the `official' announcement from Microsoft (on the OpenType mailing list, which unfortunately hasn't a public archive). * include/freetype/tttables.h (TT_OS2): s/usLowerPointSize/usLowerOpticalPointSize/, s/usUpperPointSize/usUpperOpticalPointSize/. * src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct default values.
Werner Lemberg ee510510 2013-10-27T07:25:35 [sfnt] Implement support for `OS/2' table version 5. See http://typedrawers.com/discussion/470/new-microsoft-size-specific-design-selection-mechanism for the announcement. * include/freetype/tttables.h (TT_OS2): Add fields `usLowerPointSize' and `usUpperPointSize'. Since FreeType returns this structure only as a pointer through `FT_Get_Sfnt_Table', there shouldn't be any ABI problems. * src/sfnt/ttload.c (tt_face_load_os2): Implement it. * docs/CHANGES: Updated.
Darrell Bellert 01af71d4 2013-10-02T22:04:07 * src/sfnt/ttload.c (tt_face_load_pclt): Fix `pclt_fields'.
Werner Lemberg 85a7fdf3 2013-08-29T21:03:05 [sfnt] Fix frame access while reading WOFF table directory. * src/sfnt/sfobjs.c (woff_open_font): Using single memory frame while reading the directory entries for the whole loop.
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 c799dd67 2013-08-27T21:46:03 * src/sfnt/ttload.c (tt_face_load_font_dir): Fix sign typos.
Werner Lemberg 74a9b670 2013-08-02T14:53:32 [sfnt] Fix compilation with g++. * src/sfnt/pngshim.c (error_callback, read_data_from_FT_stream): Use cast. (Load_SBit_Png): Pacify compiler.
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.
Behdad Esfahbod 21c32b08 2013-07-25T21:53:18 Add FT_FACE_FLAG_COLOR and FT_HAS_COLOR. Also disambiguate Google's color bitmap tables. * include/freetype/freetype.h (FT_FACE_FLAG_COLOR, FT_HAS_COLOR): New macros. * include/freetype/internal/tttypes.h (TT_SbitTableType): Add TT_SBIT_TABLE_TYPE_CBLC. * src/sfnt/sfobjs.c (sfnt_load_face): Handle FT_FACE_FLAG_COLOR. * src/sfnt/ttsbit.c (tt_face_load_sbit, tt_face_load_strike_metrics, tt_face_load_sbit_image): Handle TT_SBIT_TABLE_TYPE_CBLC.
suzuki toshiya b4725cb7 2013-07-24T14:25:39 [sfnt] Fix for `make multi' target. * src/sfnt/pngshim.c (Load_SBit_Png): Use FT_LOCAL_DEF().
Behdad Esfahbod ff269528 2013-07-20T08:02:39 [sfnt] Fix `sbix' table version handling. * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]: USHORT version numbers are to be considered as `minor'.