summaryrefslogtreecommitdiff
path: root/src/truetype/ttsubpix.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year.Werner Lemberg2018-01-021-1/+1
|
* Update copyright year.Werner Lemberg2017-01-041-1/+1
|
* [truetype] New implementation of v38 bytecode interpreter [1/3].Nikolaus Waxweiler2016-05-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update copyright year.Werner Lemberg2016-01-131-1/+1
|
* Don't use macro names that contain `__' [1/2].Werner Lemberg2016-01-121-3/+4
| | | | | | Such macro names are reserved for both C and C++. */*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
* [truetype] Finish compiler warning fixes for signedness issues.Werner Lemberg2015-02-171-20/+20
| | | | | * src/truetype/ttgxvar.c, src/truetype/ttsubpix.c, src/truetype/ttsubpix.h: Apply.
* Run `src/tools/update-copyright'.Werner Lemberg2015-01-171-1/+1
|
* [truetype] Simplify and improve subpixel function detection.Infinality2013-05-201-31/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Formatting, comment improvements.Werner Lemberg2013-01-281-8/+8
|
* [truetype] Align more to ClearType whitepaper for sph.Infinality2013-01-261-0/+15
|
* [truetype] Fix C++ compilation.David 'Digit' Turner2013-01-251-12/+5
| | | | | | | | | | | * 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.
* Minor.Werner Lemberg2013-01-161-31/+2
|
* [truetype] Improve sub-pixel code.David Turner2013-01-161-792/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [truetype ] Remove unusued code. Add minor fixes.Infinality2012-12-161-25/+31
|
* [truetype] Fix various artifacts.Infinality2012-06-281-11/+16
|
* [truetype] Support subpixel hinting.Infinality2012-06-181-0/+897
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.