diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2018-05-24 22:38:24 -0400 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2018-05-24 22:38:24 -0400 |
commit | 7b73cb0707586e7988efdd07a1dfe690c3036ca1 (patch) | |
tree | c7bc982a466473c0ec5e0eb14664abd60fc16dfc /include | |
parent | 3fcb4cfa26e697c8c643bfc7e46b03f013394fa1 (diff) | |
download | freetype2-7b73cb0707586e7988efdd07a1dfe690c3036ca1.tar.gz |
[smooth] Formalize Harmony LCD rendering.
This generalizes magic outline shifts that make Harmony LCD
rendering work in terms of precise two-dimensional RGB subpixel
positions. These coordinates are now set in time of the `smooth'
module initialization and later used to shift a glyph outline for
rendering. FT_RENDER_MODE_LCD and FT_RENDER_MODE_LCD_V use the same
coordinates. The letter, however, rotates them before using.
The LCD bitmap padding is also calculated using these coordinates.
* include/freetype/internal/ftobjs.h (FT_LibraryRec): New array field
`lcd_geometry'.
* src/base/ftlcdfil.c (ft_lcd_padding): Reworked.
* src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Updated accordingly.
* src/smooth/ftsmooth.c [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]
(ft_smooth_init): Initialize `lcd_geometry'.
(ft_smooth_render_generic): Formalize outline shifts.
Diffstat (limited to 'include')
-rw-r--r-- | include/freetype/internal/ftobjs.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index a8d987fcc..77f5dc463 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -270,11 +270,11 @@ FT_BEGIN_HEADER FT_CMap_Done( FT_CMap cmap ); - /* adds LCD padding to Min and Max boundaries */ + /* add LCD padding to CBox */ FT_BASE( void ) - ft_lcd_padding( FT_Pos* Min, - FT_Pos* Max, - FT_GlyphSlot slot ); + ft_lcd_padding( FT_BBox* cbox, + FT_GlyphSlot slot, + FT_Render_Mode mode ); #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING @@ -350,8 +350,8 @@ FT_BEGIN_HEADER /* */ /* lcd_weights :: */ /* lcd_filter_func :: */ - /* If subpixel rendering is activated, the LCD filtering weights */ - /* and callback function. */ + /* These fields specify the LCD filtering weights and callback */ + /* function for ClearType-style subpixel rendering. */ /* */ /* refcount :: */ /* A counter initialized to~1 at the time an @FT_Face structure is */ @@ -868,11 +868,15 @@ FT_BEGIN_HEADER /* interpreter. Currently, only the TrueType */ /* bytecode debugger uses this. */ /* */ - /* lcd_weights :: If subpixel rendering is activated, the LCD */ - /* filter weights, if any. */ + /* lcd_weights :: The LCD filter weights for ClearType-style */ + /* subpixel rendering. */ /* */ - /* lcd_filter_func :: If subpixel rendering is activated, the LCD */ - /* filtering callback function. */ + /* lcd_filter_func :: The LCD filtering callback function for */ + /* for ClearType-style subpixel rendering. */ + /* */ + /* lcd_geometry :: This array specifies LCD subpixel geometry */ + /* and controls Harmony LCD rendering technique, */ + /* alternative to ClearType. */ /* */ /* pic_container :: Contains global structs and tables, instead */ /* of defining them globally. */ @@ -904,6 +908,8 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */ FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */ +#else + FT_Vector lcd_geometry[3]; /* RGB subpixel positions */ #endif FT_Int refcount; |