src/sfnt


Log

Author Commit Date CI Message
Nikolaus Waxweiler f72b0074 2019-02-02T15:45:31 [sfnt] Use typo metrics if OS/2 fsSelection USE_TYPO_METRICS bit is set. If the OS/2 table exists and fsSelection bit 7 (USE_TYPO_METRICS) is set, use the sTypo* set of values to compute the FT_Face's ascender, descender and height. Otherwise, fall back to old behavior. * src/sfnt/sfobjs.c (sfnt_load_face): Implement.
Werner Lemberg f686ad46 2019-01-22T20:31:44 Update copyright years.
John Tytgat f61f49fe 2019-01-18T13:25:23 [sfnt] Handle TT fonts having two PostScript font names (#55471). * src/sfnt/sfdriver.c (sfnt_get_name_id): Prefer English over any other language found for PostScript font names.
Alexei Podtelezhnikov 3e8ec291 2018-10-26T23:23:48 [sfnt] Make `head' timestamps unsigned. It's been more than 2^31 seconds since 1904. * include/freetype/tttables.h (TT_Header): Change field types. * src/sfnt/ttload.c (tt_face_load_generic_header): Updated.
Werner Lemberg 912e174c 2018-10-07T09:28:52 A missing Unicode cmap is not a fatal error. This is a follow-up to the previous commit. * src/cff/cffobjs.c (cff_face_init), src/sfnt/sfobjs.c (sfnt_load_face), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Implement it.
Werner Lemberg 885f5b0b 2018-10-07T09:03:05 Fix handling of FT_CONFIG_OPTION_ADOBE_GLYPH_LIST (#54794). * src/cff/cffcmap.c (cff_cmap_unicode_init), src/psaux/t1cmap.c (t1_cmap_unicode_init), src/sfnt/ttcmap.c (tt_cmap_unicode_init): Check `unicodes_init' field.
Werner Lemberg de0aabcd 2018-09-15T06:14:18 [sfnt] Comment fix.
Werner Lemberg 7665914c 2018-09-13T08:58:49 * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Fix last commit.
Werner Lemberg a5818ed1 2018-09-13T08:46:44 * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Check `result'. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10316
John Tytgat 6b53300b 2018-09-12T08:08:09 [sfnt] Better PS name handling (#54629). * src/sfnt/sfdriver (IS_WIN, IS_APPLE): Omit language ID checks. (get_win_string, get_apple_string): Return NULL when the PostScript font name characters is not according to specification. (get_win_string): Make trace output work if the high byte if non-zero. (sfnt_get_var_ps_name, sfnt_get_ps_name): Previously we preferred Win PS name (when there is also an Apple PS name); change this into a fallback to Apple PS name in case the Win PS name is invalid.
Werner Lemberg fea435fb 2018-09-09T09:46:29 [sfnt] Comment improvement.
Werner Lemberg 76a52465 2018-09-03T09:08:47 */*: s/PSNames/psnames/. Only tracing messages are affected.
Werner Lemberg 475f6d25 2018-09-03T09:00:58 [sfnt] Fix heap buffer overflow in CPAL handling. * src/sfnt/ttcpal.c (tt_face_palette_set): Fix boundary test. (tt_face_load_cpal): Updated.
Werner Lemberg 0a33b44e 2018-08-21T10:52:14 * src/sfnt/ttcpal.c (tt_face_load_cpal): Add missing safety check. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9981
Werner Lemberg a0dd16fb 2018-08-15T18:13:17 Don't use `trace_' prefix for FT_COMPONENT arguments. * include/freetype/internal/ftdebug.h (FT_TRACE_COMP, FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix. (FT_TRACE): Use `FT_TRACE_COMP'. */* (FT_COMPONENT): Updated.
Alexei Podtelezhnikov 88c0e121 2018-08-10T21:24:40 * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Follow specs.
Ben Wagner 96b5e500 2018-08-10T22:24:26 * src/sfnt/sfobjs.c (sfnt_done_face): Fix memory leak (#54435).
Werner Lemberg 8ed53468 2018-07-25T22:07:22 [psaux, type1] Trace PostScript dictionaries and other things. The tracing of /Encoding, /Subrs, and /Charstrings is rudimentary right now. * src/psaux/psobjs.c (ps_parser_load_field, ps_parser_load_field_table): Add tracing calls. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make tracing output more compact. * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances): Add tracing messages. * src/type1/t1load.c (parse_blend_axis_types, parse_blend_design_positions, parse_blend_design_map, parse_weight_vector, t1_load_keyword, t1_parse_font_matrix, parse_encoding, parse_subrs, parse_charstrings, T1_Open_Face): Add tracing calls. * src/type1/t1objs.c (T1_Face_Init): Add tracing call. * src/sfnt/sfobjs.c (sfnt_init_face): Make tracing message more verbose.
Armin Hasitzka fda356b7 2018-07-16T18:45:23 * include/freetype/internal/ftcalc.h: Add macros for handling harmless over-/underflowing `FT_Int' values. * src/sfnt/sfdriver.c (fixed2float): Fix negation of `(int)(-2147483648)'. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9423
Werner Lemberg 0767d536 2018-07-05T23:05:53 Adjust table size comparisons (#54242). * src/sfnt/ttcpal.c (tt_face_load_cpal): Implement it.
Werner Lemberg 29f05fd0 2018-07-04T11:49:47 Fix 32bit build warnings (#54239). * src/base/ftbitmap.c (FT_Bitmap_Blend): Add casts to avoid signed vs. unsigned comparisons. * srb/sfnt/ttcolr.c (tt_face_get_colr_layer): Ditto.
Werner Lemberg 7edc937f 2018-07-02T11:50:04 s/palette_types/palette_flags/. Suggested by Behdad.
Werner Lemberg 4e3b2473 2018-07-02T11:41:44 Make `FT_Get_Color_Glyph_Layer' return FT_Bool. * include/freetype/freetype.h, src/base/ftobjs.c (FT_Get_Color_Glyph_Layer, FT_Render_Glyph_Internal): Updated. * include/freetype/internal/sfnt.h (TT_Get_Colr_Layer_Func), src/sfnt/ttcolr.h, src/sfnt/ttcolr.c (tt_face_get_colr_layer): Updated.
Werner Lemberg 9027233f 2018-06-21T00:21:09 s/FT_PALETTE_USABLE_WITH_/FT_PALETTE_FOR_/. * include/freetype/ftcolor.h, include/freetype/internal/sfnt.h, src/sfnt/ttcolr.c: Do it.
Werner Lemberg a6b77ba2 2018-06-19T20:09:31 [sfnt] Fix CPAL heap buffer overflow. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8968 * src/sfnt/ttcpal.c (tt_face_load_cpal): Guard CPAL version 1 offsets.
Werner Lemberg 7915fd51 2018-06-19T07:15:21 Doh. Don't use CPAL or COLR data if tables are missing. Reported by Alexei. * src/sfnt/ttcolr.c (tt_face_get_colr_layer): Return immediately if `colr' is NULL. * src/sfnt/ttcpal.c (tt_face_palette_set): Return immediately, if `cpal' is NULL.
Werner Lemberg 9960e7be 2018-06-16T22:16:03 [sfnt] Fix color glyph layer loading. * src/sfnt/ttcolr.c (Colr): Add `table_size' field. (tt_face_load_colr): Set it. (tt_face_get_colr_layer): Check pointer limit for layer entries.
Werner Lemberg 10790637 2018-06-16T21:45:13 [sfnt] Fix color palette loading. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8933 * src/sfnt/ttcpal.c (Cpal): Add `table_size' field. (tt_face_load_cpal): Set it. (tt_face_palette_set): Check pointer limit for color entries.
Werner Lemberg 8f403ab8 2018-06-16T21:30:04 Minor formatting.
Werner Lemberg 9b31c446 2018-06-14T21:30:43 Replace `FT_Get_GlyphLayers' with `FT_Get_Color_Glyph_Layer'. This avoids any additional allocation of COLR related structures in a glyph slot. * include/freetype/freetype.h (FT_Glyph_Layer, FT_Glyph_LayerRec, FT_Get_GlyphLayers): Removed. * include/freetype/internal/ftobjs.h (FT_Colr_InternalRec): Removed. (FT_Slot_InternalRec): Remove `color_layers'. * include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func): Removed. (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Remove `load_colr_layer'. * src/base/ftobjs.c (ft_glyph_slot_done): Updated. (FT_Render_Glyph_Internal): Use `FT_Get_Color_Glyph_Layer'. (FT_Get_GlyphLayers): Removed. * src/sfnt/sfdriver.c (sfnt_interface): Updated. * src/sfnt/ttcolr.c (tt_face_load_colr_layers): Removed. * src/sfnt/ttcolr.h: Updated. * src/truetype/ttgload.c (TT_Load_Glyph): Updated.
Werner Lemberg f9d05eb3 2018-06-14T21:02:49 Provide iterative API to access `COLR' data. This solution doesn't store any data in an `FT_GlyphSlot' object. * include/freetype/freetype.h (FT_LayerIterator): New structure. (FT_Get_Color_Glyph_Layer): New function. * include/freetype/internal/sfnt.h (TT_Get_Colr_Layer_Func): New function type. (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it. * src/base/ftobjs.c (FT_Get_Color_Glyph_Layer): Implement it. * src/sfnt/ttcolr.c (tt_face_get_colr_layer): New function. * src/sfnt/ttcolr.h: Updated. * src/sfnt/sfdriver.c (sfnt_interface): Updated.
Werner Lemberg a44e2087 2018-06-14T11:32:47 [sfnt] Move `CPAL' stuff into separate files. * src/sfnt/sfdriver.c: Include `ttcpal.h'. * src/sfnt/sfnt.c: Include `ttcpal.c'. * src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: Move CPAL stuff to ... * src/sfnt/ttcpal.c, src/sfnt/ttcpal.c: ... these new files. * src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC): Updated. * include/freetype/internal/fttrace.h: Add support for `colr' and `cpal'. Sort entries.
Werner Lemberg 54b332aa 2018-06-13T08:46:27 [sfnt] Separate `CPAL' and `COLR' table handling. Later on we want to support the `SVG' table also, which needs `CPAL' (but not `COLR'). * include/freetype/internal/sfnt.h (SFNT_Interface): Add `load_cpal' and `free_cpal' fields. (FT_DEFINE_SFNT_INTERFACE): Updated. * include/freetype/internal/tttypes.h (TT_FaceRec): Replace `colr_and_cpal' fields with `cpal' and `colr'. * src/sfnt/sfdriver.c (sfnt_interface): Updated. * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Updated. * src/sfnt/ttcolr.c (Colr, Cpal): Add `table' field. (ColrCpal): Removed. (tt_face_load_colr): Split off CPAL handling into... (tt_face_load_cpal): ... this new function. (tt_face_free_colr): Split off CPAL handling into... (tt_face_free_cpal): ... this new function. (tt_face_load_colr_layers, tt_face_palette_set): Updated. * src/sfnt/ttcolr.h: Updated. * src/truetype/ttgload.c (TT_Load_Glyph): Updated.
Werner Lemberg c07ca2a1 2018-06-12T11:28:55 [sfnt] Fix `sizeof' thinko. * src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_palette_set): Don't use `sizeof' for computing array limit.
Werner Lemberg 22d1be3f 2018-06-12T06:07:40 Finish CPAL/COLR support (4/4). * src/sfnt/ttcolr.c (tt_face_find_color): Removed. (tt_face_colr_blend_layer): Use `face->palette' instead of calling `tt_face_find_color'. Use and set text foreground color.
Werner Lemberg b85d4e8f 2018-06-12T05:53:58 Finish CPAL/COLR support (2/4). * src/sfnt/ttcolr.c (tt_face_palette_set): New function. (tt_face_load_colr): Allocate `face->palette' and call `tt_face_palette_set'. Adjust return error code in case of error. * src/sfnt/ttcolr.h: Updated. * include/freetype/internal/sfnt.h (TT_Set_Palette_Func): New function type. (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): Add it. * src/sfnt/sfdriver.c (sfnt_interface), src/sfnt/sfobjs.c (sfnt_done_face): Updated.
Werner Lemberg 7de877bb 2018-06-12T06:37:02 [sfnt] Minor. * src/sfnt/ttcolr.c (tt_face_load_colr_layers): s/palette_index/palette_entry_index/ for consistency. Adjust return error code in case of error.
Werner Lemberg a698dbf8 2018-06-10T21:43:51 [sfnt] Fix compiler warnings. * src/sfnt/ttcolr.c (tt_face_load_colr, tt_face_load_colr_layers, tt_face_colr_blend_layer): Add `NULL' initializers.
Werner Lemberg d8b8b6e3 2018-06-10T21:37:15 s/FT_Palette/FT_Palette_Data/, s/palette/palette_data/. * include/freetype/ftcolor.h, include/freetype/internal/tttypes.h, src/base/ftcolor.c, src/sfnt/sfobjs.c, src/sfnt/ttcolr.c: Updated.
Werner Lemberg 56be5f72 2018-06-10T06:59:39 * src/sfnt/ttcolr.c (tt_face_load_colr): Improve overflow checks.
Werner Lemberg c412de52 2018-06-09T23:56:21 [sfnt] Read `CPAL' version 1 tables. * include/freetype/internal.tttypes.h: Include FT_COLOR_H. (TT_FaceRec): Add `palette' field. * src/sfnt/ttcolr.c: Include FT_COLOR_H. (Cpal): Remove all data covered by the new `palette' field in `TT_FaceRec'. (tt_face_load_colr): Updated. Read `CPAL' version 1 data. (tt_face_load_colr_layers, tt_face_find_color): Updated. * src/sfnt/sfobjs.c (sfnt_done_face): Free glyph color palette data.
Nikhil Ramakrishnan 78d85b9c 2018-06-04T18:42:29 Restore missing comment lines and other minor fixes
Werner Lemberg 9ac9060d 2018-06-03T09:01:17 [GSoC] src/*.*: Convert block comments to `light' style. This monster commit was created by applying Nikhil's scripts `docconverter.py' and `markify.py' to all C header and source files, followed up by minor manual clean-up. No change in functionality, of course. I used commit f7419907bc6044b9b7057f9789866426c804ba82 from https://github.com/nikramakrishnan/freetype-docs.git.
Werner Lemberg 0589f6e6 2018-05-31T00:34:38 [sfnt] Get colors from `CPAL' table in right order (#54015). * src/sfnt/ttcolr.c (tt_face_find_color): Fix it.
Werner Lemberg ae2cd1b7 2018-05-30T09:34:57 Various minor color fixes. * include/freetype/config/ftheader.h (FT_COLOR_H): New macro. * include/freetype/internal/ftobjs.h (FT_Colr_Internal): Change type of `load_flags' to `FT_Int32'. * include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func): Change type of `idx' to `FT_UInt'. (TT_Blend_Colr_Func): Change type of `color_index' to `FT_UInt'. * src/base/ftobjs.c (FT_Render_Glyph_Internal): Change type of `load_flags' to `FT_Int32'. * src/sfnt/ttcolr.c (find_base_glyph_record, tt_face_load_colr_layers): Change type of `glyph_id' to `FT_UInt'. (tt_face_find_color, tt_face_colr_blend_layer): Change type of `color_index' to `FT_UInt'. Fix signedness and type issues. * src/sfnt/ttcolr.h: Updated.
Werner Lemberg 583dabf2 2018-05-16T20:37:43 Add function `FT_Get_GlyphLayers' to access `COLR' table data. * include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec): Move this structure to... * include/freetype/freetype.h (FT_Glyph_LayerRec): ... this header file. (FT_Glyph_Layer): New typedef. Update code to use it where appropriate. * src/base/ftobjs.c (FT_Get_GlyphLayers): New function.
Werner Lemberg befee112 2018-05-15T17:01:22 [sfnt] Fix memory leak in handling `COLR' data. * src/truetype/ttgload.c (TT_Load_Glyph): Free old `layers' array before reassigning allocated memory. Only allocate `color_layers' if we don't have one already.
Werner Lemberg 2dd20916 2018-05-15T09:05:53 [sfnt] If `COLR' is present, don't assume that all glyphs use it. * src/sfnt/ttcolr.c (tt_face_load_colr_layers): Return FT_Err_Ok if current glyph is not a `COLR' base glyph. * src/truetype/ttgload.c (TT_Load_Glyph): Don't allocate `color_layers' if there are no color layers.
Shao Yu Zhang f04d8175 2018-05-13T03:25:09 [sfnt] Preliminary support of coloured layer outlines. This commit enables OpenType's COLR/CPAL table handling; a typical application are color emojis that can be scaled to any size. If the color palette does not exist or is invalid, the rendering step rasterizes the outline instead. The current implementation assumes that the foreground is black. Enable this by defining option TT_CONFIG_OPTION_COLOR_LAYERS. There are still some issues with metrics; additionally, an API to fetch color layers is missing. * devel/ftoption.h, include/freetype/config/ftoption.h (TT_CONFIG_OPTION_COLOR_LAYERS): New macro. * include/freetype/internal/ftobjs.h (FT_Glyph_LayerRec, FT_Colr_InternalRec): New structures. (FT_Slot_InternalRec): Add `color_layers' field. * include/freetype/internal/sfnt.h (TT_Load_Colr_Layer_Func, TT_Blend_Colr_Func): New function types. (SFNT_Interface): Add `load_colr', `free_colr', `load_colr_layer', and `colr_blend' fields. * include/freetype/internal/tttypes.h (TT_FaceRec): Add `colr_and_cpal' field. * include/freetype/internal/tttags. (TTAG_COLR, TTAG_CPAL): New macros. * src/sfnt/ttcolr.c, src/sfnt/ttcolr.h: New files. * src/base/ftobjs.c (ft_glyphslot_done, FT_Render_Glyph_Internal): Handle glyph color layers. * src/sfnt/Jamfile (_sources), src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttcolr.c'. * src/sfnt/sfdriver.c: Include `ttcolr.h'. (PUT_COLOR_LAYERS): New macro. Update call to `FT_DEFINE_SFNT_INTERFACE'. * src/sfnt/sfnt.c: Include `ttcolr.c'. * src/sfnt/sfobjs.c (sfnt_load_face): Load `COLR' and `CPAL' tables. (sfnt_done_face): Updated. * src/truetype/ttgload.c (TT_Load_Glyph): Handle color layers.
Werner Lemberg 95149592 2018-05-02T20:27:48 Remove FT_CONFIG_OPTION_PIC and related code. */* [FT_CONFIG_OPTION_PIC]: Remove all code guarded by this preprocessor symbol. */*: Replace `XXX_GET' macros (which could be either a function in PIC mode or an array in non-PIC mode) with `xxx' arrays. * include/freetype/internal/ftpic.h, src/autofit/afpic.c, src/autofit/afpic.h, src/base/basepic.c, src/base/basepic.h, src/base/ftpic.c, src/cff/cffpic.c, src/cff/cffpic.h, src/pshinter/pshpic.c, src/pshinter/pshpic.h, src/psnames/pspic.c, src/psnames/pspic.h, src/raster/rastpic.c, src/raster/rastpic.h, src/sfnt/sfntpic.c, src/sfnt/sfntpic.h, src/smooth/ftspic.c, src/smooth/ftspic.h, src/truetype/ttpic.c, src/truetype/ttpic.h: Removed.
Werner Lemberg ac97a296 2018-04-26T09:04:39 Another fix for handling invalid format 2 cmaps. Sigh. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8003 * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid an endless loop.
Werner Lemberg 38ecc949 2018-04-22T10:14:03 Another fix for handling invalid format 2 cmaps. The previous commit was incomplete. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7928 * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid an endless loop.
Werner Lemberg 1655e00f 2018-04-19T14:45:19 Fix handling of invalid format 2 cmaps. The problem was introduced after the last release. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7828 * src/sfnt/ttcmap.c (tt_cmap2_char_next): Avoid endless loop.
Ben Wagner 34e46733 2018-03-23T06:13:25 [sfnt] Correctly handle missing bitmaps in sbix format (#53404). * src/sfnt/ttfsbit.c (tt_face_load_sbix_image): Fix return value.
Werner Lemberg 5bd76524 2018-03-13T11:11:16 * src/sfnt/ttcmap.c (tt_cmap2_validate): Fix potential numeric overflow.
Werner Lemberg 78cded2c 2018-03-13T11:09:44 Fix cmap format 2 handling (#53320). The patch introduced for #52646 was not correct. * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition.
Werner Lemberg 713d68ee 2018-02-17T18:35:15 [sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154).
Werner Lemberg 5f94c90f 2018-01-27T10:52:13 Fix comment.
Werner Lemberg 0a0c2256 2018-01-02T09:33:57 Update copyright year.
Werner Lemberg 3f090c68 2017-12-31T10:32:08 * src/sfnt/ttcmap.c (tt_cmap2_char_next): Fix endless loop. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4838
Werner Lemberg 2df73b39 2017-12-18T23:32:32 [sfnt] Fix charmap type 2 iterator (#52646). The subsetted demo font of the report that exhibits the bug has a very unusual type 2 cmap for Unicode(!): It contains only two sub-headers, one for one-byte characters (covering the range 0x20 to 0xFA), and a second one for higher byte 0x01 (just for character code U+0131). Before this commit, the iterator wasn't able to correctly handle a sub-header for higher byte 0x01. * src/sfnt/ttcmap.c (tt_cmap2_char_next): Fix character increment for outer loop.
Werner Lemberg 068a7a03 2017-12-18T20:34:05 * src/*/*: Only use `ft_' and `FT_' variants of stdc library stuff.
Werner Lemberg 71fecc53 2017-12-05T12:06:29 Improve tracing messages by using singular and plural forms. * src/*/*.c: Implement it.
Werner Lemberg 87ddad20 2017-12-04T20:43:30 Update or fix links to use the https protocol instead of http.
Tor Andersson 2f1863cf 2017-11-23T20:40:52 Silence unused function warnings. Some static function declarations cause unused function warnings if certain config options are turned off via `ftoption.h'. * src/base/ftbase.h, src/base/ftrfork.c, src/sfnt/ttbdf.h, src/truetype/ttgxvar.h: Add #ifdef guards around these sections.
Werner Lemberg 7bfcaaca 2017-10-07T13:14:38 [sfnt] Adjust behaviour of PS font names for variation fonts. * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Use a named instance's PS name only if no variation is applied.
Werner Lemberg 8c92f762 2017-10-07T12:12:49 Make `FT_FACE_FLAG_VARIATION' work. * include/freetype/internal/tttypes.h (TT_Face): Remove `is_default_instance'; this can be replaced with a combination of `FT_IS_VARIATION' and `FT_IS_INSTANCE'. * src/cff/cffdrivr.c (cff_get_advances): Updated. * src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/sfobjs.c (sfnt_init_face): Updated. * src/truetype/ttdriver.c (tt_get_advances), src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph, IS_DEFAULT_INSTANCE), src/truetype/ttgxvar.c (tt_set_mm_blend): Updated. * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design): Handle `FT_FACE_FLAG_VARIATION'. * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design): Handle `FT_FACE_FLAG_VARIATION'.
Werner Lemberg 693a1181 2017-09-27T08:42:50 * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning.
Jonathan Kew 0d1262a4 2017-09-24T17:36:47 [sfnt] Fix `premultiply_data' (#52092). * src/sfnt/pngshim.c (premultiply_data): Don't use vector extension if we have less than 16 bytes of data.
Werner Lemberg cf64e338 2017-09-21T11:42:48 [sfnt] Fix postscript name for default instance of variation fonts. Problem reported by Behdad. * src/sfnt/sfdriver.c (sfnt_get_ps_name): Test `is_default_instance'.
Werner Lemberg 39ce3ac4 2017-09-16T19:08:17 * Version 2.8.1 released. ========================= Tag sources with `VER-2-8-1'. * docs/VERSION.TXT: Add entry for version 2.8.1. * docs/CHANGES: Updated. * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, builds/windows/vc2005/index.html, builds/windows/vc2008/freetype.vcproj, builds/windows/vc2008/index.html, builds/windows/vc2010/freetype.vcxproj, builds/windows/vc2010/index.html, builds/windows/visualc/freetype.dsp, builds/windows/visualc/freetype.vcproj, builds/windows/visualc/index.html, builds/windows/visualce/freetype.dsp, builds/windows/visualce/freetype.vcproj, builds/windows/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.8/2.8.1/, s/28/281/. * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. * builds/unix/configure.raw (version_info): Set to 21:0:15. * CMakeLists.txt (VERSION_PATCH): Set to 1.
suzuki toshiya b757ddb1 2017-09-13T22:17:03 [sfnt] lowest gcc for vectors ( e1d0249e ) is changed to 4.7. __builtin_shuffle() was introduced in gcc-4.7. The lowest gcc to enable vector operation is delayed from 4.6 to 4.7. * src/sfnt/pngshim.c (premultiply_data): Fix cpp-macro to enable the vector operation, to change the lowest gcc version from 4.6 to 4.7.
suzuki toshiya 21658c31 2017-09-12T15:59:18 [autofit, sfnt] Fix for `make multi'. * src/autofit/afshaper.c: Include FT_ADVANCE_H, to use FT_Get_Advance() in it. * src/sfnt/ttcmap.c: Include FT_SERVICE_POSTSCRIPT_CMAPS_H to use PS_Unicodes in it, also include `ttpost.h' to use tt_face_get_ps_name() in it.
Werner Lemberg 3e4b7997 2017-09-11T08:51:44 * src/sfnt/ttkern.c (tt_face_load_kern): Reject format 2 tables. Reported by Behdad.
suzuki toshiya 5c4e40d7 2017-09-09T00:59:33 [sfnt, truetype] Register the tags for marginal fonts. The first 32bit of standard TrueType variants is 0x00010000, `OTTO', `ttcf', `true' or `typ1'. 2 marginal dfonts on legacy Mac OS X, Keyboard.dfont and LastResort.dfont, have the sfnt resources starting 0xA5 followed by `kbd' or `lst'. Considering the following data could be parsed as conventional TrueType fonts, the header checking is updated to allow these tags. It seems that recent Mac OS X has already switched to normal TTF for these fonts. See the discussion at http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3931.0 * include/freetype/tttags.h (TTAG_0xA5kbd, TTAG_0xA5lst): New header tags for Keyboard.dfont and LastResort.dfont. * src/sfnt/sfobjs.c (sfnt_open_font): Accept the sfnt resource starts with TTAG_0xA5kbd or TTAG_0xA5lst. * src/truetype/ttobjs.c (tt_face_init): Accept the face with the format tag is TTAG_0xA5kbd or TTAG_0xA5lst.
Werner Lemberg e1d0249e 2017-08-23T08:18:22 [sfnt] Fix clang compilation (#51788). * src/sfnt/pngshim.c (premultiply_data): Use vectors instead of scalars. (vector_shuffle): New macro to take of a different built-in function name on clang.
Alexei Podtelezhnikov 7653c765 2017-08-17T21:28:32 [sfnt] Avoid synthetic unicode for symbol fonts with PUA. Reported as https://bugs.chromium.org/p/chromium/issues/detail?id=754574 * src/sfnt/sfobjs.c (sfnt_load_face): Check for FT_ENCODING_MS_SYMBOL.
Werner Lemberg cadd29de 2017-08-16T13:32:17 * src/sfnt/pngshim.c (premultiply_data): Fix compiler warnings.
Behdad Esfahbod c9d7c03f 2017-08-15T08:48:17 [sfnt] Speed up PNG image loading. This reduces the overhead of `premultiply_data' by 60%. * src/sfnt/pngshim.c (premultiply_data): Provide code which uses gcc's (and clang's) `vector_byte' attribute to process 4 pixels at a time.
Werner Lemberg b45043c4 2017-08-11T09:34:20 [sfnt, truetype] Improve handling of missing sbits. Requested by Behdad. Modern bitmap-only SFNTs like `NotoColorEmoji.ttf' don't contain entries in the bitmap strike(s) for empty glyphs. Instead, they rely that a space glyph gets created from the font's metrics data. This commit makes FreeType behave accordingly. * include/freetype/fterrdef.h (FT_Err_Missing_Bitmap): New error code. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image): Change error codes to make a distinction between a missing bitmap in a composite and a simple missing bitmap. * src/truetype/ttgload.c (TT_Load_Glyph): For a missing bitmap (in a bitmap-only font), synthesize an empty bitmap glyph if metrics are available.
Alexei Podtelezhnikov a9d8e90c 2017-08-08T21:42:37 * src/sftnt/ttpost.c (format): Use otspec-compliant versions.
Werner Lemberg ce367774 2017-08-01T08:24:51 [sfnt, truetype] Minor adjustments for OpenType 1.8.2. * src/sfnt/sfobjs.c (sfnt_load_face): The units per EM value has now (tighter) limits. * src/truetype/ttgload.c (load_truetype_glyph): The new OpenType version explicitly allows all negative values for the number of contours if we have a composite glyph (this is for better backwards compatibility I guess), but it still recommends value -1.
Werner Lemberg cf8d9b4c 2017-07-05T23:07:01 * src/sfnt/ttcmap.c (tt_cmap_unicode_class_rec): Fix warning.
Alexei Podtelezhnikov abeb28f1 2017-07-01T16:48:32 * src/sfnt/sfobjs.c (sfnt_load_face): Ignore No_Unicode_Glyph_Name.
Alexei Podtelezhnikov 75cb071b 2017-06-21T22:52:37 [sfnt] Synthesize a Unicode charmap if one is missing. * src/sfnt/ttcmap.h (tt_cmap_unicode_class_rec): Declare it. * src/sfnt/ttcmap.c (tt_get_glyph_name, tt_cmap_unicode_init, tt_cmap_unicode_done, tt_cmap_unicode_char_index, tt_cmap_unicode_char_next, tt_cmap_unicode_class_rec): Implement synthetic Unicode charmap class. (tt_get_cmap_info): Make sure the callback is available. * src/sfnt/sfobjs.c (sfnt_load_face) [FT_CONFIG_OPTION_POSTSCRIPT_NAMES]: If Unicode charmap is missing, synthesize one. * include/freetype/config/ftoption.h: Document it. * devel/ftoption.h: Ditto.
Werner Lemberg 390048fa 2017-06-20T18:03:20 Remove deprecated comment.
Werner Lemberg 79e3789f 2017-06-14T07:51:04 * src/winfonts/winfnt.c (FNT_Face_Init): Don't set active encoding. FreeType only sets a default active encoding for Unicode.
Werner Lemberg 5efda13f 2017-05-15T21:26:01 [sfnt] Return proper scaling values for SBIX bitmaps. Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>. * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it.
Alexei Podtelezhnikov 71d289da 2017-04-19T23:50:29 Typos.
Wojciech Mamrak 565f5a7d 2017-03-27T09:19:14 [sfnt] Minor improvement for handling kern tables. * src/sfnt/ttkern.c (tt_face_load_kern): Don't check for cross-stream kerning tables since we reject format 2 tables later on anyways. Modify code for limit test... (tt_face_get_kerning): ... to avoid a limit test here.
Werner Lemberg 913f436d 2017-03-23T18:37:06 [sfnt] Fix check for default named instance. * src/sfnt/sfobjs.c (sfnt_init_face): A `fixed' number needs four bytes, not two...
Werner Lemberg 6342da9a 2017-03-20T05:36:41 [sfnt] Don't add instances to non-variation fonts. * src/sfnt/sfobjs.c (sfnt_init_face): Fix it.
Werner Lemberg 9931175d 2017-03-18T07:06:49 Improve `make multi'. * src/autofit/aflatin2.c: Guard file with FT_OPTION_AUTOFIT2. * src/base/ftmac.c: Guard more parts of the file with FT_MACINTOSH. * src/psaux/afmparse.c: Guard file with T1_CONFIG_OPTION_NO_AFM. * src/sfnt/pngshim.c: Guard file with TT_CONFIG_OPTION_EMBEDDED_BITMAPS also. * src/sfnt/ttbdf.c: Avoid empty source file. * src/sfnt/ttpost.c: Guard file with TT_CONFIG_OPTION_POSTSCRIPT_NAMES. * src/sfnt/ttsbit.c: Guard file with TT_CONFIG_OPTION_EMBEDDED_BITMAPS. * src/truetype/ttgxvar.c, src/truetype/ttinterp.c: Avoid empty source file. * src/truetype/ttsubpix.c: Guard file with TT_USE_BYTECODE_INTERPRETER also. * src/type1/t1afm.c: Guard file with T1_CONFIG_OPTION_NO_AFM. * src/autofit/autofit.c, src/base/ftbase.c, src/cache/ftcache.c, src/cff/cff.c, src/cid/type1cid.c, src/gxvalid/gxvalid.c, src/pcf/pcf.c, src/pfr/pfr.c, src/psaux/psaux.c, src/pshinter/pshinter.c, src/psnames/psnames.c, src/raster/raster.c, src/sfnt/sfnt.c, src/smooth/smooth.c, src/truetype/truetype.c, src/type1/type1.c, src/type42/type42.c: Remove conditionals; sort entries.
Werner Lemberg d5bfa053 2017-03-17T21:47:54 Fixes for conditional compilation. * src/autofit/afcjk.c, src/autofit/afindic.c: Include `afcjk.h' earlier. * src/sfnt/sfobjs.c (sfnt_init_face): Put `memory' variable into TT_CONFIG_OPTION_GX_VAR_SUPPORT block. (sfnt_done_face): Protect some code with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Remove compiler warning. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Put `tmp' variable into TT_USE_BYTECODE_INTERPRETER block. (tt_loader_init): Put `error' variable into TT_USE_BYTECODE_INTERPRETER block.
Werner Lemberg bffb7fe9 2017-03-17T07:52:30 `make multi' fixes; compiler warnings. * src/base/ftsnames.c: Include FT_INTERNAL_DEBUG_H. * src/cff/cffobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H and FT_SERVICE_MULTIPLE_MASTERS_H. * src/sfnt/sfdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H and FT_SERVICE_MULTIPLE_MASTERS_H. (get_win_string, get_apple_string): Initialize `result'.
Werner Lemberg 981c23b7 2017-03-15T11:35:26 Remove clang compiler warnings (#50548). * include/freetype/internal/tttypes.h (TT_FaceRec): Make `var_postscript_prefix_len' unsigned. * src/autofit/afwarp.c (af_warper_compute_line_best): Remove redundant assignment. * src/cff/cffload.c (cff_subfont_load): Add casts. * src/cff/cffparse.c (cff_parse_blend): Remove redundant assignment. * src/sfnt/sfdriver.c (fmix32, murmur_hash_3_128): Add `static' keyword. Add casts. (fixed2float): Add cast. (sfnt_get_var_ps_name): Make `p' always initialized. Add casts. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add casts.
Werner Lemberg 34010f7c 2017-03-14T21:50:22 [sfnt] Implement PS names for font instances [3/3]. Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * include/freetype/internal/tttypes.h (TT_FaceRec): New fields `var_postscript_prefix' and `var_postscript_prefix_len'. * src/sfnt/sfdriver.c: Include FT_TRUETYPE_IDS_H. (sfnt_is_alphanumeric): New wrapperfunction for `ft_isalnum'. (get_win_string, get_apple_string): Remove `const' from return value. (MAX_VALUE_DESCRIPTOR_LEN, MAX_PS_NAME_LEN): New macros. (hexdigits): New array. (sfnt_get_var_ps_name): New function, implementing Adobe TechNote 5902 to construct a PS name for a variation font instance. (sfnt_get_ps_name): Call `sfnt_get_var_ps_name' for font instances. * src/sfnt/sfobjs.c (sfnt_done_face): Updated. * src/truetype/ttgxvar.c (tt_set_mm_blend): Reset `face->postscript_name' to trigger recalculation for new instance parameters.
Werner Lemberg 4fd9cc73 2017-03-14T19:40:50 [sfnt] Implement PS names for font instances [2/3]. * src/sfnt/sfdriver.c (fix2float) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New function to find the shortest representation of a 16.16 fractional number.
Werner Lemberg 4a32dce9 2017-03-14T19:32:12 [sfnt] Implement PS names for font instances [1/3]. Add 128bit MurmurHash 3 function. Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT. * src/sfnt/sfdriver.c (ROTL32): New macro. (fmix32, murmur_hash_3_128): New functions.
Werner Lemberg 7bbb91fb 2017-03-08T15:09:41 [sfnt] Another fix for buggy variation fonts. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=759 * src/sfnt/sfobjs.c (sfnt_init_face): While setting number of instances to zero for `CFF' fonts table, ensure that there is no `CFF2' present also (which gets priority).