src/truetype/ttobjs.c


Log

Author Commit Date CI Message
Werner Lemberg 0a0c2256 2018-01-02T09:33:57 Update copyright year.
Werner Lemberg 98ba0c4a 2017-12-08T18:38:41 New `ftdriver.h' file, covering all driver modules. This reduces redundancy and increases synergy; it also reduces the number of header files. * include/freetype/config/ftheader.h (FT_DRIVER_H): New macro. (FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H, FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to FT_DRIVER_H. * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h, include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h, include/freetype/ftttdrv.h: Replaced with... * include/freetype/ftdriver.h: ...this new file. (FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to... (FT_HINTING_ADOBE): ... this new macro. (FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to... (FT_HINTING_FREETYPE): ... this new macro. * src/*/*: Updated accordingly.
suzuki toshiya 77b34e01 2017-11-03T16:13:29 [truetype] Add more tricky fonts. See the report by Yang Yinsen. https://lists.gnu.org/archive/html/freetype-devel/2017-11/msg00000.html * src/truetype/ttobjs.c (trick_names): Add `DFGothic-EB', `DFGyoSho-Lt', `DFHSGothic-W5', `DFHSMincho-W3' and `DFHSMincho-W7'. (tt_check_trickyness_sfnt_ids): Add checksums for DFGothic-EB, DFGyoSho-Lt, DFHSGothic-W5, DFHSMincho-W3 and DFHSMincho-W7. Also add checksums for DLCLiShu and DLCHayBold which their family names were already listed but their checksums were previously unknown.
Werner Lemberg f89c67f0 2017-10-07T13:10:53 [cff, truetype] Adjust behaviour of named instances. This commit completely separates the interaction between named instances and variation functions. In particular, resetting the variation returns to the current named instance (if set) and not to the base font. As a side effect, variation functions no longer change the named instance index. * src/cff/cffobjs.c (cff_face_init): Use MM service's `set_instance' function. Also apply `MVAR' table to named instances. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add cast. (tt_set_mm_blend): No longer check whether requested variation coincides with a named instance. (TT_Set_Var_Design): Use current named instance for default coordinates. * src/truetype/ttobjs.c (tt_face_init): Use `TT_Set_Named_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 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 38bdf22b 2017-07-13T10:28:09 [truetype] Improve code comment.
Werner Lemberg ec4cb04b 2017-05-07T13:06:36 [truetype] Add tricky font `DFGirl-W6-WIN-BF' (from Dynalab). Reported by Roy Tam <roytam@gmail.com>. * src/truetype/ttobjs.c (tt_check_trickyness_family): Implement it.
Roy Tam 0ed9fef0 2017-05-07T08:32:58 [truetype] More tricky fonts (mainly from Dynalab). * src/truetype/ttobjs.c (tt_check_trickyness_family, tt_check_trickyness_sfnt_ids): Add them.
Werner Lemberg f784a565 2017-05-07T00:45:05 [truetype] Add tricky font `DLCHayMedium' (from Dynalab). Reported by Roy Tam <roytam@gmail.com>. * src/truetype/ttobjs.c (tt_check_trickyness_family): Implement it.
Werner Lemberg ba40054c 2017-05-02T12:32:19 [autofit] Remove `slight' auto-hint mode again. A poll on freetype-devel favoured changes directly applied to `light'. * include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT, FT_RENDER_MODE_SLIGHT): Removed. * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c (af_latin_hints_init), src/autofit/aflatin2.c (af_latin2_hints_init): Revert change from 2017-04-22. * src/autofit/afloader.c (af_loader_load_glyph) Remove references to FT_RENDER_MODE_SLIGHT. [AF_CONFIG_OPTION_TT_SIZE_METRICS]: Enable TrueType-like metrics unconditionally. * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Revert change from 2017-04-22. * src/base/ftobjs.c (FT_Load_Glyph): Revert change from 2017-04-22. * src/pshinter/pshalgo.c (ps_hints_apply): Revert change from 2017-04-22. * src/smooth/ftsmooth.c (ft_smooth_render): Revert change from 2017-04-22. * docs/CHANGES: Updated.
Werner Lemberg 5f18d867 2017-04-22T23:02:21 [truetype] Do linear scaling for FT_LOAD_NO_HINTING (#50470). * src/truetype/ttobs.h (TT_SizeRec): Add field `hinted_metrics' to hold hinted metrics. Make `metrics' a pointer so that `tt_glyph_load' can easily switch between metrics. * src/truetype/ttdriver.c (tt_size_request): Updated. (tt_glyph_load): Use top-level metrics if FT_LOAD_NO_HINTING is used. * src/truetype/ttgload.c (TT_Hint_Glyph, TT_Process_Simple_Glyph, TT_Process_Composite_Component, load_truetype_glyph, compute_glyph_metrics, TT_Load_Glyph): Updated. * src/truetype/ttinterp.c (TT_Load_Context): Updated. * src/truetype/ttobjs.c (tt_size_reset): Updated. * src/truetype/ttsubpix.c (sph_set_tweaks): Updated.
Werner Lemberg 683e3ad9 2017-03-21T19:49:11 [truetype] Some variable renamings. Too much local variables holding different structures were called `metrics'. * src/truetype/ttdriver.c (tt_size_select): s/metrics/size_metrics/. * src/truetype/ttgload.c (tt_get_metrics_incr_overrids, compute_glyph_metrics): s/metrics/incr_metrics/. (load_sbit_image): s/metrics/sbit_metrics/. * src/truetype/ttobjs.c (tt_size_run_fpgm): s/metrics/size_metrics/. (tt_size_init_bytecode): s/metrics/tt_metrics/. (tt_size_reset): s/metrics/size_metrics/.
Werner Lemberg f0cee1a2 2017-02-23T08:23:39 * include/freetype/internal/tttypes.h (TT_Face): s/isCFF2/is_cff2/. For orthogonality with other structure field names. Update all users.
Werner Lemberg e6699596 2017-02-02T11:38:04 [truetype] Fix MVAR post-action handling. Reported as https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=509 * src/truetype/ttobjs.c (tt_size_reset): Do nothing for CFF2. This is important to make `tt_size_reset_iterator' (called in `tt_apply_mvar') always work.
Werner Lemberg 723aafb5 2017-01-11T14:21:26 [truetype] Actually use metrics variation service. * src/base/ftmm.c: Include FT_SERVICE_METRICS_VARIATIONS_H. (ft_face_get_mvar_service): New auxiliary function to look up metrics variation service. (FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Call metrics variation service. * src/truetype/ttobjs.c (tt_face_init): Use metrics variations for named instances.
Werner Lemberg 8ab08cff 2017-01-11T10:05:27 [truetype] More preparations for MVAR support. * src/truetype/ttobjs.c (tt_size_reset): Add argument to make function only recompute ascender, descender, and height. * src/truetype/ttobjs.h: Updated. * src/truetype/ttdriver.c (tt_size_select, tt_size_request): Updated.
Werner Lemberg 563ae780 2017-01-04T20:16:34 Update copyright year.
Werner Lemberg 025226ae 2017-01-04T07:45:44 [cff, truetype] Minor tracing improvement. * src/cff/cffobjs.c (cff_face_init), src/truetype/ttobjs.c (tt_face_init): Indent first tracing message from SFNT driver.
Werner Lemberg 8982405f 2017-01-03T09:46:19 [truetype] Various minor fixes. * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check instruction size only if we do native hinting. (TT_Load_Glyph): Trace returned error code. * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Trace returned error code. (tt_size_ready_bytecode): Don't run `prep' table if `fpgm' table is invalid.
Werner Lemberg db17ceb4 2016-12-17T13:39:31 * src/truetype/ttobjs.c (tt_face_init): Simplify conditional code.
Werner Lemberg 7c75b166 2016-12-17T13:28:24 [sfnt, truetype] Various sanitizing fixes. * src/sfnt/sfobjs.c (sfnt_init_face): If the axis count in `fvar' is zero, set `num_instances' to zero. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Handle `fvar' table with zero axes as invalid. * src/truetype/ttobjs.c (tt_face_init): Improve logic of loading `loca', `cvt', `fpgm', and `prep' table.
Werner Lemberg 27bdb36c 2016-12-10T09:56:03 [truetype, type1] Add `done_blend' to MM service. For internal use; we want to share code between the forthcoming CFF2 support and TrueType. * include/freetype/internal/services/svmm.h (FT_Done_Blend_Func): New typedef. (MultiMasters): Add `done_blend'. (FT_Service_MultiMasters): Updated. * src/truetype/ttgxvar.c (tt_done_blend): Use `TT_Face' as argument. * src/truetype/ttgxvar.h: Updated. * src/truetype/ttobjs.c (TT_Face_Done): Updated. * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated. * src/type1/t1driver.c (t1_service_multi_masters): Updated.
Werner Lemberg 2ecf89b4 2016-09-28T19:06:21 */*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate.
Nikolaus Waxweiler 59615736 2016-05-18T06:57:59 [truetype] New implementation of v38 bytecode interpreter [1/3]. This patch prepares data structures and the like. See added comments in `ttinterp.h' for more information on this and the following commits in the series. * devel/ftoption.h, include/freetype/config/ftoption.h (TT_CONFIG_OPTION_SUBPIXEL_HINTING): Assign values to differentiate between subpixel versions. (TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY, TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL): New macros. * include/freetype/ftttdrv.h (TT_INTERPRETER_VERSION_40): New macro. * include/freetype/internal/tttypes.h (TT_FaceRec): Updated. * src/truetype/ttinterp.h (TT_ExecContextRec): Define new fields `subpixel_hinting_lean', `vertical_lcd_lean', `backwards_compatibility', `iupx_called', iupy_called', and `grayscale_cleartype' for new hinting mode. * src/truetype/ttdriver.c (tt_property_set): Handle v38 and v40 interpreters conditionally. * src/truetype/ttgload.c (TT_Hint_Glyph): Save phantom points unless in v38 backwards compatibility mode. Updated. (compute_glyph_metrics): Add v38 backwards compatibility mode constraint for adjusting advance widths. Updated. (tt_loader_init): Handle new flags `subpixel_hinting_lean', `grayscale_cleartype', and `vertical_lcd_lean'. Updated. (tt_get_metrics, TT_Process_Simple_Glyph, TT_LOADER_SET_PP): Updated. * src/truetype/ttobjs.c (tt_driver_init): Conditionally set default interpreter version number. * src/truetype/ttsubpix.c, src/truetype/ttsubpix.h: Updated.
Werner Lemberg 32950391 2016-02-15T12:54:40 Whitespace.
Nikolaus Waxweiler 1d8d0b4e 2016-01-28T14:11:14 Remove unpatented hinter (3/3). * include/freetype/config/ftoption.h (TT_CONFIG_OPTION_UNPATENTED_HINTING): Remove. * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove `ignore_unpatented_hinter' field. Update users. (FT_DEBUG_HOOK_UNPATENTED_HINTING): Remove. Update users. * include/freetype/internal/tttypes.h (TT_FaceRec): Remove `unpatented_hinting' field. Update users. * src/base/ftpatent.c (_tt_check_patents_in_range, _tt_check_patents_in_table, _tt_face_check_patents): Remove. (FT_Face_CheckTrueTypePatents, FT_Face_SetUnpatentedHinting): Replace code with dummies. * src/truetype/ttobjs.c (tt_face_init): Remove now defunct code. * src/truetype/ttobjs.h (TT_GraphicsState): Remove `both_x_axis' field.
Derek B. Noonburg 4cdfefd4 2016-01-19T07:12:44 [truetype] Add another tricky font. * src/truetype/ttobjs.c (TRICK_SFNT_IDS_NUM_FACES): Increase. (sfnt_id): Add variant of `DFKaiShu'.
Werner Lemberg 9adeab64 2016-01-13T11:54:10 Update copyright year.
Werner Lemberg dcfc4d9c 2015-10-18T16:47:06 [truetype] Better protection against malformed `fpgm' (#46223). * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't execute a malformed `fpgm' table more than once.
Werner Lemberg 7f0f4011 2015-09-15T07:23:53 [truetype] Fix integer type (#45965). * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it.
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 75534a04 2015-06-03T00:54:09 [truetype] Fix memory leak. Problem reported by Grissiom <chaos.proton@gmail.com>; in http://lists.nongnu.org/archive/html/freetype/2015-05/msg00013.html there is an example code to trigger the bug. * src/truetype/ttobjs.c (tt_size_init_bytecode): Free old `size' data before allocating again. Bug most probably introduced four years ago in version 2.4.3.
Werner Lemberg d9c3f151 2015-02-17T09:21:26 [truetype] More signedness fixes. * include/internal/tttypes.h, src/truetype/ttinterp.h, src/truetype/ttobjs.h, src/truetype/ttinterp.c, src/truetype/ttobjs.c: Apply.
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.
Behdad Esfahbod 531d463a 2015-01-14T17:46:55 [truetype] Allocate TT_ExecContext in TT_Size instead of TT_Driver. Previously the code had stipulation for using a per-TT_Size exec context if `size->debug' was true. But there was no way that `size->debug' could *ever* be true. As such, the code was always using the singleton `TT_ExecContext' that was stored in `TT_Driver'. This was, clearly, not threadsafe. With this patch, loading glyphs from different faces from different threads doesn't crash in the bytecode loader code. * src/truetype/ttobjs.h (TT_SizeRec): Remove `debug' member. (TT_DriverRec): Remove `context' member. * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Remove `TT_ExecContext' code related to a global `TT_Driver' object. (tt_driver_done): Don't remove `TT_ExecContext' object here but ... (tt_size_done_bytecode): ... here. (tt_driver_init): Don't create `TT_ExecContext' object here but ... (tt_size_init_bytecode): ... here, only on demand. * src/truetype/ttinterp.c (TT_Run_Context): Remove defunct debug code. (TT_New_Context): Remove `TT_ExecContext' code related to a global `TT_Driver' object. * src/truetype/ttinterp.h: Updated. * src/truetype/ttgload.c (TT_Hint_Glyph, tt_loader_init): Updated.
Werner Lemberg 0098d550 2014-12-07T11:03:57 Uppercase all hex digits for orthogonality.
Werner Lemberg 9870d6da 2014-12-07T09:40:47 */*: Decorate hex constants with `U' and `L' where appropriate.
Werner Lemberg 66883b58 2014-12-07T09:17:06 [truetype] Prevent memory leak for buggy fonts. * src/truetype/ttobjs.c (tt_size_done): Unconditionally call `tt_size_done_bytecode'.
Werner Lemberg 6689a009 2014-11-25T08:53:09 [Savannah bug #43682] Properly handle missing return errors. The functions in this patch *do* return non-trivial errors that must be taken care of. * src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render), src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_endchar>, src/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode (t1_decoder_parse_charstrings) <op_endchar>, src/truetype/ttgload.c (load_truetype_glyph <subglyph loop>, tt_loader_init, TT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend), src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it.
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.
Alexei Podtelezhnikov d4aabda3 2014-10-18T10:10:04 [truetype] Unwrap engine compensation settings. * src/truetype/ttobjs.c (tt_size_init_bytecode): Updated.
Werner Lemberg 441b3f38 2014-07-13T02:28:14 [truetype] Improve handling of buggy `prep' tables. In case of an error in the `prep' table, no longer try to execute it again and again. This makes FreeType handle endless loops in buggy fonts much faster. * src/truetype/ttobjs.h (TT_SizeRec): The fields `bytecode_ready' and `cvt_ready' are now negative if not initialized yet, otherwise they indicate the error code of the last run. * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep, tt_size_done_bytecode, tt_size_init_bytecode, tt_size_ready_bytecode, tt_size_init, tt_size_done, tt_size_reset): Updated. * src/truetype/ttgload.c (tt_loader_init): Updated. * src/truetype/ttinterp.c (TT_RunIns): Force reexecution of `fpgm' and `prep' only if we are in the `glyf' table.
Werner Lemberg 063ee6b1 2013-11-24T00:19:17 [truetype]: Add tricky font names `hkscsiic.ttf' and `iicore.ttf'. * src/truetype/ttobjs.c (TRICK_NAMES_MAX_CHARACTERS, TRICK_NAMES_COUNT): Updated. (trick_names): Add family name for the two fonts.
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.
Werner Lemberg f04951af 2013-05-17T13:51:07 [truetype] Add `interpreter-version' property. This makes the option TT_CONFIG_OPTION_SUBPIXEL_HINTING controllable at runtime. * src/truetype/ttdriver.c: Include FT_TRUETYPE_DRIVER_H. (tt_property_set, tt_property_get): Fill templates. * src/truetype/ttobjs.h (TT_DriverRec): Add `interpreter_version' member. Remove unused `extension_component' member. * src/truetype/ttgload.c: Include FT_TRUETYPE_DRIVER_H. (tt_get_metrics, TT_Hint_Glyph, TT_Process_Simple_Glyph, compute_glyph_metrics, tt_loader_init): Use `interpreter_version'. * src/truetype/ttinterp.c: Include FT_TRUETYPE_DRIVER_H. (SUBPIXEL_HINTING): New macro to check `interpreter_version' flag. Update all affected functions to use it. Use TT_INTERPRETER_VERSION_XXX where appropriate. * src/truetype/ttobjs.c: Include FT_TRUETYPE_DRIVER_H. (tt_driver_init): Initialize `interpreter_version'. * src/truetype/ttsubpix.c: Include FT_TRUETYPE_DRIVER_H. Use TT_INTERPRETER_VERSION_XXX where appropriate.
Werner Lemberg e3c93015 2013-03-14T11:21:17 */*: Use FT_Err_Ok only. This is a purely mechanical conversion.
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 a2c7eb18 2013-02-07T19:49:12 * src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables. BTW, Greg agrees that the OpenType specification is missing the list of GS variables which will always be reset to the default values after the `prep' table has been executed.
Werner Lemberg bfcc375b 2013-02-06T08:47:29 * src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points. Up to now, we simply took a snapshot of the Graphics State after the `prep' table has been executed, and right before a glyph's bytecode was run it got reloaded. However, as Greg Hitchcock has told us in private communication, reference points get reset to zero in the MS rasterizer and we follow in due course. While reasonable, this is undocumented behaviour. Most notably, this fixes the rendering of Arial's `x' glyph in subpixel hinting mode.
Werner Lemberg 87dc86d6 2013-01-24T08:39:43 [truetype] Revert change from 2013-01-22. FreeType's `height' value is the baseline-to-baseline distance... * src/truetype/ttobjs.c (tt_size_reset): Undo.
Werner Lemberg e0469372 2013-01-22T11:07:07 [truetype] Fix font height. * src/truetype/ttobjs.c (tt_size_reset): The Windows rendering engine uses rounded values of the ascender and descender to compute the TrueType font height.
Alexei Podtelezhnikov 65d65721 2012-12-10T06:59:29 [truetype] Scale F_dot_P down. The dot product between freeVector and projVector or cosine of the angle between these FT_F2Dot14 unit vectors used to be scaled up by 4 and routinely occupied 32 bits in an FT_Long field F_dot_P. This patch scales the value down by 2^14 instead, which simplifies its use throughout the bytecode interpreter. This does not lead to the loss of precision because the lower bits are unreliable anyway. Consider two unit vectors (1,0) and (.6,.8) for which the true value of F_dot_P is .6 * 0x40000000 = 0x26666666. These vectors are stored as (0x4000,0) and (0x2666,0x3333) after rounding and F_dot_P is assigned 0x26660000. The lower bits were already lost while rounding the unit vector components. Besides code simplification, this change can lead to better performance when FT_MulDiv with the scaled-down F_dot_P is less likely to use the costly 64-bit path. We are not changing the type of F_dot_P to FT_F2Dot14 at this point. * src/truetype/ttinterp.c (Compute_Funcs): Scale F_dot_P down by 14 bits and modify its use accordingly. (Direct_Move, Direct_Move_Orig, Compute_Point_Displacement): Modify the use of F_dot_P field. * src/truetype/ttobjs.c (tt_size_run_fpgm): Change arbitrary assignment of F_dot_P to its theoretical maximum in case we decide to scale back its type later.
Werner Lemberg 4d3a1e6c 2012-12-05T06:32:57 Formatting.
Alexei Podtelezhnikov 4ae9cbb0 2012-12-01T23:36:02 [truetype, type1] Revise the use of FT_MulDiv. * src/truetype/ttgxvar.c: Updated. * src/truetype/ttobjs.c: Updated. * src/type1/t1load.c: Updated.
suzuki toshiya 6c7c3de1 2012-06-14T01:38:20 [truetype] Add new versions of NEC FA family to tricky font list. NEC FA family dated in 1996 have different checksum. Reported by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>; see http://lists.gnu.org/archive/html/freetype-devel/2012-06/msg00023.html * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): 4 sets of fpgm & prep table checksums for FA-Gothic, FA-Minchou, FA-RoundedGothicM, FA-RoundedGothicB are added. The family names in sample PDF are truncated, thus the list of the family names in tt_check_trickyness_family() is not updated yet.
Werner Lemberg c52f44d4 2011-11-30T10:46:53 Whitespace.
Werner Lemberg 70cf8c5e 2011-11-26T20:09:39 Improve tracing. * src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c (PCF_Face_Done): Remove tracing message. * src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c (cid_face_init), src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add `greeting' message. * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c (T42_Open_Face): Improve tracing.
Werner Lemberg 930e9bf8 2011-11-26T13:38:26 Add new error code FT_Err_Missing_Module. Previously, FreeType misleadingly returned FT_Err_Unknown_File_Format if a module was missing (or a test was missing completely). * include/freetype/fterrdef.h (FT_Err_Missing_Module): Define. * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c (cid_face_init), src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init), src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init, T42_Driver_Init): Updated. * src/type1/t1afm.c (T1_Read_Metrics), src/type/t1objs.c (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Remove now redundant test for `psaux'.
Werner Lemberg f4b63326 2011-07-03T11:24:46 Fix previous commit. We want to unset FT_FACE_FLAG_SCALABLE only if there are bitmap strikes in the font. * src/truetype/ttobjs.c (tt_face_init): Implement it. * docs/CHANGES: Updated.
Just Fill Bugs 07598339 2011-07-02T18:41:36 Fix Savannah bug #33246. * src/truetype/ttobjs.c (tt_check_single_notdef): New function. (tt_face_init): Use it to test FT_FACE_FLAG_SCALABLE.
Daniel Zimmermann 3ad8f355 2011-05-24T06:22:32 Reduce warnings for MS Visual Studio 2010. * src/autofit/afhints.c (af_glyph_hints_get_num_segments, af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide return value. * src/cff/cffgload.c (cff_slot_load): Add cast. * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper loop variable type.
suzuki toshiya 58cb3593 2011-05-01T00:47:43 [truetype] Recalculate the sfnt table checksum always. * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate the sfnt table checksum even if non-zero value is writte in the TrueType font header. Some bad PDF generators write wrong values. For detail, see examples and benchmark tests of the latency by recalculation: http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html
suzuki toshiya 1e89d15a 2011-04-30T17:55:57 [truetype] Register a set of tricky fonts, NEC FA family. * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Add 8 checksum sets for NEC FA family. For the tricky fonts without some tables (e.g. NEC FA fonts lack cvt table), extra check is added to assure that 0-length table in the registry is not included in the font.
suzuki toshiya 10385e37 2011-04-30T17:49:45 Remove unrequired `else' from ttobjs.c::tt_get_sfnt_checksum().
suzuki toshiya 89208861 2011-04-30T00:11:07 [truetype] Fix a bug in the sfnt table checksum getter. * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Check the return value of face->goto_table() correctly.
suzuki toshiya 86b7b2f6 2011-04-26T03:46:12 [truetype] Revert the reordering of trickyness checking. Trickyness check by the family name is faster than that by the checksum.
suzuki toshiya abc47aa1 2011-04-25T23:51:04 [truetype] Always check the checksum to identify tricky fonts. Some PDF generators mangle the family name badly, prioritize the check by the sfnt table checksums than the check by the family name. For sample PDF, see http://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html * src/truetype/ttobjs.c (tt_check_trickyness): Exchange the order of tt_check_trickyness_family() and tt_check_trickyness_sfnt_ids().
Werner Lemberg 18931a5a 2011-02-01T07:08:43 [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also. * src/truetype/ttgload.c (tt_loader_init): Handle `FT_LOAD_PEDANTIC'. * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep, tt_size_init_bytecode, tt_size_ready_bytecode): New argument to handle pedantic mode. * src/truetype/ttobjs.h: Updated.
Werner Lemberg 9871b849 2010-11-22T19:30:41 Some formatting and improvements of comments.
suzuki toshiya 9f5dd61b 2010-11-23T02:47:10 [truetype] Identify the tricky fonts by cvt/fpgm/prep checksums. Some Latin TrueType fonts are still expected to be unhinted. Fix Savannah bug #31645. * src/truetype/ttobjs.c (tt_check_trickyness): Divided to... (tt_check_trickyness_family): this checking family name, and (tt_check_trickyness_sfnt_ids): this checking cvt/fpgm/prep. (tt_get_sfnt_checksum): Function to retrieve the sfnt checksum for specified subtable even if cleared by lazy PDF generators. (tt_synth_sfnt_checksum): Function to calculate the checksum.
Werner Lemberg 6abb9232 2010-09-14T09:02:10 Improve tracing messages. * src/truetype/ttinterp.c (TT_RunIns): Improve wording of tracing message. * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Add tracing message. * src/truetype/ttgload.c (tt_loader_init): Add tracing message. * src/cache/ftcsbits.c (ftc_snode_load): Emit tracing message if glyph doesn't fit into a small bitmap container.
suzuki toshiya 0eb9b1f5 2010-08-28T21:41:16 Force hinting when the font lacks its familyname. In Type42 or Type11 font embedded in PostScript & PDF, TrueType sfnt stream may lack `name' table because they are not required. Hinting for nameless fonts is safer for PDFs including embedded Chinese fonts. Written by David Bevan, see: http://lists.gnu.org/archive/html/freetype-devel/2010-08/msg00021.html http://lists.freedesktop.org/archives/poppler/2010-August/006310.html * src/truetype/ttobjs.c (tt_check_trickyness): If a NULL pointer by nameless font is given, TRUE is returned to enable hinting.
suzuki toshiya 8b05b5d8 2010-08-28T21:16:26 Register yet another tricky TrueType font. * src/truetype/ttobjs.c (tt_check_trickyness): Add `HuaTianKaiTi?', a Kaishu typeface paired with `HuaTianSongTi?' by Huatian Information Industry.
Werner Lemberg 46e05c44 2009-07-17T22:49:34 Fix Savannah bug #23786. * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem and y_ppem. Otherwise the `*_CVT_Stretched' functions in ttinterp.c get never called. An anonymous guy suggested this change on Savannah, and it seems to be the right solution.
Oran Agra 2e7a4e9b 2009-04-05T18:03:02 Position Independent Code (PIC) support in truetype driver. * include/freetype/internal/services/svmm.h add macros to init instances of FT_Service_MultiMastersRec. * include/freetype/internal/services/svttglyf.h add macros to init instances of FT_Service_TTGlyfRec. * src/truetype/ttdriver.h declare tt_driver_class using macros from ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy functions will be declared. * src/truetype/ttdriver.c when FT_CONFIG_OPTION_PIC is defined the following structs: tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class and tt_services array, will have functions to init or create and destroy them instead of being allocated in the global scope. And macros will be used from ttpic.h in order to access them from the pic_container. * src/truetype/ttobjs.c change trick_names array to be PIC-compatible by being a two dimentional array rather than array of pointers. New Files: * src/truetype/ttpic.h declare struct to hold PIC globals for truetype driver and macros to access them. * src/truetype/ttpic.c implement functions to allocate, destroy and initialize PIC globals for truetype driver. * src/truetype/truetype.c add new file to build: ttpic.c. * src/truetype/jamfile add new files to FT2_MULTI build: ttpic.c.
Werner Lemberg 86e041b5 2009-03-21T08:51:44 Remove redundant header inclusions. This covers many Ghostscript Coverity issues. * src/*: Do it.
Werner Lemberg 0552a496 2009-02-11T22:59:40 * src/truetype/ttobjs.c (tt_check_trickyness): Add `DFKaiShu'. Reported by David Bevan <dbevan@emtex.com>.
Werner Lemberg b972a2a2 2008-12-11T08:55:48 Generalize the concept of `tricky' fonts by introducing FT_FACE_FLAG_TRICKY to indicate that the font format's hinting engine is necessary for correct rendering. At the same time, slightly modify the behaviour of tricky fonts: FT_LOAD_NO_HINTING is now ignored. To really force raw loading of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT must be used. Finally, tricky TrueType fonts always use the bytecode interpreter even if the patented code is used. * include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY): New macros. * src/truetype/ttdriver.c (Load_Glyph): Handle new load flags semantics as described above. * src/truetype/ttobjs.c (tt_check_trickyness): New function, using code of ... (tt_face_init): This function, now simplified and updated to new semantics. * src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky fonts. * docs/CHANGES: Document it.
Werner Lemberg d03d856d 2008-10-01T22:39:05 * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c (cff_face_done), src/pfr/pfrobjs.c (pfr_face_done), src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c (cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done), src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0. Reported by Graham Asher.
Werner Lemberg a2f17cc1 2008-05-17T10:01:45 * docs/CHANGES: Updated. Improve support for WGL4 encoded fonts. * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): New macro. (ft_wgl_extra_unicodes, ft_wgl_extra_glyph_names, ft_wgl_extra_glyph_name_offsets): New arrays. (ps_check_wgl_name, ps_check_wgl_unicode): New functions. (ps_unicodes_init): Use them to add additional Unicode mappings.
Werner Lemberg d496b926 2007-12-04T21:49:59 * src/truetype/ttobjs.c (tt_face_init): Don't use logical OR to concatenate error codes.
Werner Lemberg 6ff2ff57 2007-05-24T19:39:14 * src/truetype/ttobjs.h (tt_size_ready_bytecode): Move declaration into TT_USE_BYTECODE_INTERPRETER preprocessor block. * src/truetype/ttobjs.c (tt_size_ready_bytecode) [!TT_USE_BYTECODE_INTERPRETER]: Removed. Unused.
Werner Lemberg 56ceaa48 2007-05-14T18:53:58 Formatting.
David Turner a8b45e61 2007-05-11T14:10:30 fix a typo that force CVT scaling to be re-run on each glyph load
Werner Lemberg 3d92f08b 2007-03-06T11:59:24 * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper macro for `strstr'. * src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning `trick_names', as suggested by Ivan Nincic.
David Turner 91aaf326 2007-03-05T18:18:52 bugfix: do not erase root x_ppem and y_ppem values in tt_size_init_bytecode
David Turner 741a17e8 2007-01-23T16:14:38 * src/truetype/ttobjs.c: fixed typo that prevented compilation when disabling both the unpatented and the bytecode interpreter in the TrueType font driver
Werner Lemberg b4142d51 2007-01-17T12:45:26 Whitespace and spelling fixes from Alexei. Formatting, copyright years.
David Turner 22122729 2007-01-16T20:06:44 * src/autofit/aflatin.c, src/cff/cffdriver.c, src/truetype/ttobjs.c, src/truetype/ttinterp.c: fixing compiler warnings
Werner Lemberg f6294399 2007-01-06T07:47:45 formatting, copyright years
David Turner 384be234 2007-01-05T15:32:01 * src/truetype/ttobjs.h, src/truetype/ttobjs.c, src/truetype/ttgload.c: do not allocate interpreter-specific tables in memory if we're not going to load glyphs with it anyway.
David Turner 80658e50 2006-11-28T08:09:20 * src/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch * src/smooth/ftgrays.c: remove hard-coded error values, use FreeType ones instead * src/autofit/afhints.c (af_glyph_hints_dump_segments): remove unused variable
Werner Lemberg 8636c29a 2006-11-26T22:28:13 * src/truetype/ttobjs.c (tt_face_init): Protect against NULL pointer.
Werner Lemberg 046bf8b0 2006-10-03T08:43:42 formatting
David Turner df430e1a 2006-10-01T00:09:35 * include/freetype/internal/ftobjs.h, src/base/ftobjs.c, src/truetype/ttobjs.c: fixes related to the unpatented hinter
David Turner ad830716 2006-09-27T16:20:59 * include/freetype/internal/ftobjs.h, src/truetype/ttobjs.c, src/base/ftobjs.c: fixed a bug in the automatic unpatented hinting support which prevented normal bytecode hinting to work properly * src/autofit/aftypes.h: undefining AF_DEBUG to get rid of traces
David Turner f3050059 2006-09-11T12:00:32 * src/sfnt/sfobjs.c (tt_face_get_name): support some function which report their English names through an Apple Roman (platform,encoding) pair, with language_id != English if the font uses another name entry with language_id == English, it will be selected correctly though. * src/truetype/ttobjs.c: add unpatent-hinting selection for "mingli.ttf"
Werner Lemberg 2d8629b3 2006-09-03T06:18:45 * devel/ftoption.h: Synchronize with include/freetype/config/ftoption.h. * src/smooth/ftgrays.c (gray_record_cell): Remove shadowing variable declaration. (gray_convert_glyph): Fix compiler warnings. Formatting, copyright years.