2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* ftglyph.c
|
|
|
|
*
|
|
|
|
* FreeType convenience functions to handle glyphs (body).
|
|
|
|
*
|
2022-01-11 10:54:10 +01:00
|
|
|
* Copyright (C) 1996-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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* This file contains the definition of several convenience functions
|
|
|
|
* that can be used by client applications to easily retrieve glyph
|
|
|
|
* bitmaps and outlines from a given face.
|
|
|
|
*
|
|
|
|
* These functions should be optional if you are writing a font server
|
|
|
|
* or text layout engine on top of FreeType. However, they are pretty
|
|
|
|
* handy for many other simple uses of the library.
|
|
|
|
*
|
|
|
|
*/
|
2000-05-30 18:49:14 +02:00
|
|
|
|
2000-12-08 17:17:16 +01:00
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/internal/ftdebug.h>
|
2013-03-14 10:27:35 +01:00
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/ftglyph.h>
|
|
|
|
#include <freetype/ftoutln.h>
|
|
|
|
#include <freetype/ftbitmap.h>
|
|
|
|
#include <freetype/internal/ftobjs.h>
|
2021-12-26 04:55:58 +01:00
|
|
|
#include <freetype/otsvg.h>
|
2000-03-28 13:22:31 +02:00
|
|
|
|
2020-07-07 16:58:14 +02:00
|
|
|
#include "ftbase.h"
|
|
|
|
|
2000-05-30 18:49:14 +02:00
|
|
|
|
2018-06-03 09:01:17 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* The macro FT_COMPONENT is used in trace mode. It is an implicit
|
|
|
|
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
|
|
|
|
* messages during execution.
|
|
|
|
*/
|
2000-06-03 08:03:11 +02:00
|
|
|
#undef FT_COMPONENT
|
2018-08-15 18:13:17 +02:00
|
|
|
#define FT_COMPONENT glyph
|
2000-06-03 08:03:11 +02:00
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/**** ****/
|
|
|
|
/**** FT_BitmapGlyph support ****/
|
|
|
|
/**** ****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_bitmap_glyph_init( FT_Glyph bitmap_glyph,
|
|
|
|
FT_GlyphSlot slot )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Library library = FT_GLYPH( glyph )->library;
|
2000-07-01 16:06:46 +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
|
|
|
if ( slot->format != FT_GLYPH_FORMAT_BITMAP )
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Glyph_Format );
|
2000-03-28 13:22:31 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2005-05-20 23:52:19 +02:00
|
|
|
glyph->left = slot->bitmap_left;
|
|
|
|
glyph->top = slot->bitmap_top;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2005-05-20 23:52:19 +02:00
|
|
|
/* do lazy copying whenever possible */
|
2003-06-18 08:59:57 +02:00
|
|
|
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
|
2005-05-20 23:52:19 +02:00
|
|
|
{
|
2018-08-26 06:39:43 +02:00
|
|
|
glyph->bitmap = slot->bitmap;
|
2003-06-18 08:59:57 +02:00
|
|
|
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
|
2005-05-20 23:52:19 +02:00
|
|
|
}
|
2000-07-01 01:12:55 +02:00
|
|
|
else
|
|
|
|
{
|
2015-03-10 11:15:15 +01:00
|
|
|
FT_Bitmap_Init( &glyph->bitmap );
|
2005-05-20 23:52:19 +02:00
|
|
|
error = FT_Bitmap_Copy( library, &slot->bitmap, &glyph->bitmap );
|
2000-07-01 01:12:55 +02:00
|
|
|
}
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
Exit:
|
|
|
|
return error;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
2000-03-28 13:22:31 +02:00
|
|
|
|
2000-05-17 01:44:38 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_bitmap_glyph_copy( FT_Glyph bitmap_source,
|
|
|
|
FT_Glyph bitmap_target )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
2005-05-20 23:52:19 +02:00
|
|
|
FT_Library library = bitmap_source->library;
|
|
|
|
FT_BitmapGlyph source = (FT_BitmapGlyph)bitmap_source;
|
|
|
|
FT_BitmapGlyph target = (FT_BitmapGlyph)bitmap_target;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
target->left = source->left;
|
|
|
|
target->top = source->top;
|
|
|
|
|
2005-05-20 23:52:19 +02:00
|
|
|
return FT_Bitmap_Copy( library, &source->bitmap, &target->bitmap );
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
2000-06-29 05:14:25 +02:00
|
|
|
|
2000-05-17 01:44:38 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
ft_bitmap_glyph_done( FT_Glyph bitmap_glyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
2005-05-20 23:52:19 +02:00
|
|
|
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
|
|
|
|
FT_Library library = FT_GLYPH( glyph )->library;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
2005-05-20 23:52:19 +02:00
|
|
|
FT_Bitmap_Done( library, &glyph->bitmap );
|
2000-07-01 01:12:55 +02:00
|
|
|
}
|
2000-05-17 01:44:38 +02:00
|
|
|
|
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
ft_bitmap_glyph_bbox( FT_Glyph bitmap_glyph,
|
|
|
|
FT_BBox* cbox )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
|
|
|
|
|
|
|
|
|
2015-10-04 13:08:08 +02:00
|
|
|
cbox->xMin = glyph->left * 64;
|
|
|
|
cbox->xMax = cbox->xMin + (FT_Pos)( glyph->bitmap.width * 64 );
|
|
|
|
cbox->yMax = glyph->top * 64;
|
|
|
|
cbox->yMin = cbox->yMax - (FT_Pos)( glyph->bitmap.rows * 64 );
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
2000-05-17 01:44:38 +02:00
|
|
|
|
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
FT_DEFINE_GLYPH(
|
|
|
|
ft_bitmap_glyph_class,
|
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
sizeof ( FT_BitmapGlyphRec ),
|
* 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_BITMAP,
|
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
ft_bitmap_glyph_init, /* FT_Glyph_InitFunc glyph_init */
|
|
|
|
ft_bitmap_glyph_done, /* FT_Glyph_DoneFunc glyph_done */
|
|
|
|
ft_bitmap_glyph_copy, /* FT_Glyph_CopyFunc glyph_copy */
|
|
|
|
NULL, /* FT_Glyph_TransformFunc glyph_transform */
|
|
|
|
ft_bitmap_glyph_bbox, /* FT_Glyph_GetBBoxFunc glyph_bbox */
|
|
|
|
NULL /* FT_Glyph_PrepareFunc glyph_prepare */
|
2009-04-05 16:59:26 +02:00
|
|
|
)
|
2000-03-28 13:22:31 +02:00
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/**** ****/
|
|
|
|
/**** FT_OutlineGlyph support ****/
|
|
|
|
/**** ****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
2000-05-30 18:49:14 +02:00
|
|
|
|
2000-05-17 01:44:38 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_outline_glyph_init( FT_Glyph outline_glyph,
|
|
|
|
FT_GlyphSlot slot )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Library library = FT_GLYPH( glyph )->library;
|
|
|
|
FT_Outline* source = &slot->outline;
|
|
|
|
FT_Outline* target = &glyph->outline;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/* check format in glyph slot */
|
* 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
|
|
|
if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Glyph_Format );
|
2000-05-30 18:49:14 +02:00
|
|
|
goto Exit;
|
2000-03-28 13:22:31 +02:00
|
|
|
}
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/* allocate new outline */
|
2015-02-16 22:00:27 +01:00
|
|
|
error = FT_Outline_New( library,
|
|
|
|
(FT_UInt)source->n_points,
|
|
|
|
source->n_contours,
|
2000-07-01 01:12:55 +02:00
|
|
|
&glyph->outline );
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2005-05-20 23:52:19 +02:00
|
|
|
FT_Outline_Copy( source, target );
|
2000-05-30 18:49:14 +02:00
|
|
|
|
2000-03-28 13:22:31 +02:00
|
|
|
Exit:
|
|
|
|
return error;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
2000-05-17 01:44:38 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
ft_outline_glyph_done( FT_Glyph outline_glyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
|
|
|
|
|
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
FT_Outline_Done( FT_GLYPH( glyph )->library, &glyph->outline );
|
2000-03-28 13:22:31 +02:00
|
|
|
}
|
|
|
|
|
2000-05-17 01:44:38 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_outline_glyph_copy( FT_Glyph outline_source,
|
|
|
|
FT_Glyph outline_target )
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_OutlineGlyph source = (FT_OutlineGlyph)outline_source;
|
|
|
|
FT_OutlineGlyph target = (FT_OutlineGlyph)outline_target;
|
|
|
|
FT_Error error;
|
|
|
|
FT_Library library = FT_GLYPH( source )->library;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
2015-02-16 22:00:27 +01:00
|
|
|
error = FT_Outline_New( library,
|
|
|
|
(FT_UInt)source->outline.n_points,
|
|
|
|
source->outline.n_contours,
|
|
|
|
&target->outline );
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( !error )
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Outline_Copy( &source->outline, &target->outline );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
return error;
|
|
|
|
}
|
2000-03-28 13:22:31 +02:00
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( void )
|
* 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_outline_glyph_transform( FT_Glyph outline_glyph,
|
|
|
|
const FT_Matrix* matrix,
|
|
|
|
const FT_Vector* delta )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
|
|
|
|
|
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( matrix )
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Outline_Transform( &glyph->outline, matrix );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
if ( delta )
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Outline_Translate( &glyph->outline, delta->x, delta->y );
|
|
|
|
}
|
2000-05-30 18:49:14 +02:00
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
ft_outline_glyph_bbox( FT_Glyph outline_glyph,
|
|
|
|
FT_BBox* bbox )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
|
|
|
|
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Outline_Get_CBox( &glyph->outline, bbox );
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_outline_glyph_prepare( FT_Glyph outline_glyph,
|
|
|
|
FT_GlyphSlot slot )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
FT_OutlineGlyph glyph = (FT_OutlineGlyph)outline_glyph;
|
|
|
|
|
|
|
|
|
* 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
|
|
|
slot->format = FT_GLYPH_FORMAT_OUTLINE;
|
2000-07-01 01:12:55 +02:00
|
|
|
slot->outline = glyph->outline;
|
* 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
|
|
|
slot->outline.flags &= ~FT_OUTLINE_OWNER;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
return FT_Err_Ok;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
2000-06-02 02:01:14 +02:00
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
FT_DEFINE_GLYPH(
|
|
|
|
ft_outline_glyph_class,
|
|
|
|
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
sizeof ( FT_OutlineGlyphRec ),
|
* 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_outline_glyph_init, /* FT_Glyph_InitFunc glyph_init */
|
|
|
|
ft_outline_glyph_done, /* FT_Glyph_DoneFunc glyph_done */
|
|
|
|
ft_outline_glyph_copy, /* FT_Glyph_CopyFunc glyph_copy */
|
|
|
|
ft_outline_glyph_transform, /* FT_Glyph_TransformFunc glyph_transform */
|
|
|
|
ft_outline_glyph_bbox, /* FT_Glyph_GetBBoxFunc glyph_bbox */
|
|
|
|
ft_outline_glyph_prepare /* FT_Glyph_PrepareFunc glyph_prepare */
|
2009-04-05 16:59:26 +02:00
|
|
|
)
|
2000-06-02 02:01:14 +02:00
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2021-12-26 04:55:58 +01:00
|
|
|
#ifdef FT_CONFIG_OPTION_SVG
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/**** ****/
|
|
|
|
/**** FT_SvgGlyph support ****/
|
|
|
|
/**** ****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_svg_glyph_init( FT_Glyph svg_glyph,
|
|
|
|
FT_GlyphSlot slot )
|
|
|
|
{
|
|
|
|
FT_ULong doc_length;
|
|
|
|
FT_SVG_Document document;
|
|
|
|
FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
|
|
|
|
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Memory memory = FT_GLYPH( glyph )->library->memory;
|
|
|
|
|
|
|
|
|
|
|
|
if ( slot->format != FT_GLYPH_FORMAT_SVG )
|
|
|
|
{
|
|
|
|
error = FT_THROW( Invalid_Glyph_Format );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( slot->other == NULL )
|
|
|
|
{
|
|
|
|
error = FT_THROW( Invalid_Slot_Handle );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
document = (FT_SVG_Document)slot->other;
|
|
|
|
|
|
|
|
if ( document->svg_document_length == 0 )
|
|
|
|
{
|
|
|
|
error = FT_THROW( Invalid_Slot_Handle );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* allocate a new document */
|
|
|
|
doc_length = document->svg_document_length;
|
|
|
|
if ( FT_QALLOC( glyph->svg_document, doc_length ) )
|
|
|
|
goto Exit;
|
|
|
|
glyph->svg_document_length = doc_length;
|
|
|
|
|
|
|
|
glyph->glyph_index = slot->glyph_index;
|
|
|
|
|
|
|
|
glyph->metrics = document->metrics;
|
|
|
|
glyph->units_per_EM = document->units_per_EM;
|
|
|
|
|
|
|
|
glyph->start_glyph_id = document->start_glyph_id;
|
|
|
|
glyph->end_glyph_id = document->end_glyph_id;
|
|
|
|
|
|
|
|
glyph->transform = document->transform;
|
|
|
|
glyph->delta = document->delta;
|
|
|
|
|
|
|
|
/* copy the document into glyph */
|
|
|
|
FT_MEM_COPY( glyph->svg_document, document->svg_document, doc_length );
|
|
|
|
|
|
|
|
Exit:
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
ft_svg_glyph_done( FT_Glyph svg_glyph )
|
|
|
|
{
|
|
|
|
FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
|
|
|
|
FT_Memory memory = svg_glyph->library->memory;
|
|
|
|
|
|
|
|
|
|
|
|
/* just free the memory */
|
|
|
|
FT_FREE( glyph->svg_document );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_svg_glyph_copy( FT_Glyph svg_source,
|
|
|
|
FT_Glyph svg_target )
|
|
|
|
{
|
|
|
|
FT_SvgGlyph source = (FT_SvgGlyph)svg_source;
|
|
|
|
FT_SvgGlyph target = (FT_SvgGlyph)svg_target;
|
|
|
|
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Memory memory = FT_GLYPH( source )->library->memory;
|
|
|
|
|
|
|
|
|
|
|
|
if ( svg_source->format != FT_GLYPH_FORMAT_SVG )
|
|
|
|
{
|
|
|
|
error = FT_THROW( Invalid_Glyph_Format );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( source->svg_document_length == 0 )
|
|
|
|
{
|
|
|
|
error = FT_THROW( Invalid_Slot_Handle );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
target->glyph_index = source->glyph_index;
|
|
|
|
|
|
|
|
target->svg_document_length = source->svg_document_length;
|
|
|
|
|
|
|
|
target->metrics = source->metrics;
|
|
|
|
target->units_per_EM = source->units_per_EM;
|
|
|
|
|
|
|
|
target->start_glyph_id = source->start_glyph_id;
|
|
|
|
target->end_glyph_id = source->end_glyph_id;
|
|
|
|
|
|
|
|
target->transform = source->transform;
|
|
|
|
target->delta = source->delta;
|
|
|
|
|
|
|
|
/* allocate space for the SVG document */
|
|
|
|
if ( FT_QALLOC( target->svg_document, target->svg_document_length ) )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
/* copy the document */
|
|
|
|
FT_MEM_COPY( target->svg_document,
|
|
|
|
source->svg_document,
|
|
|
|
target->svg_document_length );
|
|
|
|
|
|
|
|
Exit:
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
ft_svg_glyph_transform( FT_Glyph svg_glyph,
|
|
|
|
const FT_Matrix* _matrix,
|
|
|
|
const FT_Vector* _delta )
|
|
|
|
{
|
|
|
|
FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
|
|
|
|
FT_Matrix* matrix = (FT_Matrix*)_matrix;
|
|
|
|
FT_Vector* delta = (FT_Vector*)_delta;
|
|
|
|
|
|
|
|
FT_Matrix tmp_matrix;
|
|
|
|
FT_Vector tmp_delta;
|
|
|
|
|
|
|
|
FT_Matrix a, b;
|
|
|
|
FT_Pos x, y;
|
|
|
|
|
|
|
|
|
|
|
|
if ( !matrix )
|
|
|
|
{
|
|
|
|
tmp_matrix.xx = 0x10000;
|
|
|
|
tmp_matrix.xy = 0;
|
|
|
|
tmp_matrix.yx = 0;
|
|
|
|
tmp_matrix.yy = 0x10000;
|
|
|
|
|
|
|
|
matrix = &tmp_matrix;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !delta )
|
|
|
|
{
|
|
|
|
tmp_delta.x = 0;
|
|
|
|
tmp_delta.y = 0;
|
|
|
|
|
|
|
|
delta = &tmp_delta;
|
|
|
|
}
|
|
|
|
|
|
|
|
a = glyph->transform;
|
|
|
|
b = *matrix;
|
|
|
|
FT_Matrix_Multiply( &b, &a );
|
|
|
|
|
|
|
|
x = ADD_LONG( ADD_LONG( FT_MulFix( matrix->xx, glyph->delta.x ),
|
|
|
|
FT_MulFix( matrix->xy, glyph->delta.y ) ),
|
|
|
|
delta->x );
|
|
|
|
y = ADD_LONG( ADD_LONG( FT_MulFix( matrix->yx, glyph->delta.x ),
|
|
|
|
FT_MulFix( matrix->yy, glyph->delta.y ) ),
|
|
|
|
delta->y );
|
|
|
|
|
|
|
|
glyph->delta.x = x;
|
|
|
|
glyph->delta.y = y;
|
|
|
|
|
|
|
|
glyph->transform = a;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
ft_svg_glyph_prepare( FT_Glyph svg_glyph,
|
|
|
|
FT_GlyphSlot slot )
|
|
|
|
{
|
|
|
|
FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
|
|
|
|
|
|
|
|
FT_Error error = FT_Err_Ok;
|
|
|
|
FT_Memory memory = svg_glyph->library->memory;
|
|
|
|
|
|
|
|
FT_SVG_Document document;
|
|
|
|
|
|
|
|
|
|
|
|
if ( FT_NEW( document ) )
|
|
|
|
return error;
|
|
|
|
|
|
|
|
document->svg_document = glyph->svg_document;
|
|
|
|
document->svg_document_length = glyph->svg_document_length;
|
|
|
|
|
|
|
|
document->metrics = glyph->metrics;
|
|
|
|
document->units_per_EM = glyph->units_per_EM;
|
|
|
|
|
|
|
|
document->start_glyph_id = glyph->start_glyph_id;
|
|
|
|
document->end_glyph_id = glyph->end_glyph_id;
|
|
|
|
|
|
|
|
document->transform = glyph->transform;
|
|
|
|
document->delta = glyph->delta;
|
|
|
|
|
|
|
|
slot->format = FT_GLYPH_FORMAT_SVG;
|
|
|
|
slot->glyph_index = glyph->glyph_index;
|
|
|
|
slot->other = document;
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_DEFINE_GLYPH(
|
|
|
|
ft_svg_glyph_class,
|
|
|
|
|
|
|
|
sizeof ( FT_SvgGlyphRec ),
|
|
|
|
FT_GLYPH_FORMAT_SVG,
|
|
|
|
|
|
|
|
ft_svg_glyph_init, /* FT_Glyph_InitFunc glyph_init */
|
|
|
|
ft_svg_glyph_done, /* FT_Glyph_DoneFunc glyph_done */
|
|
|
|
ft_svg_glyph_copy, /* FT_Glyph_CopyFunc glyph_copy */
|
|
|
|
ft_svg_glyph_transform, /* FT_Glyph_TransformFunc glyph_transform */
|
|
|
|
NULL, /* FT_Glyph_GetBBoxFunc glyph_bbox */
|
|
|
|
ft_svg_glyph_prepare /* FT_Glyph_PrepareFunc glyph_prepare */
|
|
|
|
)
|
|
|
|
|
|
|
|
#endif /* FT_CONFIG_OPTION_SVG */
|
|
|
|
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
|
|
|
/**** ****/
|
|
|
|
/**** FT_Glyph class and API ****/
|
|
|
|
/**** ****/
|
|
|
|
/*************************************************************************/
|
|
|
|
/*************************************************************************/
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
static FT_Error
|
|
|
|
ft_new_glyph( FT_Library library,
|
|
|
|
const FT_Glyph_Class* clazz,
|
|
|
|
FT_Glyph* aglyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
FT_Memory memory = library->memory;
|
|
|
|
FT_Error error;
|
2010-07-12 21:13:22 +02:00
|
|
|
FT_Glyph glyph = NULL;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
2015-04-11 05:45:11 +02:00
|
|
|
*aglyph = NULL;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2002-03-22 14:52:37 +01:00
|
|
|
if ( !FT_ALLOC( glyph, clazz->glyph_size ) )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
glyph->library = library;
|
|
|
|
glyph->clazz = clazz;
|
|
|
|
glyph->format = clazz->glyph_format;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
*aglyph = glyph;
|
|
|
|
}
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
return error;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftglyph.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error )
|
|
|
|
FT_Glyph_Copy( FT_Glyph source,
|
|
|
|
FT_Glyph *target )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
FT_Glyph copy;
|
|
|
|
FT_Error error;
|
|
|
|
const FT_Glyph_Class* clazz;
|
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2007-07-08 09:13:12 +02:00
|
|
|
/* check arguments */
|
2014-11-26 21:59:21 +01:00
|
|
|
if ( !target || !source || !source->clazz )
|
2007-07-08 09:13:12 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2007-07-08 09:13:12 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
2014-11-26 21:59:21 +01:00
|
|
|
*target = NULL;
|
2007-04-26 08:26:35 +02:00
|
|
|
|
2007-07-08 09:13:12 +02:00
|
|
|
if ( !source || !source->clazz )
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2000-03-28 13:22:31 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
clazz = source->clazz;
|
|
|
|
error = ft_new_glyph( source->library, clazz, © );
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2001-02-16 17:27:35 +01:00
|
|
|
copy->advance = source->advance;
|
|
|
|
copy->format = source->format;
|
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( clazz->glyph_copy )
|
2000-07-01 01:12:55 +02:00
|
|
|
error = clazz->glyph_copy( source, copy );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
if ( error )
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Done_Glyph( copy );
|
|
|
|
else
|
|
|
|
*target = copy;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
Exit:
|
|
|
|
return error;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftglyph.h */
|
|
|
|
|
2018-06-18 04:33:29 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_New_Glyph( FT_Library library,
|
|
|
|
FT_Glyph_Format format,
|
|
|
|
FT_Glyph *aglyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
2014-11-26 21:59:21 +01:00
|
|
|
const FT_Glyph_Class* clazz = NULL;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2018-06-18 04:33:29 +02:00
|
|
|
if ( !library || !aglyph )
|
2013-03-14 10:27:35 +01:00
|
|
|
return FT_THROW( Invalid_Argument );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
/* if it is a bitmap, that's easy :-) */
|
2018-06-18 04:33:29 +02:00
|
|
|
if ( format == FT_GLYPH_FORMAT_BITMAP )
|
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
|
|
|
clazz = &ft_bitmap_glyph_class;
|
2000-07-01 01:12:55 +02:00
|
|
|
|
2009-12-31 18:26:14 +01:00
|
|
|
/* if it is an outline */
|
2018-06-18 04:33:29 +02:00
|
|
|
else if ( format == FT_GLYPH_FORMAT_OUTLINE )
|
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
|
|
|
clazz = &ft_outline_glyph_class;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2021-12-26 04:55:58 +01:00
|
|
|
#ifdef FT_CONFIG_OPTION_SVG
|
|
|
|
/* if it is an SVG glyph */
|
|
|
|
else if ( format == FT_GLYPH_FORMAT_SVG )
|
|
|
|
clazz = &ft_svg_glyph_class;
|
|
|
|
#endif
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
else
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
2000-07-01 01:12:55 +02:00
|
|
|
/* try to find a renderer that supports the glyph image format */
|
2018-06-18 04:33:29 +02:00
|
|
|
FT_Renderer render = FT_Lookup_Renderer( library, format, 0 );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ( render )
|
2000-07-01 01:12:55 +02:00
|
|
|
clazz = &render->glyph_class;
|
2000-03-28 13:22:31 +02:00
|
|
|
}
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
if ( !clazz )
|
2018-06-18 04:33:29 +02:00
|
|
|
return FT_THROW( Invalid_Glyph_Format );
|
|
|
|
|
|
|
|
/* create FT_Glyph object */
|
|
|
|
return ft_new_glyph( library, clazz, aglyph );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* documentation is in ftglyph.h */
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Error )
|
|
|
|
FT_Get_Glyph( FT_GlyphSlot slot,
|
|
|
|
FT_Glyph *aglyph )
|
|
|
|
{
|
2018-08-26 06:39:43 +02:00
|
|
|
FT_Error error;
|
|
|
|
FT_Glyph glyph;
|
2018-06-18 04:33:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ( !slot )
|
|
|
|
return FT_THROW( Invalid_Slot_Handle );
|
|
|
|
|
|
|
|
if ( !aglyph )
|
|
|
|
return FT_THROW( Invalid_Argument );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/* create FT_Glyph object */
|
2018-06-18 04:33:29 +02:00
|
|
|
error = FT_New_Glyph( slot->library, slot->format, &glyph );
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
2015-10-04 13:08:08 +02:00
|
|
|
/* copy advance while converting 26.6 to 16.16 format */
|
2017-06-01 17:00:37 +02:00
|
|
|
if ( slot->advance.x >= 0x8000L * 64 ||
|
|
|
|
slot->advance.x <= -0x8000L * 64 )
|
|
|
|
{
|
|
|
|
FT_ERROR(( "FT_Get_Glyph: advance width too large\n" ));
|
2017-07-13 10:25:42 +02:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
|
|
|
goto Exit2;
|
2017-06-01 17:00:37 +02:00
|
|
|
}
|
|
|
|
if ( slot->advance.y >= 0x8000L * 64 ||
|
|
|
|
slot->advance.y <= -0x8000L * 64 )
|
|
|
|
{
|
|
|
|
FT_ERROR(( "FT_Get_Glyph: advance height too large\n" ));
|
2017-07-13 10:25:42 +02:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
|
|
|
goto Exit2;
|
2017-06-01 17:00:37 +02:00
|
|
|
}
|
|
|
|
|
2015-10-04 13:08:08 +02:00
|
|
|
glyph->advance.x = slot->advance.x * 1024;
|
|
|
|
glyph->advance.y = slot->advance.y * 1024;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/* now import the image from the glyph slot */
|
2018-06-18 04:33:29 +02:00
|
|
|
error = glyph->clazz->glyph_init( glyph, slot );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2017-07-13 10:25:42 +02:00
|
|
|
Exit2:
|
2000-07-01 16:06:46 +02:00
|
|
|
/* if an error occurred, destroy the glyph */
|
|
|
|
if ( error )
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Done_Glyph( glyph );
|
|
|
|
else
|
|
|
|
*aglyph = glyph;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-03-28 13:22:31 +02:00
|
|
|
Exit:
|
|
|
|
return error;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftglyph.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error )
|
2021-08-22 19:12:45 +02:00
|
|
|
FT_Glyph_Transform( FT_Glyph glyph,
|
|
|
|
const FT_Matrix* matrix,
|
|
|
|
const FT_Vector* delta )
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
FT_Error error = FT_Err_Ok;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
if ( !glyph || !glyph->clazz )
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2000-07-01 01:12:55 +02:00
|
|
|
else
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
const FT_Glyph_Class* clazz = glyph->clazz;
|
|
|
|
|
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( clazz->glyph_transform )
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
2000-07-01 01:12:55 +02:00
|
|
|
/* transform glyph image */
|
|
|
|
clazz->glyph_transform( glyph, matrix, delta );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/* transform advance vector */
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( matrix )
|
2000-07-01 01:12:55 +02:00
|
|
|
FT_Vector_Transform( &glyph->advance, matrix );
|
2000-03-28 13:22:31 +02:00
|
|
|
}
|
2000-07-01 01:12:55 +02:00
|
|
|
else
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Glyph_Format );
|
2000-07-01 01:12:55 +02:00
|
|
|
}
|
|
|
|
return error;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftglyph.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( void )
|
|
|
|
FT_Glyph_Get_CBox( FT_Glyph glyph,
|
|
|
|
FT_UInt bbox_mode,
|
|
|
|
FT_BBox *acbox )
|
2000-07-01 16:06:46 +02:00
|
|
|
{
|
2000-07-01 01:12:55 +02:00
|
|
|
const FT_Glyph_Class* clazz;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
2001-06-18 16:23:45 +02:00
|
|
|
if ( !acbox )
|
|
|
|
return;
|
|
|
|
|
|
|
|
acbox->xMin = acbox->yMin = acbox->xMax = acbox->yMax = 0;
|
|
|
|
|
|
|
|
if ( !glyph || !glyph->clazz )
|
|
|
|
return;
|
2013-08-01 12:20:20 +02:00
|
|
|
|
|
|
|
clazz = glyph->clazz;
|
|
|
|
if ( !clazz->glyph_bbox )
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* retrieve bbox in 26.6 coordinates */
|
|
|
|
clazz->glyph_bbox( glyph, acbox );
|
|
|
|
|
|
|
|
/* perform grid fitting if needed */
|
|
|
|
if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT ||
|
|
|
|
bbox_mode == FT_GLYPH_BBOX_PIXELS )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
acbox->xMin = FT_PIX_FLOOR( acbox->xMin );
|
|
|
|
acbox->yMin = FT_PIX_FLOOR( acbox->yMin );
|
2019-03-05 11:35:03 +01:00
|
|
|
acbox->xMax = FT_PIX_CEIL_LONG( acbox->xMax );
|
|
|
|
acbox->yMax = FT_PIX_CEIL_LONG( acbox->yMax );
|
2013-08-01 12:20:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* convert to integer pixels if needed */
|
|
|
|
if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE ||
|
|
|
|
bbox_mode == FT_GLYPH_BBOX_PIXELS )
|
|
|
|
{
|
|
|
|
acbox->xMin >>= 6;
|
|
|
|
acbox->yMin >>= 6;
|
|
|
|
acbox->xMax >>= 6;
|
|
|
|
acbox->yMax >>= 6;
|
2000-03-28 13:22:31 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftglyph.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Error )
|
2021-08-22 19:12:45 +02:00
|
|
|
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
|
|
|
|
FT_Render_Mode render_mode,
|
|
|
|
const FT_Vector* origin,
|
|
|
|
FT_Bool destroy )
|
2000-03-28 13:22:31 +02:00
|
|
|
{
|
2003-06-18 08:59:57 +02:00
|
|
|
FT_GlyphSlotRec dummy;
|
|
|
|
FT_GlyphSlot_InternalRec dummy_internal;
|
|
|
|
FT_Error error = FT_Err_Ok;
|
2012-07-07 11:17:02 +02:00
|
|
|
FT_Glyph b, glyph;
|
2003-06-18 08:59:57 +02:00
|
|
|
FT_BitmapGlyph bitmap = NULL;
|
|
|
|
const FT_Glyph_Class* clazz;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2012-01-14 18:48:47 +01:00
|
|
|
FT_Library library;
|
2009-12-31 18:26:14 +01:00
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
/* check argument */
|
|
|
|
if ( !the_glyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
goto Bad;
|
|
|
|
glyph = *the_glyph;
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( !glyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
goto Bad;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2012-01-14 18:48:47 +01:00
|
|
|
clazz = glyph->clazz;
|
|
|
|
library = glyph->library;
|
|
|
|
if ( !library || !clazz )
|
|
|
|
goto Bad;
|
2002-07-09 01:05:14 +02:00
|
|
|
|
2003-05-28 08:10:57 +02:00
|
|
|
/* when called with a bitmap glyph, do nothing and return successfully */
|
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
|
|
|
if ( clazz == &ft_bitmap_glyph_class )
|
2002-07-09 01:05:14 +02:00
|
|
|
goto Exit;
|
|
|
|
|
2012-01-14 18:48:47 +01:00
|
|
|
if ( !clazz->glyph_prepare )
|
2000-07-01 01:12:55 +02:00
|
|
|
goto Bad;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2012-01-14 18:48:47 +01:00
|
|
|
/* we render the glyph into a glyph bitmap using a `dummy' glyph slot */
|
|
|
|
/* then calling FT_Render_Glyph_Internal() */
|
|
|
|
|
2016-09-28 19:06:21 +02:00
|
|
|
FT_ZERO( &dummy );
|
|
|
|
FT_ZERO( &dummy_internal );
|
2003-06-18 08:59:57 +02:00
|
|
|
dummy.internal = &dummy_internal;
|
2012-01-14 18:48:47 +01:00
|
|
|
dummy.library = library;
|
2003-06-18 08:59:57 +02:00
|
|
|
dummy.format = clazz->glyph_format;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
/* create result bitmap glyph */
|
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
|
|
|
error = ft_new_glyph( library, &ft_bitmap_glyph_class, &b );
|
2001-12-07 22:56:32 +01:00
|
|
|
if ( error )
|
2000-07-01 16:06:46 +02:00
|
|
|
goto Exit;
|
2012-07-07 11:17:02 +02:00
|
|
|
bitmap = (FT_BitmapGlyph)b;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2003-05-28 08:10:57 +02:00
|
|
|
#if 1
|
2001-12-05 18:24:34 +01:00
|
|
|
/* if `origin' is set, translate the glyph image */
|
|
|
|
if ( origin )
|
2021-09-04 04:13:22 +02:00
|
|
|
FT_Glyph_Transform( glyph, NULL, origin );
|
2001-12-16 09:17:33 +01:00
|
|
|
#else
|
|
|
|
FT_UNUSED( origin );
|
2001-12-05 18:24:34 +01:00
|
|
|
#endif
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
/* prepare dummy slot for rendering */
|
2000-08-21 06:43:01 +02:00
|
|
|
error = clazz->glyph_prepare( glyph, &dummy );
|
2000-08-23 19:32:42 +02:00
|
|
|
if ( !error )
|
2000-08-21 06:43:01 +02:00
|
|
|
error = FT_Render_Glyph_Internal( glyph->library, &dummy, render_mode );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2021-12-26 04:55:58 +01:00
|
|
|
#ifdef FT_CONFIG_OPTION_SVG
|
|
|
|
if ( clazz == &ft_svg_glyph_class )
|
|
|
|
{
|
|
|
|
FT_Memory memory = library->memory;
|
|
|
|
|
|
|
|
|
|
|
|
FT_FREE( dummy.other );
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-05-28 08:10:57 +02:00
|
|
|
#if 1
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( !destroy && origin )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
FT_Vector v;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
v.x = -origin->x;
|
|
|
|
v.y = -origin->y;
|
2021-09-04 04:13:22 +02:00
|
|
|
FT_Glyph_Transform( glyph, NULL, &v );
|
2000-07-01 01:12:55 +02:00
|
|
|
}
|
2001-12-05 18:24:34 +01:00
|
|
|
#endif
|
|
|
|
|
2001-12-07 22:56:32 +01:00
|
|
|
if ( error )
|
2001-12-05 18:24:34 +01:00
|
|
|
goto Exit;
|
2000-05-17 01:44:38 +02:00
|
|
|
|
2000-11-03 08:57:51 +01:00
|
|
|
/* in case of success, copy the bitmap to the glyph bitmap */
|
* src/cache/ftcbasic.c (ftc_basic_family_compare,
ftc_basic_family_init, ftc_basic_family_get_count,
ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
ftc_basic_gnode_compare_faceid): Adjust parameters and return types
to prototypes given in header files from include/freetype/cache.
Use casts to proper types locally.
(ftc_basic_image_family_class, ftc_basic_image_cache_class,
ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
casts.
* src/cache/ftccback.h: Adjust parameters and return types to
prototypes given in header files from include/freetype/cache.
* src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
ftc_inode_weight): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
* src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
ftc_cmap_node_weight, ftc_cmap_node_compare,
ftc_cmap_node_remove_faceid): Adjust parameters and return types to
prototypes given in header files from include/freetype/cache. Use
casts to proper types locally.
(ftc_cmap_cache_class): Remove casts.
* src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
ftc_gcache_done): Adjust parameters and return types to prototypes
given in header files from include/freetype/cache. Use casts to
proper types locally.
* src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
ftc_size_node_init, ftc_size_node_reset,
ftc_size_node_compare_faceid, ftc_face_node_init,
ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
return types to prototypes given in header files from
include/freetype/cache. Use casts to proper types locally.
(ftc_size_list_class, ftc_face_list_class): Remove casts.
* src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
(autohint_module_class): Remove casts.
* src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
ft_outline_glyph_done, ft_outline_glyph_copy,
ft_outline_glyph_transform, ft_outline_glyph_bbox,
ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
to FT_XXXGlyph locally.
Use FT_CALLBACK_DEF throughout.
(ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
* src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
and do a cast to BDF_CMap locally.
(bdf_cmap_class): Remove casts.
2004-05-17 11:25:04 +02:00
|
|
|
error = ft_bitmap_glyph_init( (FT_Glyph)bitmap, &dummy );
|
2001-12-05 18:24:34 +01:00
|
|
|
if ( error )
|
|
|
|
goto Exit;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2001-12-05 18:24:34 +01:00
|
|
|
/* copy advance */
|
|
|
|
bitmap->root.advance = glyph->advance;
|
2000-11-03 08:57:51 +01:00
|
|
|
|
2001-12-05 18:24:34 +01:00
|
|
|
if ( destroy )
|
|
|
|
FT_Done_Glyph( glyph );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2001-12-05 18:24:34 +01:00
|
|
|
*the_glyph = FT_GLYPH( bitmap );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
Exit:
|
2001-12-07 22:56:32 +01:00
|
|
|
if ( error && bitmap )
|
|
|
|
FT_Done_Glyph( FT_GLYPH( bitmap ) );
|
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
return error;
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2000-07-01 01:12:55 +02:00
|
|
|
Bad:
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2000-07-01 01:12:55 +02:00
|
|
|
goto Exit;
|
2000-07-01 16:06:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-11-07 18:21:11 +01:00
|
|
|
/* documentation is in ftglyph.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( void )
|
|
|
|
FT_Done_Glyph( FT_Glyph glyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
2000-07-01 16:06:46 +02:00
|
|
|
if ( glyph )
|
2000-07-01 01:12:55 +02:00
|
|
|
{
|
|
|
|
FT_Memory memory = glyph->library->memory;
|
|
|
|
const FT_Glyph_Class* clazz = glyph->clazz;
|
|
|
|
|
2000-07-01 16:06:46 +02:00
|
|
|
|
|
|
|
if ( clazz->glyph_done )
|
2000-07-01 01:12:55 +02:00
|
|
|
clazz->glyph_done( glyph );
|
2000-07-01 16:06:46 +02:00
|
|
|
|
2002-03-22 14:52:37 +01:00
|
|
|
FT_FREE( glyph );
|
2000-07-01 01:12:55 +02:00
|
|
|
}
|
2000-03-28 13:22:31 +02:00
|
|
|
}
|
2000-05-05 15:11:36 +02:00
|
|
|
|
|
|
|
|
2000-05-30 18:49:14 +02:00
|
|
|
/* END */
|