2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* ftsmooth.c
|
|
|
|
*
|
|
|
|
* Anti-aliasing renderer interface (body).
|
|
|
|
*
|
2022-01-11 10:54:10 +01:00
|
|
|
* Copyright (C) 2000-2022 by
|
2018-06-03 09:01:17 +02:00
|
|
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
|
|
*
|
|
|
|
* This file is part of the FreeType project, and may only be used,
|
|
|
|
* modified, and distributed under the terms of the FreeType project
|
|
|
|
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
|
|
* this file you indicate that you have read the license and
|
|
|
|
* understand and accept it fully.
|
|
|
|
*
|
|
|
|
*/
|
2000-07-02 02:27:53 +02:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/internal/ftdebug.h>
|
|
|
|
#include <freetype/internal/ftobjs.h>
|
|
|
|
#include <freetype/ftoutln.h>
|
2001-03-20 12:14:24 +01:00
|
|
|
#include "ftsmooth.h"
|
|
|
|
#include "ftgrays.h"
|
2000-07-02 02:27:53 +02:00
|
|
|
|
Complete redesign of error codes. Please check ftmoderr.h for more
details.
* include/freetype/internal/cfferrs.h,
include/freetype/internal/tterrors.h,
include/freetype/internal/t1errors.h: Removed. Replaced with files
local to the module. All extra error codes have been moved to
`fterrors.h'.
* src/sfnt/ttpost.h: Move error codes to `fterrors.h'.
* src/autohint/aherrors.h, src/cache/ftcerror.h, src/cff/cfferrs.h,
src/cid/ciderrs.h, src/pcf/pcferror.h, src/psaux/psauxerr.h,
src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
src/type1/t1errors.h, src/winfonts/fnterrs.h: New files defining the
error names for the module it belongs to.
* include/freetype/ftmoderr.h: New file, defining the module error
offsets. Its structure is similar to `fterrors.h'.
* include/freetype/fterrors.h (FT_NOERRORDEF): New macro.
(FT_ERRORDEF): Redefined to use module error offsets.
All internal error codes are now public; unused error codes have
been removed, some are new.
* include/freetype/config/ftheader.h (FT_MODULE_ERRORS_H): New
macro.
* include/freetype/config/ftoption.h
(FT_CONFIG_OPTION_USE_MODULE_ERRORS): New macro.
All other source files have been updated to use the new error codes;
some already existing (internal) error codes local to a module have
been renamed to give them the same name as in the base module.
All make files have been updated to include the local error files.
* src/cid/cidtokens.h: Replaced with...
* src/cid/cidtoken.h: This file for 8+3 consistency.
* src/raster/ftraster.c: Use macros for header file names.
2001-06-06 19:30:41 +02:00
|
|
|
#include "ftsmerrs.h"
|
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
/* sets render-specific mode */
|
2001-06-28 01:25:46 +02:00
|
|
|
static FT_Error
|
|
|
|
ft_smooth_set_mode( FT_Renderer render,
|
|
|
|
FT_ULong mode_tag,
|
|
|
|
FT_Pointer data )
|
2000-06-28 01:18:39 +02:00
|
|
|
{
|
|
|
|
/* we simply pass it to the raster */
|
2000-07-02 02:27:53 +02:00
|
|
|
return render->clazz->raster_class->raster_set_mode( render->raster,
|
|
|
|
mode_tag,
|
|
|
|
data );
|
2000-07-09 21:15:30 +02:00
|
|
|
}
|
2000-06-28 01:18:39 +02:00
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
/* transform a given glyph image */
|
2001-06-28 01:25:46 +02:00
|
|
|
static FT_Error
|
* include/freetype/ftimage.h (FT_Raster_RenderFunc),
include/freetype/ftrender.h (FT_Glyph_TransformFunc,
FT_Renderer_Render_Func, FT_Renderer_TransformFunc),
src/base/ftglyph.c (ft_outline_glyph_transform),
src/raster/ftrend1.c (ft_raster1_transform, ft_raster1_render),
src/smooth/ftgrays.c (FT_Outline_Decompose, gray_raster_render),
src/smooth/ftsmooth.c (ft_smooth_transform,
ft_smooth_render_generic, ft_smooth_render, ft_smooth_render_lcd,
ft_smooth_render_lcd_v): Decorate parameters with `const' where
appropriate.
* src/raster/ftraster.c (RASTER_RENDER_POOL): Removed. Obsolete.
(ft_black_render): Decorate parameters with `const' where
appropriate.
* src/sfnt/ttcmap.c (tt_cmap4_set_range): Fix typo (FT_PEEK_SHORT ->
FT_PEEK_USHORT) which caused crashes. Reported by Ismail Donmez
<ismail@kde.org.tr>.
2005-05-11 22:04:35 +02:00
|
|
|
ft_smooth_transform( FT_Renderer render,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
const FT_Matrix* matrix,
|
|
|
|
const FT_Vector* delta )
|
2000-06-28 01:18:39 +02:00
|
|
|
{
|
2013-03-14 11:21:17 +01:00
|
|
|
FT_Error error = FT_Err_Ok;
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
|
|
|
|
if ( slot->format != render->glyph_format )
|
2000-06-28 01:18:39 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2000-06-28 01:18:39 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
if ( matrix )
|
2000-06-28 01:18:39 +02:00
|
|
|
FT_Outline_Transform( &slot->outline, matrix );
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
if ( delta )
|
2000-06-28 01:18:39 +02:00
|
|
|
FT_Outline_Translate( &slot->outline, delta->x, delta->y );
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-06-28 01:18:39 +02:00
|
|
|
Exit:
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
|
|
|
|
/* return the glyph's control box */
|
2001-06-28 01:25:46 +02:00
|
|
|
static void
|
|
|
|
ft_smooth_get_cbox( FT_Renderer render,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
FT_BBox* cbox )
|
2000-06-28 01:18:39 +02:00
|
|
|
{
|
2016-09-28 19:10:52 +02:00
|
|
|
FT_ZERO( cbox );
|
2000-06-28 01:18:39 +02:00
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
if ( slot->format == render->glyph_format )
|
2000-06-28 01:18:39 +02:00
|
|
|
FT_Outline_Get_CBox( &slot->outline, cbox );
|
2000-07-09 21:15:30 +02:00
|
|
|
}
|
|
|
|
|
2020-07-03 15:17:22 +02:00
|
|
|
typedef struct TOrigin_
|
|
|
|
{
|
|
|
|
unsigned char* origin; /* pixmap origin at the bottom-left */
|
|
|
|
int pitch; /* pitch to go down one row */
|
|
|
|
|
|
|
|
} TOrigin;
|
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
|
|
|
|
|
|
|
/* initialize renderer -- init its raster */
|
|
|
|
static FT_Error
|
|
|
|
ft_smooth_init( FT_Renderer render )
|
|
|
|
{
|
|
|
|
FT_Vector* sub = render->root.library->lcd_geometry;
|
|
|
|
|
|
|
|
|
|
|
|
/* set up default subpixel geometry for striped RGB panels. */
|
|
|
|
sub[0].x = -21;
|
|
|
|
sub[0].y = 0;
|
|
|
|
sub[1].x = 0;
|
|
|
|
sub[1].y = 0;
|
|
|
|
sub[2].x = 21;
|
|
|
|
sub[2].y = 0;
|
|
|
|
|
|
|
|
render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-03 15:17:22 +02:00
|
|
|
/* This function writes every third byte in direct rendering mode */
|
|
|
|
static void
|
|
|
|
ft_smooth_lcd_spans( int y,
|
|
|
|
int count,
|
|
|
|
const FT_Span* spans,
|
|
|
|
TOrigin* target )
|
|
|
|
{
|
|
|
|
unsigned char* dst_line = target->origin - y * target->pitch;
|
|
|
|
unsigned char* dst;
|
|
|
|
unsigned short w;
|
|
|
|
|
|
|
|
|
|
|
|
for ( ; count--; spans++ )
|
|
|
|
for ( dst = dst_line + spans->x * 3, w = spans->len; w--; dst += 3 )
|
|
|
|
*dst = spans->coverage;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
static FT_Error
|
|
|
|
ft_smooth_raster_lcd( FT_Renderer render,
|
|
|
|
FT_Outline* outline,
|
|
|
|
FT_Bitmap* bitmap )
|
|
|
|
{
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Vector* sub = render->root.library->lcd_geometry;
|
|
|
|
FT_Pos x, y;
|
|
|
|
|
|
|
|
FT_Raster_Params params;
|
2020-07-03 15:17:22 +02:00
|
|
|
TOrigin target;
|
2020-07-03 15:02:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Render 3 separate coverage bitmaps, shifting the outline. */
|
2020-07-03 15:17:22 +02:00
|
|
|
/* Set up direct rendering to record them on each third byte. */
|
|
|
|
params.source = outline;
|
|
|
|
params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
|
|
|
|
params.gray_spans = (FT_SpanFunc)ft_smooth_lcd_spans;
|
|
|
|
params.user = ⌖
|
|
|
|
|
|
|
|
params.clip_box.xMin = 0;
|
|
|
|
params.clip_box.yMin = 0;
|
|
|
|
params.clip_box.xMax = bitmap->width;
|
|
|
|
params.clip_box.yMax = bitmap->rows;
|
|
|
|
|
|
|
|
if ( bitmap->pitch < 0 )
|
|
|
|
target.origin = bitmap->buffer;
|
|
|
|
else
|
|
|
|
target.origin = bitmap->buffer
|
|
|
|
+ ( bitmap->rows - 1 ) * (unsigned int)bitmap->pitch;
|
|
|
|
|
|
|
|
target.pitch = bitmap->pitch;
|
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
FT_Outline_Translate( outline,
|
|
|
|
-sub[0].x,
|
|
|
|
-sub[0].y );
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
x = sub[0].x;
|
|
|
|
y = sub[0].y;
|
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
2020-07-03 15:17:22 +02:00
|
|
|
target.origin++;
|
2020-07-03 15:02:09 +02:00
|
|
|
FT_Outline_Translate( outline,
|
|
|
|
sub[0].x - sub[1].x,
|
|
|
|
sub[0].y - sub[1].y );
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
x = sub[1].x;
|
|
|
|
y = sub[1].y;
|
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
2020-07-03 15:17:22 +02:00
|
|
|
target.origin++;
|
2020-07-03 15:02:09 +02:00
|
|
|
FT_Outline_Translate( outline,
|
|
|
|
sub[1].x - sub[2].x,
|
|
|
|
sub[1].y - sub[2].y );
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
x = sub[2].x;
|
|
|
|
y = sub[2].y;
|
|
|
|
|
|
|
|
Exit:
|
|
|
|
FT_Outline_Translate( outline, x, y );
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Error
|
|
|
|
ft_smooth_raster_lcdv( FT_Renderer render,
|
|
|
|
FT_Outline* outline,
|
|
|
|
FT_Bitmap* bitmap )
|
|
|
|
{
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
int pitch = bitmap->pitch;
|
|
|
|
FT_Vector* sub = render->root.library->lcd_geometry;
|
|
|
|
FT_Pos x, y;
|
|
|
|
|
|
|
|
FT_Raster_Params params;
|
|
|
|
|
|
|
|
|
|
|
|
params.target = bitmap;
|
|
|
|
params.source = outline;
|
|
|
|
params.flags = FT_RASTER_FLAG_AA;
|
|
|
|
|
|
|
|
/* Render 3 separate coverage bitmaps, shifting the outline. */
|
|
|
|
/* Notice that the subpixel geometry vectors are rotated. */
|
|
|
|
/* Triple the pitch to render on each third row. */
|
|
|
|
bitmap->pitch *= 3;
|
|
|
|
bitmap->rows /= 3;
|
|
|
|
|
|
|
|
FT_Outline_Translate( outline,
|
|
|
|
-sub[0].y,
|
|
|
|
sub[0].x );
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
x = sub[0].y;
|
|
|
|
y = -sub[0].x;
|
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
bitmap->buffer += pitch;
|
|
|
|
FT_Outline_Translate( outline,
|
|
|
|
sub[0].y - sub[1].y,
|
|
|
|
sub[1].x - sub[0].x );
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
x = sub[1].y;
|
|
|
|
y = -sub[1].x;
|
|
|
|
bitmap->buffer -= pitch;
|
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
bitmap->buffer += 2 * pitch;
|
|
|
|
FT_Outline_Translate( outline,
|
|
|
|
sub[1].y - sub[2].y,
|
|
|
|
sub[2].x - sub[1].x );
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
x = sub[2].y;
|
|
|
|
y = -sub[2].x;
|
|
|
|
bitmap->buffer -= 2 * pitch;
|
|
|
|
|
|
|
|
Exit:
|
|
|
|
FT_Outline_Translate( outline, x, y );
|
|
|
|
|
|
|
|
bitmap->pitch /= 3;
|
|
|
|
bitmap->rows *= 3;
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
|
|
|
|
|
|
|
|
/* initialize renderer -- init its raster */
|
|
|
|
static FT_Error
|
|
|
|
ft_smooth_init( FT_Renderer render )
|
|
|
|
{
|
|
|
|
/* set up default LCD filtering */
|
|
|
|
FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT );
|
|
|
|
|
|
|
|
render->clazz->raster_class->raster_reset( render->raster, NULL, 0 );
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Error
|
|
|
|
ft_smooth_raster_lcd( FT_Renderer render,
|
|
|
|
FT_Outline* outline,
|
|
|
|
FT_Bitmap* bitmap )
|
|
|
|
{
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Vector* points = outline->points;
|
|
|
|
FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
|
|
|
|
FT_Vector* vec;
|
|
|
|
|
|
|
|
FT_Raster_Params params;
|
|
|
|
|
|
|
|
|
|
|
|
params.target = bitmap;
|
|
|
|
params.source = outline;
|
|
|
|
params.flags = FT_RASTER_FLAG_AA;
|
|
|
|
|
|
|
|
/* implode outline */
|
|
|
|
for ( vec = points; vec < points_end; vec++ )
|
|
|
|
vec->x *= 3;
|
|
|
|
|
|
|
|
/* render outline into the bitmap */
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
|
|
|
|
/* deflate outline */
|
|
|
|
for ( vec = points; vec < points_end; vec++ )
|
|
|
|
vec->x /= 3;
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Error
|
|
|
|
ft_smooth_raster_lcdv( FT_Renderer render,
|
|
|
|
FT_Outline* outline,
|
|
|
|
FT_Bitmap* bitmap )
|
|
|
|
{
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Vector* points = outline->points;
|
|
|
|
FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
|
|
|
|
FT_Vector* vec;
|
|
|
|
|
|
|
|
FT_Raster_Params params;
|
|
|
|
|
|
|
|
|
|
|
|
params.target = bitmap;
|
|
|
|
params.source = outline;
|
|
|
|
params.flags = FT_RASTER_FLAG_AA;
|
|
|
|
|
|
|
|
/* implode outline */
|
|
|
|
for ( vec = points; vec < points_end; vec++ )
|
|
|
|
vec->y *= 3;
|
|
|
|
|
|
|
|
/* render outline into the bitmap */
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
|
|
|
|
/* deflate outline */
|
|
|
|
for ( vec = points; vec < points_end; vec++ )
|
|
|
|
vec->y /= 3;
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
|
2000-06-28 01:18:39 +02:00
|
|
|
|
2020-07-04 04:29:34 +02:00
|
|
|
/* Oversampling scale to be used in rendering overlaps */
|
|
|
|
#define SCALE ( 1 << 2 )
|
|
|
|
|
|
|
|
/* This function averages inflated spans in direct rendering mode */
|
|
|
|
static void
|
|
|
|
ft_smooth_overlap_spans( int y,
|
|
|
|
int count,
|
|
|
|
const FT_Span* spans,
|
|
|
|
TOrigin* target )
|
|
|
|
{
|
|
|
|
unsigned char* dst = target->origin - ( y / SCALE ) * target->pitch;
|
|
|
|
unsigned short x;
|
|
|
|
unsigned int cover, sum;
|
|
|
|
|
|
|
|
|
|
|
|
/* When accumulating the oversampled spans we need to assure that */
|
|
|
|
/* fully covered pixels are equal to 255 and do not overflow. */
|
|
|
|
/* It is important that the SCALE is a power of 2, each subpixel */
|
|
|
|
/* cover can also reach a power of 2 after rounding, and the total */
|
|
|
|
/* is clamped to 255 when it adds up to 256. */
|
|
|
|
for ( ; count--; spans++ )
|
|
|
|
{
|
|
|
|
cover = ( spans->coverage + SCALE * SCALE / 2 ) / ( SCALE * SCALE );
|
|
|
|
for ( x = 0; x < spans->len; x++ )
|
|
|
|
{
|
2020-07-07 16:58:14 +02:00
|
|
|
sum = dst[( spans->x + x ) / SCALE] + cover;
|
|
|
|
dst[( spans->x + x ) / SCALE] = (unsigned char)( sum - ( sum >> 8 ) );
|
2020-07-04 04:29:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static FT_Error
|
|
|
|
ft_smooth_raster_overlap( FT_Renderer render,
|
|
|
|
FT_Outline* outline,
|
|
|
|
FT_Bitmap* bitmap )
|
|
|
|
{
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Vector* points = outline->points;
|
|
|
|
FT_Vector* points_end = FT_OFFSET( points, outline->n_points );
|
|
|
|
FT_Vector* vec;
|
|
|
|
|
|
|
|
FT_Raster_Params params;
|
|
|
|
TOrigin target;
|
|
|
|
|
|
|
|
|
2020-08-26 05:16:27 +02:00
|
|
|
/* Reject outlines that are too wide for 16-bit FT_Span. */
|
|
|
|
/* Other limits are applied upstream with the same error code. */
|
|
|
|
if ( bitmap->width * SCALE > 0x7FFF )
|
|
|
|
return FT_THROW( Raster_Overflow );
|
|
|
|
|
2020-07-04 04:29:34 +02:00
|
|
|
/* Set up direct rendering to average oversampled spans. */
|
|
|
|
params.source = outline;
|
|
|
|
params.flags = FT_RASTER_FLAG_AA | FT_RASTER_FLAG_DIRECT;
|
|
|
|
params.gray_spans = (FT_SpanFunc)ft_smooth_overlap_spans;
|
|
|
|
params.user = ⌖
|
|
|
|
|
|
|
|
params.clip_box.xMin = 0;
|
|
|
|
params.clip_box.yMin = 0;
|
|
|
|
params.clip_box.xMax = bitmap->width * SCALE;
|
|
|
|
params.clip_box.yMax = bitmap->rows * SCALE;
|
|
|
|
|
|
|
|
if ( bitmap->pitch < 0 )
|
|
|
|
target.origin = bitmap->buffer;
|
|
|
|
else
|
|
|
|
target.origin = bitmap->buffer
|
|
|
|
+ ( bitmap->rows - 1 ) * (unsigned int)bitmap->pitch;
|
|
|
|
|
|
|
|
target.pitch = bitmap->pitch;
|
|
|
|
|
|
|
|
/* inflate outline */
|
|
|
|
for ( vec = points; vec < points_end; vec++ )
|
|
|
|
{
|
|
|
|
vec->x *= SCALE;
|
|
|
|
vec->y *= SCALE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* render outline into the bitmap */
|
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
|
|
|
|
/* deflate outline */
|
|
|
|
for ( vec = points; vec < points_end; vec++ )
|
|
|
|
{
|
|
|
|
vec->x /= SCALE;
|
|
|
|
vec->y /= SCALE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef SCALE
|
|
|
|
|
2001-06-28 01:25:46 +02:00
|
|
|
static FT_Error
|
2020-05-12 05:30:37 +02:00
|
|
|
ft_smooth_render( FT_Renderer render,
|
|
|
|
FT_GlyphSlot slot,
|
|
|
|
FT_Render_Mode mode,
|
|
|
|
const FT_Vector* origin )
|
2000-06-28 01:18:39 +02:00
|
|
|
{
|
2017-09-29 04:59:31 +02:00
|
|
|
FT_Error error = FT_Err_Ok;
|
2014-11-01 03:12:37 +01:00
|
|
|
FT_Outline* outline = &slot->outline;
|
|
|
|
FT_Bitmap* bitmap = &slot->bitmap;
|
|
|
|
FT_Memory memory = render->root.memory;
|
|
|
|
FT_Pos x_shift = 0;
|
|
|
|
FT_Pos y_shift = 0;
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
|
2000-06-28 01:18:39 +02:00
|
|
|
/* check glyph image format */
|
2000-07-02 02:27:53 +02:00
|
|
|
if ( slot->format != render->glyph_format )
|
2000-06-28 01:18:39 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2000-06-28 01:18:39 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-06-28 01:18:39 +02:00
|
|
|
/* check mode */
|
2020-05-12 05:30:37 +02:00
|
|
|
if ( mode != FT_RENDER_MODE_NORMAL &&
|
|
|
|
mode != FT_RENDER_MODE_LIGHT &&
|
2020-07-03 15:02:09 +02:00
|
|
|
mode != FT_RENDER_MODE_LCD &&
|
|
|
|
mode != FT_RENDER_MODE_LCD_V )
|
2012-07-11 12:05:58 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Cannot_Render_Glyph );
|
2012-07-11 12:05:58 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2014-10-30 04:45:23 +01:00
|
|
|
/* release old bitmap buffer */
|
|
|
|
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
|
|
|
|
{
|
|
|
|
FT_FREE( bitmap->buffer );
|
|
|
|
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
|
|
|
|
}
|
2006-09-27 09:52:48 +02:00
|
|
|
|
2018-08-31 05:28:30 +02:00
|
|
|
if ( ft_glyphslot_preset_bitmap( slot, mode, origin ) )
|
2018-08-10 04:18:00 +02:00
|
|
|
{
|
|
|
|
error = FT_THROW( Raster_Overflow );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
2019-12-13 23:56:25 +01:00
|
|
|
if ( !bitmap->rows || !bitmap->pitch )
|
|
|
|
goto Exit;
|
|
|
|
|
2014-10-30 04:45:23 +01:00
|
|
|
/* allocate new one */
|
2017-09-28 06:20:50 +02:00
|
|
|
if ( FT_ALLOC_MULT( bitmap->buffer, bitmap->rows, bitmap->pitch ) )
|
2000-06-28 01:18:39 +02:00
|
|
|
goto Exit;
|
|
|
|
|
2003-06-18 08:59:57 +02:00
|
|
|
slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2017-09-28 06:20:50 +02:00
|
|
|
x_shift = 64 * -slot->bitmap_left;
|
|
|
|
y_shift = 64 * -slot->bitmap_top;
|
|
|
|
if ( bitmap->pixel_mode == FT_PIXEL_MODE_LCD_V )
|
2017-09-30 20:28:58 +02:00
|
|
|
y_shift += 64 * (FT_Int)bitmap->rows / 3;
|
2017-09-28 06:20:50 +02:00
|
|
|
else
|
2017-09-30 20:28:58 +02:00
|
|
|
y_shift += 64 * (FT_Int)bitmap->rows;
|
2014-11-01 03:12:37 +01:00
|
|
|
|
2017-09-28 06:20:50 +02:00
|
|
|
if ( origin )
|
|
|
|
{
|
|
|
|
x_shift += origin->x;
|
|
|
|
y_shift += origin->y;
|
|
|
|
}
|
2014-11-01 03:12:37 +01:00
|
|
|
|
2014-10-30 04:45:23 +01:00
|
|
|
/* translate outline to render it into the bitmap */
|
2014-10-31 05:07:14 +01:00
|
|
|
if ( x_shift || y_shift )
|
|
|
|
FT_Outline_Translate( outline, x_shift, y_shift );
|
2014-10-30 04:45:23 +01:00
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
if ( mode == FT_RENDER_MODE_NORMAL ||
|
|
|
|
mode == FT_RENDER_MODE_LIGHT )
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
{
|
2020-07-04 04:29:34 +02:00
|
|
|
if ( outline->flags & FT_OUTLINE_OVERLAP )
|
|
|
|
error = ft_smooth_raster_overlap( render, outline, bitmap );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FT_Raster_Params params;
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
|
2002-09-05 17:10:54 +02:00
|
|
|
|
2020-07-04 04:29:34 +02:00
|
|
|
params.target = bitmap;
|
|
|
|
params.source = outline;
|
|
|
|
params.flags = FT_RASTER_FLAG_AA;
|
2002-09-05 17:10:54 +02:00
|
|
|
|
2020-07-04 04:29:34 +02:00
|
|
|
error = render->raster_render( render->raster, ¶ms );
|
|
|
|
}
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
}
|
2020-07-03 15:02:09 +02:00
|
|
|
else
|
2017-09-28 06:20:50 +02:00
|
|
|
{
|
2020-07-03 15:02:09 +02:00
|
|
|
if ( mode == FT_RENDER_MODE_LCD )
|
|
|
|
error = ft_smooth_raster_lcd ( render, outline, bitmap );
|
|
|
|
else if ( mode == FT_RENDER_MODE_LCD_V )
|
|
|
|
error = ft_smooth_raster_lcdv( render, outline, bitmap );
|
2017-09-28 06:20:50 +02:00
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
2017-09-28 06:20:50 +02:00
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
/* finally apply filtering */
|
2017-09-28 06:20:50 +02:00
|
|
|
{
|
2020-07-03 15:02:09 +02:00
|
|
|
FT_Byte* lcd_weights;
|
|
|
|
FT_Bitmap_LcdFilterFunc lcd_filter_func;
|
2018-05-25 04:38:24 +02:00
|
|
|
|
2017-03-09 06:08:38 +01:00
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
/* Per-face LCD filtering takes priority if set up. */
|
|
|
|
if ( slot->face && slot->face->internal->lcd_filter_func )
|
2017-03-09 06:08:38 +01:00
|
|
|
{
|
2020-07-03 15:02:09 +02:00
|
|
|
lcd_weights = slot->face->internal->lcd_weights;
|
|
|
|
lcd_filter_func = slot->face->internal->lcd_filter_func;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
lcd_weights = slot->library->lcd_weights;
|
|
|
|
lcd_filter_func = slot->library->lcd_filter_func;
|
CHANGES BETWEEN 2.2.1 and 2.2.2
I. IMPORTANT BUG FIXES
- Various integer overflows have been fixed.
- PFB fonts with MacOS resource fork weren't handled correctly on
non-MacOS platforms.
- The PCF font loarder has been seriously hardened against malformed
font files.
II. IMPORTANT CHANGES
- the unpatented hinter is now part of the default build of the
library, and we added code to automatically support "tricky"
fonts that need it.
what this means is that FreeType should "just work" with certain
Asian fonts, like MingLiu, which cannot properly load without a
bytecode interpreter, but fortunately do not use any of the
patented bytecode opcodes.
Note that the API didn't change, so you can still force
unpatented hinting with a special parameter to FT_Open_Face
as well.
if you're an embedded systems developer, you might want to
*disable* the feature to save code space by undefining
TT_CONFIG_OPTION_UNPATENTED_HINTING in ftoption.h.
- LCD-optimized rendering is now disabled in all default builds
of the library, mainly due to patent reasons. For more information
see:
http://lists.gnu.org/archive/html/freetype/2006-09/msg00064.html
a new configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING has
been introduced in ftoption.h; manually define it in this file
if you want to re-enable the feature.
the change only affects the implementation, not the FreeType API.
This means that clients don't need to be modified, because the
library still generates LCD decimated bitmaps, but with the added
constraint that R=G=B on each triplet.
- Some computation bugs in the TrueType bytecode interpreter were found,
which allow us to get rid of very subtle and rare differences we had
with the Windows renderer.
III. MISCELLANEOUS
- TrueType glyph loading is now about 25% faster.
- the anti-aliased rasterizer has been optimized and is now 15% to 25%
percent faster than the previous one, depending on content
- the Type 1 loader has been improved; as an example, it now skips
over top-level dictionaries properly
======================================================================
2006-09-26 18:58:21 +02:00
|
|
|
}
|
2017-03-09 06:08:38 +01:00
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
if ( lcd_filter_func )
|
|
|
|
lcd_filter_func( bitmap, lcd_weights );
|
|
|
|
}
|
2017-03-09 06:08:38 +01:00
|
|
|
|
2020-07-03 15:02:09 +02:00
|
|
|
#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
|
2018-05-25 04:38:24 +02:00
|
|
|
|
2017-03-09 06:08:38 +01:00
|
|
|
}
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
|
2000-06-28 01:18:39 +02:00
|
|
|
Exit:
|
2017-09-29 04:59:31 +02:00
|
|
|
if ( !error )
|
2017-10-01 09:23:42 +02:00
|
|
|
{
|
2017-09-29 04:59:31 +02:00
|
|
|
/* everything is fine; the glyph is now officially a bitmap */
|
|
|
|
slot->format = FT_GLYPH_FORMAT_BITMAP;
|
2017-10-01 09:23:42 +02:00
|
|
|
}
|
2017-09-29 04:59:31 +02:00
|
|
|
else if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
|
2012-07-11 12:05:58 +02:00
|
|
|
{
|
|
|
|
FT_FREE( bitmap->buffer );
|
|
|
|
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
|
|
|
|
}
|
2001-12-05 18:24:34 +01:00
|
|
|
|
2017-09-29 04:59:31 +02:00
|
|
|
if ( x_shift || y_shift )
|
|
|
|
FT_Outline_Translate( outline, -x_shift, -y_shift );
|
|
|
|
|
2000-06-28 01:18:39 +02:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
FT_DEFINE_RENDERER(
|
|
|
|
ft_smooth_renderer_class,
|
2009-04-05 17:14:04 +02:00
|
|
|
|
* include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,
ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
FT_GLYPH_BBIX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* include/freetype/ftmodule.h (ft_module_font_driver,
ft_module_renderer, ft_module_hinter, ft_module_styler,
ft_module_driver_scalable, ft_module_driver_no_outlines,
ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
FT_MODULE_DRIVER_HAS_HINTER.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
as enumeration.
* src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
(winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
the FT_MODULE_DRIVER_NO_OUTLINES flag.
2003-06-17 12:42:27 +02:00
|
|
|
FT_MODULE_RENDERER,
|
2011-11-30 10:46:53 +01:00
|
|
|
sizeof ( FT_RendererRec ),
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2000-06-28 01:18:39 +02:00
|
|
|
"smooth",
|
2000-07-02 02:27:53 +02:00
|
|
|
0x10000L,
|
|
|
|
0x20000L,
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
NULL, /* module specific interface */
|
2000-07-09 21:15:30 +02:00
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
(FT_Module_Constructor)ft_smooth_init, /* module_init */
|
|
|
|
(FT_Module_Destructor) NULL, /* module_done */
|
|
|
|
(FT_Module_Requester) NULL, /* get_interface */
|
2000-06-28 01:18:39 +02:00
|
|
|
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
FT_GLYPH_FORMAT_OUTLINE,
|
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
(FT_Renderer_RenderFunc) ft_smooth_render, /* render_glyph */
|
|
|
|
(FT_Renderer_TransformFunc)ft_smooth_transform, /* transform_glyph */
|
|
|
|
(FT_Renderer_GetCBoxFunc) ft_smooth_get_cbox, /* get_glyph_cbox */
|
|
|
|
(FT_Renderer_SetModeFunc) ft_smooth_set_mode, /* set_mode */
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
|
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.
2018-05-02 20:27:48 +02:00
|
|
|
(FT_Raster_Funcs*)&ft_grays_raster /* raster_class */
|
2009-04-05 17:14:04 +02:00
|
|
|
)
|
* massive re-formatting changes to many, many source files. I don't
want to list them all here. The operations performed were all logical
transformations of the sources:
- trying to convert all enums and constants to CAPITALIZED_STYLE, with
#define definitions like
#define my_old_constants MY_NEW_CONSTANT
- big, big update of the documentation comments
* include/freetype/freetype.h, src/base/ftobjs.c, src/smooth/ftsmooth.c,
include/freetype/ftimage.h: adding support for LCD-optimized rendering
though the new constants/enums:
FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
this is still work in progress, don't expect everything to work correctly
though most of the features have been implemented.
* adding new FT_LOAD_XXX flags, used to specify both hinting and rendering
targets:
FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
FT_LOAD_TARGET_MONO :: monochrome bitmaps
FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated hinting & rendering
FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated hinting & rendering
note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
behaviour of the font engine is _unchanged_.
2002-08-27 22:20:29 +02:00
|
|
|
|
|
|
|
|
2000-07-02 02:27:53 +02:00
|
|
|
/* END */
|