2002-05-21 16:13:01 +02:00
|
|
|
/* bdfdrivr.c
|
|
|
|
|
|
|
|
FreeType font driver for bdf files
|
|
|
|
|
2018-08-16 05:49:07 +02:00
|
|
|
Copyright (C) 2001-2008, 2011, 2013, 2014 by
|
|
|
|
Francesco Zappa Nardelli
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/internal/ftdebug.h>
|
|
|
|
#include <freetype/internal/ftstream.h>
|
|
|
|
#include <freetype/internal/ftobjs.h>
|
|
|
|
#include <freetype/ftbdf.h>
|
|
|
|
#include <freetype/ttnameid.h>
|
|
|
|
|
|
|
|
#include <freetype/internal/services/svbdf.h>
|
|
|
|
#include <freetype/internal/services/svfntfmt.h>
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
#include "bdf.h"
|
|
|
|
#include "bdfdrivr.h"
|
|
|
|
|
|
|
|
#include "bdferror.h"
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
2002-05-21 16:13:01 +02:00
|
|
|
#undef FT_COMPONENT
|
2018-08-15 18:13:17 +02:00
|
|
|
#define FT_COMPONENT bdfdriver
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
|
2002-06-14 10:54:02 +02:00
|
|
|
typedef struct BDF_CMapRec_
|
|
|
|
{
|
|
|
|
FT_CMapRec cmap;
|
2009-07-31 17:30:15 +02:00
|
|
|
FT_ULong num_encodings; /* ftobjs.h: FT_CMap->clazz->size */
|
2002-06-14 10:54:02 +02:00
|
|
|
BDF_encoding_el* encodings;
|
|
|
|
|
|
|
|
} BDF_CMapRec, *BDF_CMap;
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
* 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
|
|
|
bdf_cmap_init( FT_CMap bdfcmap,
|
|
|
|
FT_Pointer init_data )
|
2002-06-14 10:54:02 +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
|
|
|
BDF_CMap cmap = (BDF_CMap)bdfcmap;
|
2002-06-14 10:54:02 +02:00
|
|
|
BDF_Face face = (BDF_Face)FT_CMAP_FACE( cmap );
|
* 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_UNUSED( init_data );
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
|
2002-06-16 03:14:16 +02:00
|
|
|
cmap->num_encodings = face->bdffont->glyphs_used;
|
2002-06-14 10:54:02 +02:00
|
|
|
cmap->encodings = face->en_table;
|
|
|
|
|
2013-03-14 11:21:17 +01:00
|
|
|
return FT_Err_Ok;
|
2002-06-14 10:54:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( void )
|
* 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
|
|
|
bdf_cmap_done( FT_CMap bdfcmap )
|
2002-06-14 10:54:02 +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
|
|
|
BDF_CMap cmap = (BDF_CMap)bdfcmap;
|
|
|
|
|
|
|
|
|
2002-06-14 10:54:02 +02:00
|
|
|
cmap->encodings = NULL;
|
|
|
|
cmap->num_encodings = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_UInt )
|
* 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
|
|
|
bdf_cmap_char_index( FT_CMap bdfcmap,
|
2002-06-14 10:54:02 +02:00
|
|
|
FT_UInt32 charcode )
|
|
|
|
{
|
* 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
|
|
|
BDF_CMap cmap = (BDF_CMap)bdfcmap;
|
2002-06-14 10:54:02 +02:00
|
|
|
BDF_encoding_el* encodings = cmap->encodings;
|
2009-07-31 17:30:15 +02:00
|
|
|
FT_ULong min, max, mid; /* num_encodings */
|
|
|
|
FT_UShort result = 0; /* encodings->glyph */
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
min = 0;
|
|
|
|
max = cmap->num_encodings;
|
2018-09-24 03:46:26 +02:00
|
|
|
mid = ( min + max ) >> 1;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
while ( min < max )
|
|
|
|
{
|
2009-07-31 17:30:21 +02:00
|
|
|
FT_ULong code;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
|
2019-06-27 02:18:00 +02:00
|
|
|
if ( mid >= max || mid < min )
|
2018-09-24 03:46:26 +02:00
|
|
|
mid = ( min + max ) >> 1;
|
|
|
|
|
2018-08-13 15:01:53 +02:00
|
|
|
code = encodings[mid].enc;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
if ( charcode == code )
|
|
|
|
{
|
2004-06-22 14:28:17 +02:00
|
|
|
/* increase glyph index by 1 -- */
|
|
|
|
/* we reserve slot 0 for the undefined glyph */
|
2002-06-16 03:14:16 +02:00
|
|
|
result = encodings[mid].glyph + 1;
|
2002-06-14 10:54:02 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( charcode < code )
|
|
|
|
max = mid;
|
|
|
|
else
|
|
|
|
min = mid + 1;
|
2018-09-24 03:46:26 +02:00
|
|
|
|
|
|
|
/* prediction in a continuous block */
|
|
|
|
mid += charcode - code;
|
2002-06-14 10:54:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_UInt )
|
* 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
|
|
|
bdf_cmap_char_next( FT_CMap bdfcmap,
|
2002-06-14 10:54:02 +02:00
|
|
|
FT_UInt32 *acharcode )
|
|
|
|
{
|
* 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
|
|
|
BDF_CMap cmap = (BDF_CMap)bdfcmap;
|
2002-06-14 10:54:02 +02:00
|
|
|
BDF_encoding_el* encodings = cmap->encodings;
|
2009-07-31 17:30:15 +02:00
|
|
|
FT_ULong min, max, mid; /* num_encodings */
|
|
|
|
FT_UShort result = 0; /* encodings->glyph */
|
2009-07-31 17:30:21 +02:00
|
|
|
FT_ULong charcode = *acharcode + 1;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
min = 0;
|
|
|
|
max = cmap->num_encodings;
|
2018-09-24 03:46:26 +02:00
|
|
|
mid = ( min + max ) >> 1;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
while ( min < max )
|
|
|
|
{
|
2009-07-31 17:30:15 +02:00
|
|
|
FT_ULong code; /* same as BDF_encoding_el.enc */
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
|
2019-06-27 02:18:00 +02:00
|
|
|
if ( mid >= max || mid < min )
|
2018-09-24 03:46:26 +02:00
|
|
|
mid = ( min + max ) >> 1;
|
|
|
|
|
2018-08-13 15:01:53 +02:00
|
|
|
code = encodings[mid].enc;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
if ( charcode == code )
|
|
|
|
{
|
2004-06-22 14:28:17 +02:00
|
|
|
/* increase glyph index by 1 -- */
|
|
|
|
/* we reserve slot 0 for the undefined glyph */
|
2002-06-16 03:14:16 +02:00
|
|
|
result = encodings[mid].glyph + 1;
|
2002-06-14 10:54:02 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( charcode < code )
|
|
|
|
max = mid;
|
|
|
|
else
|
|
|
|
min = mid + 1;
|
2018-09-24 03:46:26 +02:00
|
|
|
|
|
|
|
/* prediction in a continuous block */
|
|
|
|
mid += charcode - code;
|
2002-06-14 10:54:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
charcode = 0;
|
|
|
|
if ( min < cmap->num_encodings )
|
|
|
|
{
|
2018-08-13 15:01:53 +02:00
|
|
|
charcode = encodings[min].enc;
|
2002-06-16 03:14:16 +02:00
|
|
|
result = encodings[min].glyph + 1;
|
2002-06-14 10:54:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Exit:
|
2009-07-31 17:30:21 +02:00
|
|
|
if ( charcode > 0xFFFFFFFFUL )
|
|
|
|
{
|
2020-07-25 12:23:22 +02:00
|
|
|
FT_TRACE1(( "bdf_cmap_char_next: charcode 0x%lx > 32bit API",
|
|
|
|
charcode ));
|
2009-07-31 17:30:21 +02:00
|
|
|
*acharcode = 0;
|
|
|
|
/* XXX: result should be changed to indicate an overflow error */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
*acharcode = (FT_UInt32)charcode;
|
2002-06-14 10:54:02 +02:00
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-03-18 08:39:35 +01:00
|
|
|
static
|
* 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
|
|
|
const FT_CMap_ClassRec bdf_cmap_class =
|
2002-06-14 10:54:02 +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
|
|
|
sizeof ( BDF_CMapRec ),
|
|
|
|
bdf_cmap_init,
|
|
|
|
bdf_cmap_done,
|
|
|
|
bdf_cmap_char_index,
|
Add support for cmap type 14.
* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_CMAP_FORMAT_14): New macro.
* include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc,
FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc,
FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New
support function prototypes.
(FT_CMap_ClassRec): Add them.
Update all users.
* include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New
macro.
* include/freetype/freetype.h (FT_Get_Char_Variant_Index,
FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors,
FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API
functions.
* src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary
function.
(FT_Set_Charmap): Disallow cmaps of type 14.
(FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault,
FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char,
FT_Get_Chars_Of_Variant): New API functions.
* src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros.
(TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate,
tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info,
tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary,
tt_cmap14_find_variant, tt_cmap14_char_var_index,
tt_cmap14_char_var_isdefault, tt_cmap14_variants,
tt_cmap14_char_variants, tt_cmap14_def_char_count,
tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and
structures for cmap 14 support.
(tt_cmap_classes): Register tt_cmap14_class_rec.
(tt_face_build_cmaps): One more error message.
* docs/CHANGES: Mention cmap 14 support.
2007-10-15 19:21:32 +02:00
|
|
|
bdf_cmap_char_next,
|
|
|
|
|
|
|
|
NULL, NULL, NULL, NULL, NULL
|
2002-06-14 10:54:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-11-13 11:19:27 +01:00
|
|
|
static FT_Error
|
|
|
|
bdf_interpret_style( BDF_Face bdf )
|
|
|
|
{
|
2013-03-14 11:21:17 +01:00
|
|
|
FT_Error error = FT_Err_Ok;
|
2003-11-13 11:19:27 +01:00
|
|
|
FT_Face face = FT_FACE( bdf );
|
|
|
|
FT_Memory memory = face->memory;
|
|
|
|
bdf_font_t* font = bdf->bdffont;
|
|
|
|
bdf_property_t* prop;
|
|
|
|
|
2019-06-11 04:27:39 +02:00
|
|
|
const char* strings[4] = { NULL, NULL, NULL, NULL };
|
|
|
|
size_t lengths[4], nn, len;
|
2003-11-13 11:19:27 +01:00
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
|
2003-11-13 11:19:27 +01:00
|
|
|
face->style_flags = 0;
|
|
|
|
|
2019-06-11 04:27:39 +02:00
|
|
|
prop = bdf_get_font_property( font, "SLANT" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop && prop->format == BDF_ATOM &&
|
|
|
|
prop->value.atom &&
|
|
|
|
( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' ||
|
|
|
|
*(prop->value.atom) == 'I' || *(prop->value.atom) == 'i' ) )
|
|
|
|
{
|
|
|
|
face->style_flags |= FT_STYLE_FLAG_ITALIC;
|
2007-02-12 15:55:03 +01:00
|
|
|
strings[2] = ( *(prop->value.atom) == 'O' || *(prop->value.atom) == 'o' )
|
2019-06-11 04:27:39 +02:00
|
|
|
? "Oblique"
|
|
|
|
: "Italic";
|
2003-11-13 11:19:27 +01:00
|
|
|
}
|
|
|
|
|
2019-06-11 04:27:39 +02:00
|
|
|
prop = bdf_get_font_property( font, "WEIGHT_NAME" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop && prop->format == BDF_ATOM &&
|
|
|
|
prop->value.atom &&
|
|
|
|
( *(prop->value.atom) == 'B' || *(prop->value.atom) == 'b' ) )
|
|
|
|
{
|
|
|
|
face->style_flags |= FT_STYLE_FLAG_BOLD;
|
2019-06-11 04:27:39 +02:00
|
|
|
strings[1] = "Bold";
|
2003-11-13 11:19:27 +01:00
|
|
|
}
|
|
|
|
|
2019-06-11 04:27:39 +02:00
|
|
|
prop = bdf_get_font_property( font, "SETWIDTH_NAME" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop && prop->format == BDF_ATOM &&
|
|
|
|
prop->value.atom && *(prop->value.atom) &&
|
|
|
|
!( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
|
2019-06-11 04:27:39 +02:00
|
|
|
strings[3] = (const char *)(prop->value.atom);
|
2003-11-13 11:19:27 +01:00
|
|
|
|
2019-06-11 04:27:39 +02:00
|
|
|
prop = bdf_get_font_property( font, "ADD_STYLE_NAME" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop && prop->format == BDF_ATOM &&
|
|
|
|
prop->value.atom && *(prop->value.atom) &&
|
|
|
|
!( *(prop->value.atom) == 'N' || *(prop->value.atom) == 'n' ) )
|
2019-06-11 04:27:39 +02:00
|
|
|
strings[0] = (const char *)(prop->value.atom);
|
2003-11-13 11:19:27 +01:00
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
for ( len = 0, nn = 0; nn < 4; nn++ )
|
2005-11-21 18:32:03 +01:00
|
|
|
{
|
2007-02-12 15:55:03 +01:00
|
|
|
lengths[nn] = 0;
|
2007-02-12 22:44:10 +01:00
|
|
|
if ( strings[nn] )
|
2007-02-12 15:55:03 +01:00
|
|
|
{
|
2007-02-12 22:44:10 +01:00
|
|
|
lengths[nn] = ft_strlen( strings[nn] );
|
|
|
|
len += lengths[nn] + 1;
|
2007-02-12 15:55:03 +01:00
|
|
|
}
|
|
|
|
}
|
* builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
include/freetype/internal/ftdriver.h,
include/freetype/internal/ftmemory.h,
include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
massive changes to the internals to respect the internal object layouts
and exported functions of FreeType 2.1.7. Note that the cache sub-system
cannot be fully retrofitted, unfortunately.
2006-02-16 23:45:31 +01:00
|
|
|
|
2007-02-12 15:55:03 +01:00
|
|
|
if ( len == 0 )
|
|
|
|
{
|
2019-06-11 04:27:39 +02:00
|
|
|
strings[0] = "Regular";
|
2007-02-12 22:44:10 +01:00
|
|
|
lengths[0] = ft_strlen( strings[0] );
|
|
|
|
len = lengths[0] + 1;
|
2005-11-21 18:32:03 +01:00
|
|
|
}
|
2007-02-12 15:55:03 +01:00
|
|
|
|
2003-11-13 11:19:27 +01:00
|
|
|
{
|
2007-02-12 15:55:03 +01:00
|
|
|
char* s;
|
2003-11-13 11:19:27 +01:00
|
|
|
|
|
|
|
|
2021-04-23 06:05:18 +02:00
|
|
|
if ( FT_QALLOC( face->style_name, len ) )
|
2003-11-13 11:19:27 +01:00
|
|
|
return error;
|
|
|
|
|
2007-02-12 15:55:03 +01:00
|
|
|
s = face->style_name;
|
2003-11-13 11:19:27 +01:00
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
for ( nn = 0; nn < 4; nn++ )
|
2003-11-13 11:19:27 +01:00
|
|
|
{
|
2019-06-11 04:27:39 +02:00
|
|
|
const char* src = strings[nn];
|
2007-02-12 15:55:03 +01:00
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
|
2007-02-12 23:08:15 +01:00
|
|
|
len = lengths[nn];
|
|
|
|
|
2016-12-26 17:08:17 +01:00
|
|
|
if ( !src )
|
2007-02-12 15:55:03 +01:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* separate elements with a space */
|
2007-02-12 22:44:10 +01:00
|
|
|
if ( s != face->style_name )
|
2007-02-12 15:55:03 +01:00
|
|
|
*s++ = ' ';
|
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
ft_memcpy( s, src, len );
|
2007-02-12 15:55:03 +01:00
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
/* need to convert spaces to dashes for */
|
|
|
|
/* add_style_name and setwidth_name */
|
|
|
|
if ( nn == 0 || nn == 3 )
|
2007-02-12 15:55:03 +01:00
|
|
|
{
|
2009-07-31 17:30:15 +02:00
|
|
|
size_t mm;
|
2003-11-13 11:19:27 +01:00
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
|
|
|
|
for ( mm = 0; mm < len; mm++ )
|
|
|
|
if ( s[mm] == ' ' )
|
2007-02-12 15:55:03 +01:00
|
|
|
s[mm] = '-';
|
|
|
|
}
|
|
|
|
|
|
|
|
s += len;
|
|
|
|
}
|
|
|
|
*s = 0;
|
2003-11-13 11:19:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
BDF_Face_Done( FT_Face bdfface ) /* BDF_Face */
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
2008-10-02 00:39:05 +02:00
|
|
|
BDF_Face face = (BDF_Face)bdfface;
|
|
|
|
FT_Memory memory;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
if ( !face )
|
|
|
|
return;
|
|
|
|
|
|
|
|
memory = FT_FACE_MEMORY( face );
|
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
bdf_free_font( face->bdffont );
|
|
|
|
|
|
|
|
FT_FREE( face->en_table );
|
|
|
|
|
|
|
|
FT_FREE( face->charset_encoding );
|
|
|
|
FT_FREE( face->charset_registry );
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_FREE( bdfface->family_name );
|
2005-11-21 18:32:03 +01:00
|
|
|
FT_FREE( bdfface->style_name );
|
2002-05-21 16:13:01 +02:00
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_FREE( bdfface->available_sizes );
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
FT_FREE( face->bdffont );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
|
|
|
BDF_Face_Init( FT_Stream stream,
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_Face bdfface, /* BDF_Face */
|
2002-05-21 16:13:01 +02:00
|
|
|
FT_Int face_index,
|
|
|
|
FT_Int num_params,
|
|
|
|
FT_Parameter* params )
|
|
|
|
{
|
2013-03-14 11:21:17 +01:00
|
|
|
FT_Error error = FT_Err_Ok;
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
BDF_Face face = (BDF_Face)bdfface;
|
2002-05-21 16:13:01 +02:00
|
|
|
FT_Memory memory = FT_FACE_MEMORY( face );
|
|
|
|
|
* builds/unix/ftsystem.c, include/freetype/config/ftheader.h,
include/freetype/internal/services/svotval.h,
include/freetype/internal/services/svpfr.h,
src/base/ftsystem.c, src/bdf/bdfdrivr.c, src/cache/ftcbasic.c,
src/cff/cffcmap.c, src/gzip/ftgzip.c, src/lzw/ftlzw.c,
src/lzw/ftlzw2.c, src/psaux/t1cmap.c, src/sfnt/ttbdf.c,
src/smooth/ftgrays.c:
solved -Wmissing-prototypes warnings with GCC
2006-02-25 15:53:02 +01:00
|
|
|
bdf_font_t* font = NULL;
|
2002-05-21 16:13:01 +02:00
|
|
|
bdf_options_t options;
|
|
|
|
|
|
|
|
FT_UNUSED( num_params );
|
|
|
|
FT_UNUSED( params );
|
|
|
|
|
|
|
|
|
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
|
|
|
FT_TRACE2(( "BDF driver\n" ));
|
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
if ( FT_STREAM_SEEK( 0 ) )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
options.correct_metrics = 1; /* FZ XXX: options semantics */
|
|
|
|
options.keep_unencoded = 1;
|
|
|
|
options.keep_comments = 0;
|
|
|
|
options.font_spacing = BDF_PROPORTIONAL;
|
|
|
|
|
|
|
|
error = bdf_load_font( stream, memory, &options, &font );
|
2013-03-14 17:50:49 +01:00
|
|
|
if ( FT_ERR_EQ( error, Missing_Startfont_Field ) )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
|
|
|
FT_TRACE2(( " not a BDF file\n" ));
|
2002-05-21 16:13:01 +02:00
|
|
|
goto Fail;
|
|
|
|
}
|
|
|
|
else if ( error )
|
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
/* we have a bdf font: let's construct the face object */
|
|
|
|
face->bdffont = font;
|
2013-09-25 03:57:17 +02:00
|
|
|
|
2017-06-03 07:38:11 +02:00
|
|
|
/* BDF cannot have multiple faces in a single font file.
|
2013-09-25 03:57:17 +02:00
|
|
|
* XXX: non-zero face_index is already invalid argument, but
|
|
|
|
* Type1, Type42 driver has a convention to return
|
|
|
|
* an invalid argument error when the font could be
|
|
|
|
* opened by the specified driver.
|
|
|
|
*/
|
2015-08-13 15:22:17 +02:00
|
|
|
if ( face_index > 0 && ( face_index & 0xFFFF ) > 0 )
|
|
|
|
{
|
2013-09-25 03:57:17 +02:00
|
|
|
FT_ERROR(( "BDF_Face_Init: invalid face index\n" ));
|
|
|
|
BDF_Face_Done( bdfface );
|
|
|
|
return FT_THROW( Invalid_Argument );
|
|
|
|
}
|
2014-11-20 04:10:29 +01:00
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
|
|
|
bdf_property_t* prop = NULL;
|
|
|
|
|
|
|
|
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE4(( " number of glyphs: allocated %ld (used %ld)\n",
|
2002-05-21 16:13:01 +02:00
|
|
|
font->glyphs_size,
|
|
|
|
font->glyphs_used ));
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE4(( " number of unencoded glyphs: allocated %ld (used %ld)\n",
|
2002-05-21 16:13:01 +02:00
|
|
|
font->unencoded_size,
|
|
|
|
font->unencoded_used ));
|
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
bdfface->num_faces = 1;
|
|
|
|
bdfface->face_index = 0;
|
2013-12-25 08:50:50 +01:00
|
|
|
|
|
|
|
bdfface->face_flags |= FT_FACE_FLAG_FIXED_SIZES |
|
2018-06-06 13:23:54 +02:00
|
|
|
FT_FACE_FLAG_HORIZONTAL;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2003-04-25 07:35:04 +02:00
|
|
|
prop = bdf_get_font_property( font, "SPACING" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop && prop->format == BDF_ATOM &&
|
|
|
|
prop->value.atom &&
|
|
|
|
( *(prop->value.atom) == 'M' || *(prop->value.atom) == 'm' ||
|
|
|
|
*(prop->value.atom) == 'C' || *(prop->value.atom) == 'c' ) )
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
bdfface->face_flags |= FT_FACE_FLAG_FIXED_WIDTH;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
/* FZ XXX: TO DO: FT_FACE_FLAGS_VERTICAL */
|
|
|
|
/* FZ XXX: I need a font to implement this */
|
|
|
|
|
2003-04-25 07:35:04 +02:00
|
|
|
prop = bdf_get_font_property( font, "FAMILY_NAME" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop && prop->value.atom )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
2007-02-12 15:55:03 +01:00
|
|
|
if ( FT_STRDUP( bdfface->family_name, prop->value.atom ) )
|
2002-05-21 16:13:01 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
else
|
2015-04-12 05:54:19 +02:00
|
|
|
bdfface->family_name = NULL;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2016-12-17 20:47:42 +01:00
|
|
|
if ( FT_SET_ERROR( bdf_interpret_style( face ) ) )
|
2003-11-13 11:19:27 +01:00
|
|
|
goto Exit;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2004-06-22 14:28:17 +02:00
|
|
|
/* the number of glyphs (with one slot for the undefined glyph */
|
|
|
|
/* at position 0 and all unencoded glyphs) */
|
2015-02-22 09:16:53 +01:00
|
|
|
bdfface->num_glyphs = (FT_Long)( font->glyphs_size + 1 );
|
2002-05-21 16:13:01 +02:00
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
bdfface->num_fixed_sizes = 1;
|
|
|
|
if ( FT_NEW_ARRAY( bdfface->available_sizes, 1 ) )
|
2002-05-21 16:13:01 +02:00
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
{
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_Bitmap_Size* bsize = bdfface->available_sizes;
|
2004-02-08 17:30:37 +01:00
|
|
|
FT_Short resolution_x = 0, resolution_y = 0;
|
2017-09-05 15:28:21 +02:00
|
|
|
long value;
|
2003-07-01 09:28:55 +02:00
|
|
|
|
|
|
|
|
2016-09-28 19:06:21 +02:00
|
|
|
FT_ZERO( bsize );
|
2003-07-01 09:28:55 +02:00
|
|
|
|
2017-06-03 07:38:11 +02:00
|
|
|
/* sanity checks */
|
2017-06-15 19:39:50 +02:00
|
|
|
if ( font->font_ascent > 0x7FFF || font->font_ascent < -0x7FFF )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
font->font_ascent = font->font_ascent < 0 ? -0x7FFF : 0x7FFF;
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping font ascent to value %ld\n",
|
2017-06-03 07:38:11 +02:00
|
|
|
font->font_ascent ));
|
|
|
|
}
|
2017-06-15 19:39:50 +02:00
|
|
|
if ( font->font_descent > 0x7FFF || font->font_descent < -0x7FFF )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
font->font_descent = font->font_descent < 0 ? -0x7FFF : 0x7FFF;
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping font descent to value %ld\n",
|
2017-06-03 07:38:11 +02:00
|
|
|
font->font_descent ));
|
|
|
|
}
|
|
|
|
|
2004-08-01 01:04:23 +02:00
|
|
|
bsize->height = (FT_Short)( font->font_ascent + font->font_descent );
|
2003-07-01 09:28:55 +02:00
|
|
|
|
|
|
|
prop = bdf_get_font_property( font, "AVERAGE_WIDTH" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
|
|
|
if ( prop->value.l < 0 )
|
|
|
|
FT_TRACE0(( "BDF_Face_Init: negative average width\n" ));
|
|
|
|
#endif
|
2017-06-15 19:39:50 +02:00
|
|
|
if ( prop->value.l > 0x7FFFL * 10 - 5 ||
|
|
|
|
prop->value.l < -( 0x7FFFL * 10 - 5 ) )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
bsize->width = 0x7FFF;
|
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping average width to value %d\n",
|
|
|
|
bsize->width ));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bsize->width = FT_ABS( (FT_Short)( ( prop->value.l + 5 ) / 10 ) );
|
|
|
|
}
|
2004-02-08 17:30:37 +01:00
|
|
|
else
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
/* this is a heuristical value */
|
|
|
|
bsize->width = (FT_Short)FT_MulDiv( bsize->height, 2, 3 );
|
|
|
|
}
|
2003-07-01 09:28:55 +02:00
|
|
|
|
2003-04-25 07:35:04 +02:00
|
|
|
prop = bdf_get_font_property( font, "POINT_SIZE" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
|
|
|
if ( prop->value.l < 0 )
|
|
|
|
FT_TRACE0(( "BDF_Face_Init: negative point size\n" ));
|
|
|
|
#endif
|
2003-09-01 09:06:06 +02:00
|
|
|
/* convert from 722.7 decipoints to 72 points per inch */
|
2017-06-15 19:39:50 +02:00
|
|
|
if ( prop->value.l > 0x504C2L || /* 0x7FFF * 72270/7200 */
|
|
|
|
prop->value.l < -0x504C2L )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
bsize->size = 0x7FFF;
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n",
|
2017-06-03 07:38:11 +02:00
|
|
|
bsize->size ));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bsize->size = FT_MulDiv( FT_ABS( prop->value.l ),
|
|
|
|
64 * 7200,
|
|
|
|
72270L );
|
|
|
|
}
|
2017-09-05 15:28:21 +02:00
|
|
|
else if ( font->point_size )
|
|
|
|
{
|
|
|
|
if ( font->point_size > 0x7FFF )
|
|
|
|
{
|
|
|
|
bsize->size = 0x7FFF;
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping point size to value %ld\n",
|
2017-09-05 15:28:21 +02:00
|
|
|
bsize->size ));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bsize->size = (FT_Pos)font->point_size << 6;
|
|
|
|
}
|
2006-06-27 08:20:01 +02:00
|
|
|
else
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
/* this is a heuristical value */
|
2017-06-02 09:16:52 +02:00
|
|
|
bsize->size = bsize->width * 64;
|
2017-06-03 07:38:11 +02:00
|
|
|
}
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2004-02-08 17:30:37 +01:00
|
|
|
prop = bdf_get_font_property( font, "PIXEL_SIZE" );
|
|
|
|
if ( prop )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
|
|
|
if ( prop->value.l < 0 )
|
|
|
|
FT_TRACE0(( "BDF_Face_Init: negative pixel size\n" ));
|
|
|
|
#endif
|
2017-06-15 19:39:50 +02:00
|
|
|
if ( prop->value.l > 0x7FFF || prop->value.l < -0x7FFF )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
bsize->y_ppem = 0x7FFF << 6;
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping pixel size to value %ld\n",
|
2017-06-03 07:38:11 +02:00
|
|
|
bsize->y_ppem ));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
bsize->y_ppem = FT_ABS( (FT_Short)prop->value.l ) << 6;
|
|
|
|
}
|
2004-02-08 17:30:37 +01:00
|
|
|
|
2003-07-01 09:28:55 +02:00
|
|
|
prop = bdf_get_font_property( font, "RESOLUTION_X" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop )
|
2017-09-05 15:28:21 +02:00
|
|
|
value = prop->value.l;
|
|
|
|
else
|
|
|
|
value = (long)font->resolution_x;
|
|
|
|
if ( value )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
2017-09-05 15:28:21 +02:00
|
|
|
if ( value < 0 )
|
2017-06-03 07:38:11 +02:00
|
|
|
FT_TRACE0(( "BDF_Face_Init: negative X resolution\n" ));
|
|
|
|
#endif
|
2017-09-05 15:28:21 +02:00
|
|
|
if ( value > 0x7FFF || value < -0x7FFF )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
resolution_x = 0x7FFF;
|
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping X resolution to value %d\n",
|
|
|
|
resolution_x ));
|
|
|
|
}
|
|
|
|
else
|
2017-09-05 15:28:21 +02:00
|
|
|
resolution_x = FT_ABS( (FT_Short)value );
|
2017-06-03 07:38:11 +02:00
|
|
|
}
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2003-07-01 09:28:55 +02:00
|
|
|
prop = bdf_get_font_property( font, "RESOLUTION_Y" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop )
|
2017-09-05 15:28:21 +02:00
|
|
|
value = prop->value.l;
|
|
|
|
else
|
|
|
|
value = (long)font->resolution_y;
|
|
|
|
if ( value )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
2017-09-05 15:28:21 +02:00
|
|
|
if ( value < 0 )
|
2017-06-03 07:38:11 +02:00
|
|
|
FT_TRACE0(( "BDF_Face_Init: negative Y resolution\n" ));
|
|
|
|
#endif
|
2017-09-05 15:28:21 +02:00
|
|
|
if ( value > 0x7FFF || value < -0x7FFF )
|
2017-06-03 07:38:11 +02:00
|
|
|
{
|
|
|
|
resolution_y = 0x7FFF;
|
|
|
|
FT_TRACE0(( "BDF_Face_Init: clamping Y resolution to value %d\n",
|
|
|
|
resolution_y ));
|
|
|
|
}
|
|
|
|
else
|
2017-09-05 15:28:21 +02:00
|
|
|
resolution_y = FT_ABS( (FT_Short)value );
|
2017-06-03 07:38:11 +02:00
|
|
|
}
|
* src/winfonts/winfnt.c (FNT_Load_Glyph): Use first_char in
computation of glyph_index.
(FNT_Size_Set_Pixels): To find a strike, first check pixel_height
only, then try to find a better hit by comparing pixel_width also.
Without this fix it isn't possible to access all strikes.
Also compute metrics.max_advance to be in sync with other bitmap
drivers.
* src/base/ftobjs.c (FT_Set_Char_Size): Remove redundant code.
(FT_Set_Pixel_Size): Assign value to `metrics' after validation of
arguments.
Synchronize computation of height and width for bitmap strikes. The
`width' field in the FT_Bitmap_Size structure is now only useful to
enumerate different strikes. The `max_advance' field of the
FT_Size_Metrics structure should be used to get the (maximum) width
of a strike.
* src/bdf/bdfdrivr.c (BDF_Face_Init): Don't use AVERAGE_WIDTH for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.
* src/pcf/pcfread.c (pcf_load_font): Don't use RESOLUTION_X for
computing `available_sizes->width' but make it always equal to
`available_sizes->height'.
* src/truetype/ttdriver.c (Set_Pixel_Sizes): Pass only single
argument to function.
* src/psnames/psmodule.c (ps_unicode_value): Handle `.' after
`uniXXXX' and `uXXXX[X[X]]'.
* src/bdf/bdfdrivr.c: s/FT_Err_/BDF_Err/.
* src/cache/ftccache.c, src/cache/ftcsbits.c, src/cache/ftlru.c:
s/FT_Err_/FTC_Err_/.
* src/cff/cffcmap.c: s/FT_Err_/CFF_Err_/.
* src/pcf/pcfdrivr.c: s/FT_Err_/PCF_Err_/.
* src/psaux/t1cmap.c: Include psauxerr.h.
s/FT_Err_/PSaux_Err_/.
* src/pshinter/pshnterr.h: New file.
* src/pshinter/rules.mk: Updated.
* src/pshinter/pshalgo.c, src/pshinter/pshrec.c: Include pshnterr.h.
s/FT_Err_/PSH_Err_/.
* src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c:
s/FT_Err_/PFR_Err_/.
* src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttload.c: s/FT_Err_/SFNT_Err_/.
* src/truetype/ttgload.c: s/FT_Err_/TT_Err_/.
* src/gzip/ftgzip.c: Load FT_MODULE_ERRORS_H and define
FT_ERR_PREFIX and FT_ERR_BASE.
s/FT_Err_/Gzip_Err_/.
2003-06-22 17:33:53 +02:00
|
|
|
|
2004-02-08 17:30:37 +01:00
|
|
|
if ( bsize->y_ppem == 0 )
|
2003-07-01 09:28:55 +02:00
|
|
|
{
|
2004-02-08 17:30:37 +01:00
|
|
|
bsize->y_ppem = bsize->size;
|
|
|
|
if ( resolution_y )
|
2017-06-03 07:38:11 +02:00
|
|
|
bsize->y_ppem = FT_MulDiv( bsize->y_ppem, resolution_y, 72 );
|
2003-07-01 09:28:55 +02:00
|
|
|
}
|
2004-02-08 17:30:37 +01:00
|
|
|
if ( resolution_x && resolution_y )
|
2017-06-03 07:38:11 +02:00
|
|
|
bsize->x_ppem = FT_MulDiv( bsize->y_ppem,
|
|
|
|
resolution_x,
|
|
|
|
resolution_y );
|
2004-02-08 17:30:37 +01:00
|
|
|
else
|
|
|
|
bsize->x_ppem = bsize->y_ppem;
|
2003-07-01 09:28:55 +02:00
|
|
|
}
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
/* encoding table */
|
|
|
|
{
|
|
|
|
bdf_glyph_t* cur = font->glyphs;
|
|
|
|
unsigned long n;
|
|
|
|
|
|
|
|
|
|
|
|
if ( FT_NEW_ARRAY( face->en_table, font->glyphs_size ) )
|
|
|
|
goto Exit;
|
|
|
|
|
2004-06-22 14:28:17 +02:00
|
|
|
face->default_glyph = 0;
|
2002-05-21 16:13:01 +02:00
|
|
|
for ( n = 0; n < font->glyphs_size; n++ )
|
|
|
|
{
|
|
|
|
(face->en_table[n]).enc = cur[n].encoding;
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE4(( " idx %ld, val 0x%lX\n", n, cur[n].encoding ));
|
2015-02-22 09:16:53 +01:00
|
|
|
(face->en_table[n]).glyph = (FT_UShort)n;
|
* builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
include/freetype/internal/ftdriver.h,
include/freetype/internal/ftmemory.h,
include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
massive changes to the internals to respect the internal object layouts
and exported functions of FreeType 2.1.7. Note that the cache sub-system
cannot be fully retrofitted, unfortunately.
2006-02-16 23:45:31 +01:00
|
|
|
|
2004-06-22 14:28:17 +02:00
|
|
|
if ( cur[n].encoding == font->default_char )
|
2009-07-31 17:32:06 +02:00
|
|
|
{
|
|
|
|
if ( n < FT_UINT_MAX )
|
|
|
|
face->default_glyph = (FT_UInt)n;
|
|
|
|
else
|
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
|
|
|
FT_TRACE1(( "BDF_Face_Init:"
|
2020-07-28 07:33:40 +02:00
|
|
|
" idx %ld is too large for this system\n", n ));
|
2009-07-31 17:32:06 +02:00
|
|
|
}
|
2002-05-21 16:13:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* charmaps */
|
|
|
|
{
|
2015-04-12 05:54:19 +02:00
|
|
|
bdf_property_t *charset_registry, *charset_encoding;
|
2002-06-14 10:54:02 +02:00
|
|
|
FT_Bool unicode_charmap = 0;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
charset_registry =
|
2003-04-25 07:35:04 +02:00
|
|
|
bdf_get_font_property( font, "CHARSET_REGISTRY" );
|
2002-05-21 16:13:01 +02:00
|
|
|
charset_encoding =
|
2003-04-25 07:35:04 +02:00
|
|
|
bdf_get_font_property( font, "CHARSET_ENCODING" );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( charset_registry && charset_encoding )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( charset_registry->format == BDF_ATOM &&
|
|
|
|
charset_encoding->format == BDF_ATOM &&
|
|
|
|
charset_registry->value.atom &&
|
|
|
|
charset_encoding->value.atom )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
2003-05-21 09:39:42 +02:00
|
|
|
const char* s;
|
|
|
|
|
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
if ( FT_STRDUP( face->charset_encoding,
|
|
|
|
charset_encoding->value.atom ) ||
|
|
|
|
FT_STRDUP( face->charset_registry,
|
|
|
|
charset_registry->value.atom ) )
|
2002-05-21 16:13:01 +02:00
|
|
|
goto Exit;
|
2003-05-21 09:39:42 +02:00
|
|
|
|
2007-02-12 22:44:10 +01:00
|
|
|
/* Uh, oh, compare first letters manually to avoid dependency */
|
|
|
|
/* on locales. */
|
2003-05-21 09:39:42 +02:00
|
|
|
s = face->charset_registry;
|
|
|
|
if ( ( s[0] == 'i' || s[0] == 'I' ) &&
|
|
|
|
( s[1] == 's' || s[1] == 'S' ) &&
|
|
|
|
( s[2] == 'o' || s[2] == 'O' ) )
|
|
|
|
{
|
|
|
|
s += 3;
|
|
|
|
if ( !ft_strcmp( s, "10646" ) ||
|
|
|
|
( !ft_strcmp( s, "8859" ) &&
|
|
|
|
!ft_strcmp( face->charset_encoding, "1" ) ) )
|
2017-05-24 07:40:46 +02:00
|
|
|
unicode_charmap = 1;
|
|
|
|
/* another name for ASCII */
|
|
|
|
else if ( !ft_strcmp( s, "646.1991" ) &&
|
|
|
|
!ft_strcmp( face->charset_encoding, "IRV" ) )
|
|
|
|
unicode_charmap = 1;
|
2003-05-21 09:39:42 +02:00
|
|
|
}
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
FT_CharMapRec charmap;
|
|
|
|
|
|
|
|
|
|
|
|
charmap.face = FT_FACE( face );
|
* 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
|
|
|
charmap.encoding = FT_ENCODING_NONE;
|
2010-07-09 05:26:33 +02:00
|
|
|
/* initial platform/encoding should indicate unset status? */
|
|
|
|
charmap.platform_id = TT_PLATFORM_APPLE_UNICODE;
|
|
|
|
charmap.encoding_id = TT_APPLE_ID_DEFAULT;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
if ( unicode_charmap )
|
|
|
|
{
|
* 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
|
|
|
charmap.encoding = FT_ENCODING_UNICODE;
|
2010-07-09 05:26:33 +02:00
|
|
|
charmap.platform_id = TT_PLATFORM_MICROSOFT;
|
|
|
|
charmap.encoding_id = TT_MS_ID_UNICODE_CS;
|
2002-06-14 10:54:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
|
|
|
|
}
|
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-06-14 10:54:02 +02:00
|
|
|
/* otherwise assume Adobe standard encoding */
|
|
|
|
|
|
|
|
{
|
|
|
|
FT_CharMapRec charmap;
|
|
|
|
|
|
|
|
|
|
|
|
charmap.face = FT_FACE( face );
|
* 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
|
|
|
charmap.encoding = FT_ENCODING_ADOBE_STANDARD;
|
2010-07-09 05:26:33 +02:00
|
|
|
charmap.platform_id = TT_PLATFORM_ADOBE;
|
|
|
|
charmap.encoding_id = TT_ADOBE_ID_STANDARD;
|
2002-06-14 10:54:02 +02:00
|
|
|
|
|
|
|
error = FT_CMap_New( &bdf_cmap_class, NULL, &charmap, NULL );
|
2002-06-19 17:57:55 +02:00
|
|
|
|
|
|
|
/* Select default charmap */
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
if ( bdfface->num_charmaps )
|
|
|
|
bdfface->charmap = bdfface->charmaps[0];
|
2002-06-14 10:54:02 +02:00
|
|
|
}
|
2002-05-21 16:13:01 +02:00
|
|
|
}
|
2004-06-22 14:28:17 +02:00
|
|
|
}
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
Exit:
|
|
|
|
return error;
|
|
|
|
|
|
|
|
Fail:
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
BDF_Face_Done( bdfface );
|
2013-03-14 10:27:35 +01:00
|
|
|
return FT_THROW( Unknown_File_Format );
|
2002-05-21 16:13:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
BDF_Size_Select( FT_Size size,
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
FT_ULong strike_index )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
bdf_font_t* bdffont = ( (BDF_Face)size->face )->bdffont;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
FT_Select_Metrics( size->face, strike_index );
|
2006-01-13 15:53:28 +01:00
|
|
|
|
2015-08-01 07:53:48 +02:00
|
|
|
size->metrics.ascender = bdffont->font_ascent * 64;
|
|
|
|
size->metrics.descender = -bdffont->font_descent * 64;
|
|
|
|
size->metrics.max_advance = bdffont->bbx.width * 64;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2013-03-14 11:21:17 +01:00
|
|
|
return FT_Err_Ok;
|
2002-05-21 16:13:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
BDF_Size_Request( FT_Size size,
|
|
|
|
FT_Size_Request req )
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
{
|
2006-01-14 06:09:30 +01:00
|
|
|
FT_Face face = size->face;
|
|
|
|
FT_Bitmap_Size* bsize = face->available_sizes;
|
|
|
|
bdf_font_t* bdffont = ( (BDF_Face)face )->bdffont;
|
2013-03-14 17:50:49 +01:00
|
|
|
FT_Error error = FT_ERR( Invalid_Pixel_Size );
|
2006-01-14 06:09:30 +01:00
|
|
|
FT_Long height;
|
2004-07-25 23:18:29 +02:00
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
|
* include/freetype/freetype.h (FT_Select_Size): Rename the second
argument from `idx' to `strike_index'.
(FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
this enum.
* include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
FT_REQUEST_HEIGHT): New macros to get the width and height of a
request, in fractional pixels.
* include/freetype/internal/ftobjs.h (FT_Select_Metrics,
FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
FT_Request_Metrics): New base functions to set the font metrics. They
were part of FT_Select_Size/FT_Request_Size and are made independent
functions so that metrics are not set again and again.
* src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
only when driver's size_select/size_request is NULL. That is, drivers
should set the metrics themselves.
(FT_Match_Size): Round before matching. This was what we did and it
does cause some problems without rounding.
* src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
(tt_size_select): Set the font metrics.
s/index/strike_index/.
The scaled metrics are always preferred over strikes' metrics, even
when some strike is selected. This is done because the strikes'
metrics are not reliable, e.g., the sign of the descender is wrong for
some fonts.
* src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
(tt_size_request): Set the font metrics.
Call cff_size_select/tt_size_select when some strike is matched.
* src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
Set the font metrics.
s/index/strike_index/.
* src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
files were committed. Just a catch-up.
(PS_Conv_ToFixed): Remove the `goto'.
(PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
* src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
(tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
advertised metrics in `available_sizes' are different from those
actually used.
2006-01-23 15:12:40 +01:00
|
|
|
height = FT_REQUEST_HEIGHT( req );
|
2006-01-14 06:09:30 +01:00
|
|
|
height = ( height + 32 ) >> 6;
|
|
|
|
|
|
|
|
switch ( req->type )
|
|
|
|
{
|
|
|
|
case FT_SIZE_REQUEST_TYPE_NOMINAL:
|
* src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c,
src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c,
src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings
(Atari PureC).
2008-11-29 23:50:24 +01:00
|
|
|
if ( height == ( ( bsize->y_ppem + 32 ) >> 6 ) )
|
2013-03-14 11:21:17 +01:00
|
|
|
error = FT_Err_Ok;
|
2006-01-14 06:09:30 +01:00
|
|
|
break;
|
2006-01-14 08:10:45 +01:00
|
|
|
|
2006-01-14 06:09:30 +01:00
|
|
|
case FT_SIZE_REQUEST_TYPE_REAL_DIM:
|
|
|
|
if ( height == ( bdffont->font_ascent +
|
|
|
|
bdffont->font_descent ) )
|
2013-03-14 11:21:17 +01:00
|
|
|
error = FT_Err_Ok;
|
2006-01-14 06:09:30 +01:00
|
|
|
break;
|
2006-01-14 08:10:45 +01:00
|
|
|
|
2006-01-14 06:09:30 +01:00
|
|
|
default:
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Unimplemented_Feature );
|
2006-01-14 06:09:30 +01:00
|
|
|
break;
|
|
|
|
}
|
2004-07-25 23:18:29 +02:00
|
|
|
|
* include/freetype/internal/sfnt.h (SFNT_Interface): New method
`load_strike_metrics' used to load the strike's metrics.
* src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
* src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
* src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
nominal size unless it is obviously incorrect.
* include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
FNT driver.
Introduce new size selection interface.
* include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec_):
Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
`select_size'.
* include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
(FT_Select_Size, FT_Request_Size): API additions to export the new
size selection interface.
* src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
`FT_Request_Size'.
* include/freetype/internal/ftobjs.h (FT_Match_Size),
src/base/ftobjs.c (FT_Match_Size): New function to match a size
request against `available_sizes'. Drivers supporting bitmap strikes
can use this function to implement `request_size'.
* src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
Update to new size selection interface.
* src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
selection interface.
Make `strike_index' FT_ULong and always defined.
Use `load_strike_metrics' provided by SFNT interface.
2006-01-13 13:21:31 +01:00
|
|
|
if ( error )
|
|
|
|
return error;
|
|
|
|
else
|
|
|
|
return BDF_Size_Select( size, 0 );
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
include/freetype/internal/ftdriver.h,
include/freetype/internal/ftmemory.h,
include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
massive changes to the internals to respect the internal object layouts
and exported functions of FreeType 2.1.7. Note that the cache sub-system
cannot be fully retrofitted, unfortunately.
2006-02-16 23:45:31 +01:00
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
2002-05-21 16:13:01 +02:00
|
|
|
BDF_Glyph_Load( FT_GlyphSlot slot,
|
|
|
|
FT_Size size,
|
|
|
|
FT_UInt glyph_index,
|
* src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
tt_face_get_ps_name): Replace switch statement with if clauses to
make it more portable.
* src/cff/cffobjs.c (cff_face_init): Ditto.
* include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for
`module_size'.
* include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for
`glyph_size'.
* src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to
`FT_Render_Mode'.
(FT_Render_Glyph_Internal): Change third parameter to
`FT_Render_Mode'.
* src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter
to `FT_Render_Mode'.
* src/raster/ftrend1.c (ft_raster1_render): Change third parameter
to `FT_Render_Mode'.
* src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd,
ft_smooth_render_lcd_v): Ditto.
(ft_smooth_render_generic): Change third and fifth parameter to
`FT_Render_Mode'.
* include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
include/freetype/ftglyph.h: Updated.
* src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c
(PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load),
src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c
(T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change
fourth parameter to `FT_Int32'.
* src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters
and declare them as unused.
* src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'.
* src/psnames/psnames.h (PS_Unicode_Value_Func): Change return
value to FT_UInt32.
* src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table):
Updated accordingly.
* src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'.
(cff_get_glyph_name): Use cast for result of ft_strlen.
* src/cff/cffparse.c (cff_parse_real): User cast for assigning
`exp'.
* src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for
some local variables.
(cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some
switch statements.
(cff_font_load): Use cast in call to CFF_Load_FD_Select.
* src/cff/cffobjs.c (cff_size_init): Use more casts.
(cff_face_init): Use FT_Int32 for `flags'.
* src/cff/cffgload.c (cff_operator_seac): Use cast for assigning
`adx' and `ady'.
(cff_decoder_parse_charstrings): Use FT_ULong for third parameter.
Use more casts.
* src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'.
* src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'.
* src/cid/cidgload.c (cid_load_glyph): Add missing cast for
`cid_get_offset'.
* src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use
cast for `num_points'.
(t1_decoder_init): Use cast for assigning `decoder->num_glyphs'.
* src/base/ftdebug.c (ft_debug_init): Use FT_Int.
* include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use
`FT_Int32' for fourth parameter.
* src/base/ftobjs.c (open_face): Use cast for calling
clazz->init_face.
* src/raster/ftraster.c (Set_High_Precision): Use `1' instead of
`1L'.
(Finalize_Profile_Table, Line_Up, ft_black_init): Use casts.
* src/raster/ftrend1.c (ft_raster1_render): Ditto.
* src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long
constant.
* builds/amiga/include/freetype/config/ftmodule.h: Updated.
2002-09-27 13:09:23 +02:00
|
|
|
FT_Int32 load_flags )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
2006-11-19 10:19:17 +01:00
|
|
|
BDF_Face bdf = (BDF_Face)FT_SIZE_FACE( size );
|
|
|
|
FT_Face face = FT_FACE( bdf );
|
2013-03-14 11:21:17 +01:00
|
|
|
FT_Error error = FT_Err_Ok;
|
2004-12-14 17:01:29 +01:00
|
|
|
FT_Bitmap* bitmap = &slot->bitmap;
|
|
|
|
bdf_glyph_t glyph;
|
2006-11-19 10:19:17 +01:00
|
|
|
int bpp = bdf->bdffont->bpp;
|
2002-05-21 16:13:01 +02:00
|
|
|
|
|
|
|
FT_UNUSED( load_flags );
|
|
|
|
|
|
|
|
|
2014-11-25 10:21:13 +01:00
|
|
|
if ( !face )
|
|
|
|
{
|
|
|
|
error = FT_THROW( Invalid_Face_Handle );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( glyph_index >= (FT_UInt)face->num_glyphs )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2002-05-21 16:13:01 +02:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
2013-08-26 12:55:48 +02:00
|
|
|
FT_TRACE1(( "BDF_Glyph_Load: glyph index %d\n", glyph_index ));
|
|
|
|
|
2004-06-22 14:28:17 +02:00
|
|
|
/* index 0 is the undefined glyph */
|
|
|
|
if ( glyph_index == 0 )
|
2006-11-19 10:19:17 +01:00
|
|
|
glyph_index = bdf->default_glyph;
|
2004-06-22 14:28:17 +02:00
|
|
|
else
|
2002-06-16 03:14:16 +02:00
|
|
|
glyph_index--;
|
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
/* slot, bitmap => freetype, glyph => bdflib */
|
2006-11-19 10:19:17 +01:00
|
|
|
glyph = bdf->bdffont->glyphs[glyph_index];
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2002-06-14 10:54:02 +02:00
|
|
|
bitmap->rows = glyph.bbx.height;
|
|
|
|
bitmap->width = glyph.bbx.width;
|
2017-12-18 20:34:05 +01:00
|
|
|
if ( glyph.bpr > FT_INT_MAX )
|
2020-07-28 07:33:40 +02:00
|
|
|
FT_TRACE1(( "BDF_Glyph_Load: too large pitch %ld is truncated\n",
|
2009-07-31 17:32:06 +02:00
|
|
|
glyph.bpr ));
|
|
|
|
bitmap->pitch = (int)glyph.bpr; /* same as FT_Bitmap.pitch */
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2004-12-14 17:01:29 +01:00
|
|
|
/* note: we don't allocate a new array to hold the bitmap; */
|
|
|
|
/* we can simply point to it */
|
|
|
|
ft_glyphslot_set_bitmap( slot, glyph.bitmap );
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2004-12-14 17:01:29 +01:00
|
|
|
switch ( bpp )
|
2002-05-21 16:13:01 +02:00
|
|
|
{
|
2004-12-14 17:01:29 +01:00
|
|
|
case 1:
|
|
|
|
bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY2;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY4;
|
|
|
|
break;
|
|
|
|
case 8:
|
* 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
|
|
|
bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
|
2004-12-14 17:01:29 +01:00
|
|
|
bitmap->num_grays = 256;
|
|
|
|
break;
|
2002-05-21 16:13:01 +02:00
|
|
|
}
|
|
|
|
|
2006-01-15 07:00:49 +01:00
|
|
|
slot->format = FT_GLYPH_FORMAT_BITMAP;
|
2004-03-22 10:25:04 +01:00
|
|
|
slot->bitmap_left = glyph.bbx.x_offset;
|
2002-05-21 16:13:01 +02:00
|
|
|
slot->bitmap_top = glyph.bbx.ascent;
|
|
|
|
|
2015-08-01 07:53:48 +02:00
|
|
|
slot->metrics.horiAdvance = (FT_Pos)( glyph.dwidth * 64 );
|
|
|
|
slot->metrics.horiBearingX = (FT_Pos)( glyph.bbx.x_offset * 64 );
|
|
|
|
slot->metrics.horiBearingY = (FT_Pos)( glyph.bbx.ascent * 64 );
|
|
|
|
slot->metrics.width = (FT_Pos)( bitmap->width * 64 );
|
|
|
|
slot->metrics.height = (FT_Pos)( bitmap->rows * 64 );
|
2002-05-21 16:13:01 +02:00
|
|
|
|
* builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
include/freetype/internal/ftdriver.h,
include/freetype/internal/ftmemory.h,
include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
massive changes to the internals to respect the internal object layouts
and exported functions of FreeType 2.1.7. Note that the cache sub-system
cannot be fully retrofitted, unfortunately.
2006-02-16 23:45:31 +01:00
|
|
|
/*
|
2006-01-15 07:24:53 +01:00
|
|
|
* XXX DWIDTH1 and VVECTOR should be parsed and
|
|
|
|
* used here, provided such fonts do exist.
|
|
|
|
*/
|
2006-01-15 16:01:45 +01:00
|
|
|
ft_synthesize_vertical_metrics( &slot->metrics,
|
2015-08-01 07:53:48 +02:00
|
|
|
bdf->bdffont->bbx.height * 64 );
|
2006-01-15 07:24:53 +01:00
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
Exit:
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
/*
|
|
|
|
*
|
2018-06-03 09:01:17 +02:00
|
|
|
* BDF SERVICE
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
*
|
|
|
|
*/
|
2003-12-19 21:25:14 +01:00
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
static FT_Error
|
|
|
|
bdf_get_bdf_property( BDF_Face face,
|
|
|
|
const char* prop_name,
|
|
|
|
BDF_PropertyRec *aproperty )
|
|
|
|
{
|
|
|
|
bdf_property_t* prop;
|
|
|
|
|
2003-04-23 08:47:12 +02:00
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
FT_ASSERT( face && face->bdffont );
|
|
|
|
|
2003-04-25 07:35:04 +02:00
|
|
|
prop = bdf_get_font_property( face->bdffont, prop_name );
|
2003-11-13 11:19:27 +01:00
|
|
|
if ( prop )
|
2003-01-22 23:45:28 +01:00
|
|
|
{
|
|
|
|
switch ( prop->format )
|
|
|
|
{
|
2003-04-23 08:47:12 +02:00
|
|
|
case BDF_ATOM:
|
|
|
|
aproperty->type = BDF_PROPERTY_TYPE_ATOM;
|
|
|
|
aproperty->u.atom = prop->value.atom;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BDF_INTEGER:
|
2009-07-31 17:30:22 +02:00
|
|
|
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
|
|
|
|
{
|
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
|
|
|
FT_TRACE1(( "bdf_get_bdf_property:"
|
2020-07-25 12:23:22 +02:00
|
|
|
" too large integer 0x%lx is truncated\n",
|
|
|
|
prop->value.l ));
|
2009-07-31 17:30:22 +02:00
|
|
|
}
|
2003-04-23 08:47:12 +02:00
|
|
|
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
|
2009-07-31 17:30:22 +02:00
|
|
|
aproperty->u.integer = (FT_Int32)prop->value.l;
|
2003-04-23 08:47:12 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BDF_CARDINAL:
|
2009-07-31 17:30:22 +02:00
|
|
|
if ( prop->value.ul > 0xFFFFFFFFUL )
|
|
|
|
{
|
Improve tracing.
* src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
(PCF_Face_Done): Remove tracing message.
* src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
(cff_face_init), src/cid/cidobjs.c (cid_face_init),
src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
(sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
(T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
`greeting' message.
* src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
(T42_Open_Face): Improve tracing.
2011-11-26 20:09:39 +01:00
|
|
|
FT_TRACE1(( "bdf_get_bdf_property:"
|
2020-07-25 12:23:22 +02:00
|
|
|
" too large cardinal 0x%lx is truncated\n",
|
|
|
|
prop->value.ul ));
|
2009-07-31 17:30:22 +02:00
|
|
|
}
|
2003-04-23 08:47:12 +02:00
|
|
|
aproperty->type = BDF_PROPERTY_TYPE_CARDINAL;
|
2009-07-31 17:30:22 +02:00
|
|
|
aproperty->u.cardinal = (FT_UInt32)prop->value.ul;
|
2003-04-23 08:47:12 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
goto Fail;
|
2003-01-22 23:45:28 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2003-04-23 08:47:12 +02:00
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
Fail:
|
2013-03-14 10:27:35 +01:00
|
|
|
return FT_THROW( Invalid_Argument );
|
2003-01-22 23:45:28 +01:00
|
|
|
}
|
|
|
|
|
2004-06-22 14:28:17 +02:00
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
static FT_Error
|
|
|
|
bdf_get_charset_id( BDF_Face face,
|
|
|
|
const char* *acharset_encoding,
|
|
|
|
const char* *acharset_registry )
|
|
|
|
{
|
|
|
|
*acharset_encoding = face->charset_encoding;
|
|
|
|
*acharset_registry = face->charset_registry;
|
2003-12-19 21:25:14 +01:00
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
return 0;
|
2003-12-19 21:25:14 +01:00
|
|
|
}
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
static const FT_Service_BDFRec bdf_service_bdf =
|
|
|
|
{
|
2015-10-30 08:07:56 +01:00
|
|
|
(FT_BDF_GetCharsetIdFunc)bdf_get_charset_id, /* get_charset_id */
|
|
|
|
(FT_BDF_GetPropertyFunc) bdf_get_bdf_property /* get_property */
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
2018-06-03 09:01:17 +02:00
|
|
|
* SERVICES LIST
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
*
|
|
|
|
*/
|
2003-12-19 21:25:14 +01:00
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
static const FT_ServiceDescRec bdf_services[] =
|
|
|
|
{
|
2015-03-11 08:09:13 +01:00
|
|
|
{ FT_SERVICE_ID_BDF, &bdf_service_bdf },
|
|
|
|
{ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_BDF },
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
|
* src/truetype/ttobjs.c (tt_driver_done): Fix typo.
* src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
are typecast to the proper BDF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(BDF_Set_Point_Size): New wrapper function.
(bdf_driver_class): Remove casts.
* src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(cff_driver_class): Remove casts.
* src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
Don't use CFF_XXX but FT_XXX arguments which are typecast to the
proper CFF_XXX types within the function.
Update code accordingly.
(cff_point_size_reset): New wrapper function.
* src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
(cid_point_size_reset): New wrapper function.
* src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
* src/cid/cidriver.c (cid_get_interface):
Don't use CID_XXX but FT_XXX arguments which are typecast to the
proper CID_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF.
(t1cid_driver_class): Remove casts.
* src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
* src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
variables (this is done later).
(ft_var_load_avar): Fix call to FT_FRAME_ENTER.
(TT_Get_MM_Var): Fix size for `fvar_fields'.
(TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
correctly.
* src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
current size is zero.
2004-05-06 13:48:35 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Module_Interface )
|
2003-01-22 23:45:28 +01:00
|
|
|
bdf_driver_requester( FT_Module module,
|
|
|
|
const char* name )
|
|
|
|
{
|
|
|
|
FT_UNUSED( module );
|
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
return ft_service_list_lookup( bdf_services, name );
|
2003-01-22 23:45:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* include/freetype/ftmm.h, include/freetype/ftmodule.h,
include/freetype/tttables.h, include/freetype/config/ftconfig.h,
include/freetype/internal/ftobjs.h,
include/freetype/internal/ftserv.h,
include/freetype/internal/internal.h,
include/freetype/internal/sfnt.h,
include/freetype/internal/tttypes.h,
include/freetype/internal/services/bdf.h,
include/freetype/internal/services/glyfdict.h,
include/freetype/internal/services/multmast.h,
include/freetype/internal/services/postname.h,
include/freetype/internal/services/sfnt.h,
include/freetype/internal/services/xf86name.h,
src/base/ftbdf.c, src/base/ftmm.c, src/base/ftobjs.c,
src/base/ftxf86.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/sfnt/sfdriver.c,
src/truetype/ttdriver.c, src/type1/t1driver.c, src/type42/t42drivr.c:
heavy internal modifications to introduce the concept of
"module services". This is the first step towards a massive
simplification of the engine's internals, in order to
get rid of various numbers of hacks.
Note that this changes will break source & binary compatibility
for authors of external font drivers.
Maybe 2.1.6 will be called 2.2.0 after all :-)
2003-09-11 21:51:54 +02:00
|
|
|
|
2002-05-21 16:13:01 +02:00
|
|
|
FT_CALLBACK_TABLE_DEF
|
|
|
|
const FT_Driver_ClassRec bdf_driver_class =
|
|
|
|
{
|
|
|
|
{
|
* include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,
ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
FT_GLYPH_BBIX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* include/freetype/ftmodule.h (ft_module_font_driver,
ft_module_renderer, ft_module_hinter, ft_module_styler,
ft_module_driver_scalable, ft_module_driver_no_outlines,
ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
FT_MODULE_DRIVER_HAS_HINTER.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
as enumeration.
* src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
(winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
the FT_MODULE_DRIVER_NO_OUTLINES flag.
2003-06-17 12:42:27 +02:00
|
|
|
FT_MODULE_FONT_DRIVER |
|
|
|
|
FT_MODULE_DRIVER_NO_OUTLINES,
|
2002-05-21 16:13:01 +02:00
|
|
|
sizeof ( FT_DriverRec ),
|
|
|
|
|
|
|
|
"bdf",
|
|
|
|
0x10000L,
|
|
|
|
0x20000L,
|
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
NULL, /* module-specific interface */
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
NULL, /* FT_Module_Constructor module_init */
|
|
|
|
NULL, /* FT_Module_Destructor module_done */
|
2015-10-19 08:49:25 +02:00
|
|
|
bdf_driver_requester /* FT_Module_Requester get_interface */
|
2002-05-21 16:13:01 +02:00
|
|
|
},
|
|
|
|
|
2002-06-14 10:54:02 +02:00
|
|
|
sizeof ( BDF_FaceRec ),
|
|
|
|
sizeof ( FT_SizeRec ),
|
|
|
|
sizeof ( FT_GlyphSlotRec ),
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2015-10-19 08:49:25 +02:00
|
|
|
BDF_Face_Init, /* FT_Face_InitFunc init_face */
|
|
|
|
BDF_Face_Done, /* FT_Face_DoneFunc done_face */
|
2016-09-17 17:12:50 +02:00
|
|
|
NULL, /* FT_Size_InitFunc init_size */
|
|
|
|
NULL, /* FT_Size_DoneFunc done_size */
|
|
|
|
NULL, /* FT_Slot_InitFunc init_slot */
|
|
|
|
NULL, /* FT_Slot_DoneFunc done_slot */
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2015-10-19 08:49:25 +02:00
|
|
|
BDF_Glyph_Load, /* FT_Slot_LoadFunc load_glyph */
|
2002-05-21 16:13:01 +02:00
|
|
|
|
2016-09-17 17:12:50 +02:00
|
|
|
NULL, /* FT_Face_GetKerningFunc get_kerning */
|
|
|
|
NULL, /* FT_Face_AttachFunc attach_file */
|
|
|
|
NULL, /* FT_Face_GetAdvancesFunc get_advances */
|
* builds/amiga/src/base/ftsystem.c, devel/ftoption.h
include/freetype/ftcache.h, include/freetype/ftoutln.h,
include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h,
include/freetype/config/ftoption.h, include/freetype/internal/ftcalc.h,
include/freetype/internal/ftdriver.h,
include/freetype/internal/ftmemory.h,
include/freetype/internal/ftobjs.h, include/freetype/internal/ftrfork.h,
include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
include/freetype/internal/t1types.h, include/freetype/internal/tttypes.h,
src/base/ftcalc.c, src/base/ftdbgmem.c, src/base/ftobjs.c,
src/base/ftsystem.c, src/base/ftutil.c, src/bdf/bdfdrivr.c,
src/cache/ftccache.c, src/cache/ftccback.h, src/cache/ftccmap.c,
src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
massive changes to the internals to respect the internal object layouts
and exported functions of FreeType 2.1.7. Note that the cache sub-system
cannot be fully retrofitted, unfortunately.
2006-02-16 23:45:31 +01:00
|
|
|
|
2015-10-19 08:49:25 +02:00
|
|
|
BDF_Size_Request, /* FT_Size_RequestFunc request_size */
|
|
|
|
BDF_Size_Select /* FT_Size_SelectFunc select_size */
|
2002-05-21 16:13:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|