src/truetype/ttsubpix.h


Log

Author Commit Date CI Message
Werner Lemberg 563ae780 2017-01-04T20:16:34 Update copyright year.
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 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_'.
Werner Lemberg 1f7a4e1f 2015-02-17T10:17:56 [truetype] Finish compiler warning fixes for signedness issues. * src/truetype/ttgxvar.c, src/truetype/ttsubpix.c, src/truetype/ttsubpix.h: Apply.
Werner Lemberg f57fc59e 2015-01-17T20:41:43 Run `src/tools/update-copyright'.
Infinality 63bfa832 2013-05-20T07:38:21 [truetype] Simplify and improve subpixel function detection. Some small enhancements have allowed the removal of many macros and the simplification of existing rules in `ttsubpix.c'. * src/truetype/ttsubpix.h (SPH_TWEAK_ALLOW_X_DMOVEX, SPH_TWEAK_ALLOW_X_MOVE_ZP2, SPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES, SPH_TWEAK_SKIP_INLINE_DELTAS, SPH_TWEAK_MIRP_CVT_ZERO): Removed. (SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP): New rule macro. * src/truetype/ttsubpix.c: Updated affected rules. * src/truetype/ttinterp.c (Direct_Move_X): Updated. (INS_FDEF): Add additional function detection. (INS_ENDF): Set runtime flag. (Ins_CALL): Skip the call under certain conditions. Remove bad code. (Ins_LOOPCALL): Skip the call under certain conditions. Remove bad code. (Move_Zp2_Point): Updated. (Ins_SHPIX): Updated. Skip the move under some situations. (Ins_MIAP): Improve conditions. (Ins_MIRP): Updated. (Ins_DELTAP): Skip move under certain conditions. Simplify conditions. (TT_RunIns): Updated. Add code to handle new function detection. Trace messages.
Werner Lemberg 6b9034f0 2013-01-28T13:56:23 Formatting, comment improvements.
Infinality a5fe3595 2013-01-26T12:29:52 [truetype] Align more to ClearType whitepaper for sph.
David 'Digit' Turner 72447195 2013-01-25T00:36:35 [truetype] Fix C++ compilation. * src/truetype/ttsubpix.h: Updated. (SPH_X_SCALING_RULES_SIZE): Moved and renamed to... * src/truetype/ttsubpix.c (X_SCALING_RULES_SIZE): This. (sph_X_SCALING_Rules): Removed. (scale_test_tweak): Make function static. (sph_test_tweak_x_scaling): New function. * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Updated.
Werner Lemberg 71900980 2013-01-16T20:08:35 Minor.
David Turner 3a406127 2013-01-16T19:48:31 [truetype] Improve sub-pixel code. This patches fixes many issues with the ttsubpix implementation. 1. Data tables are defined, instead of declared, in the header, and thus copied into each source file that includes it. 2. These tables were defined as global, mutable, visible variables, and thus costing private RAM to every process that loads the library (> 50 KB / process, this is huge!). Additionally, this also made the library export the symbols completely needlessly. 3. Missing `sph_' and `SPH_' prefixes to some of the definitions. Note that this doesn't try to fix the incredibly inefficient storage format for the data tables used by the code. This one will require another pass in the future. * src/truetype/ttinterp.h (MAX_NAME_SIZE, MAX_CLASS_MEMBERS): Renamed to... (SPH_MAX_NAME_SIZE, SPH_MAX_CLASS_MEMBERS): This. Update all users. (SPH_TweakRule, SPH_ScaleRule): Decorate with `const' where appropriate. (Font_Class): Rename to... (SPH_Font_Class): This. Decorate with `const' where appropriate. * src/truetype/ttsubpix.h (scale_test_tweak, sph_test_tweak): Decorate arguments with `const' where appropriate. Move font tweaking tables to... * src/truetype/ttsubpic.c: This file and decorate them with `static' and `const' where appropriate. (X_SCALING_Rules, X_SCALING_RULES_SIZE): Renamed to... (spu_X_SCALING_Rules, SPH_X_SCALING_RULES_SIZE): This. Update all users.
Infinality 71f242c2 2012-12-16T19:52:01 [truetype ] Remove unusued code. Add minor fixes.
Infinality d0a827b3 2012-06-28T20:34:26 [truetype] Fix various artifacts.
Infinality 79e36bae 2012-06-18T10:36:06 [truetype] Support subpixel hinting. This is the large, famous `Infinality' patch to support ClearType bytecode which has been available from http://www.infinality.net/blog/ for some time, and which has been refined over the last years. While still experimental, it is now mature enough to be included directly into FreeType. Most of the code is based on the ClearType whitepaper written by Greg Hitchcock http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx which gives a detailed overview of the necessary changes to the Microsoft rasterizer so that older fonts are supported. However, a lot of details are still missing, and this patches provides a framework to easily handle rendering issues down to the glyph level of certain fonts. Note that ClearType support is not completely implemented! In particular, full support for the options `compatible_widths', `symmetrical_smoothing, and `bgr' (via the GETINFO bytecode instruction) is missing. * src/truetype/ttsubpix.c: New file, providing code to handle `tweaks', this is, rules for certain glyphs in certain fonts (including wildcards) which need a special treatment. * src/truetype/ttsubpix.h: New file, holding the tweaking rules. * include/freetype/config/ftoption.h, src/devel/ftoption.h (TT_CONFIG_OPTION_SUBPIXEL_HINTING): New macro. * include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID, FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): New macros. * src/truetype/truetype.c [TT_USE_BYTECODE_INTERPRETER]: Include `ttsubpix.c'. * src/truetype/ttgload.c: Include `ttsubpix.h'. [All changes below are guarded by TT_CONFIG_OPTION_SUBPIXEL_HINTING.] (tt_get_metrics): Set tweak flags. (TT_Hint_Glyph): Call `FT_Outline_EmboldenXY' if necessary. (TT_Process_Simple_Glyph): Compensate emboldening if necessary. (compute_glyph_metrics): Handle `compatible widths' option. (tt_loader_init): Handle ClearType GETINFO information bits. * src/truetype/rules.mk (TT_DRC_SRC): Updated. * src/truetype/ttinterp.c: Include `ttsubpix.h'. [Where necessary, changes below are guarded by TT_CONFIG_OPTION_SUBPIXEL_HINTING.] (Direct_Move, Direct_Move_X): Extended. (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid, Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45, SetSuperRound): Add parameter to handle the number of grid lines per pixel. (SET_SuperRound, ROUND_None, CUR_Func_round): Updated. (DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated. (DO_ROUND, DO_NROUND): Updated. (DO_RS): Take care of `Typeman' bytecode patterns. (Ins_FDEF): Add some debugging code. Commented out. (Ins_ENDF): Restore state. (Ins_CALL, Ins_LOOPCALL): Handle inline delta functions. (Ins_MD): Handle `Vacuform' rounds. (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP, Ins_MDRP, Ins_MIRP): Handle tweaks. (Ins_ALIGNRP): Add tweak guard. (Ins_IUP, Ins_DELTAP): Handle tweaks. (Ins_GETINFO): Handle new ClearType bits. (TT_RunIns): Handle tweaks. * src/truetype/ttinterp.h: Updated. (SPH_TweakRule, SPH_ScaleRule): New structures for tweaks. (TT_ExecContextRec): Add members for subpixel hinting support. * src/truetype/ttobjs.h (TT_DefRecord): Add `inline_delta' member.