2003-06-07 06:02:21 +02:00
|
|
|
/* pcfdrivr.c
|
2001-01-01 18:24:31 +01:00
|
|
|
|
|
|
|
FreeType font driver for pcf files
|
|
|
|
|
2014-03-18 08:39:35 +01:00
|
|
|
Copyright (C) 2000-2004, 2006-2011, 2013, 2014 by
|
2001-06-27 21:46:12 +02:00
|
|
|
Francesco Zappa Nardelli
|
2001-01-01 18:24:31 +01: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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
|
|
|
|
#include FT_INTERNAL_DEBUG_H
|
|
|
|
#include FT_INTERNAL_STREAM_H
|
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
2002-10-31 23:19:27 +01:00
|
|
|
#include FT_GZIP_H
|
2004-03-05 10:26:24 +01:00
|
|
|
#include FT_LZW_H
|
2010-12-31 16:59:33 +01:00
|
|
|
#include FT_BZIP2_H
|
2002-10-31 23:19:27 +01:00
|
|
|
#include FT_ERRORS_H
|
2003-01-22 23:45:28 +01:00
|
|
|
#include FT_BDF_H
|
2012-01-16 18:00:24 +01:00
|
|
|
#include FT_TRUETYPE_IDS_H
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2001-03-20 12:14:24 +01:00
|
|
|
#include "pcf.h"
|
2003-06-07 06:02:21 +02:00
|
|
|
#include "pcfdrivr.h"
|
2003-01-22 23:45:28 +01:00
|
|
|
#include "pcfread.h"
|
2001-01-01 18:24:31 +01:00
|
|
|
|
Complete redesign of error codes. Please check ftmoderr.h for more
details.
* include/freetype/internal/cfferrs.h,
include/freetype/internal/tterrors.h,
include/freetype/internal/t1errors.h: Removed. Replaced with files
local to the module. All extra error codes have been moved to
`fterrors.h'.
* src/sfnt/ttpost.h: Move error codes to `fterrors.h'.
* src/autohint/aherrors.h, src/cache/ftcerror.h, src/cff/cfferrs.h,
src/cid/ciderrs.h, src/pcf/pcferror.h, src/psaux/psauxerr.h,
src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
src/type1/t1errors.h, src/winfonts/fnterrs.h: New files defining the
error names for the module it belongs to.
* include/freetype/ftmoderr.h: New file, defining the module error
offsets. Its structure is similar to `fterrors.h'.
* include/freetype/fterrors.h (FT_NOERRORDEF): New macro.
(FT_ERRORDEF): Redefined to use module error offsets.
All internal error codes are now public; unused error codes have
been removed, some are new.
* include/freetype/config/ftheader.h (FT_MODULE_ERRORS_H): New
macro.
* include/freetype/config/ftoption.h
(FT_CONFIG_OPTION_USE_MODULE_ERRORS): New macro.
All other source files have been updated to use the new error codes;
some already existing (internal) error codes local to a module have
been renamed to give them the same name as in the base module.
All make files have been updated to include the local error files.
* src/cid/cidtokens.h: Replaced with...
* src/cid/cidtoken.h: This file for 8+3 consistency.
* src/raster/ftraster.c: Use macros for header file names.
2001-06-06 19:30:41 +02:00
|
|
|
#include "pcferror.h"
|
* src/pcf/pcfdrivr.c: Revert change from 2004-04-17.
* src/pcf/pcfutil.c: Use FT_LOCAL_DEF.
* src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H.
Use FT_BEGIN_HEADER and FT_END_HEADER.
Use FT_LOCAL.
2004-04-24 George Williams <gww@silcom.com>
Add support for Apple's distortable font technology (in GX fonts).
* devel/ftoption.h, include/freetype/config/ftoption.h
(TT_CONFIG_OPTION_GX_VAR_SUPPORT): New macro.
* include/freetype/ftmm.h (FT_Var_Axis, FT_Var_Named_Style,
FT_MM_Var): New structures.
(FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
FT_Set_Var_Blend_Coordinates): New function declarations.
* include/freetype/internal/services/svmm.h (FT_Get_MM_Var_Func,
FT_Set_Var_Design_Func): New typedefs.
Update MultiMasters service.
* include/freetype/internal/tttypes.h
[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H.
(GX_Blend) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New typedef.
(TT_Face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New members `doblend'
and `blend'.
* include/freetype/tttags.h (TTAG_avar, TTAG_cvar, TTAG_gvar): New
macros.
* include/freetype/internal/fttrace.h: Add `ttgxvar'.
* src/base/ftmm.c (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
FT_Set_Var_Blend_Coordinates): New functions.
* src/sfnt/sfobjs.c (sfnt_load_face)
[TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Set FT_FACE_FLAG_MULTIPLE_MASTERS
flag for GX var fonts.
* src/truetype/ttgxvar.c, src/truetype/ttgxvar.h: New files.
* src/truetype/truetype.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.c.
* src/truetype/ttdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
FT_MULTIPLE_MASTERS_H, FT_SERVICE_MULTIPLE_MASTERS_H, and ttgxvar.h.
(tt_service_gx_multi_masters) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]:
New service.
(tt_services) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated.
* src/truetype/ttgload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.h.
(TT_Process_Simple_Glyph, load_truetype_glyph)
[TT_CONFIG_OPTION_GX_VAR_SUPPORT] :Support GX var fonts.
* src/truetype/ttobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.h.
(tt_done_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
tt_done_blend.
* src/truetype/ttpload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
ttgxvar.h.
(tt_face_load_cvt) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
tt_face_vary_cvt.
* src/truetype/rules.mk (TT_DRV_SRC): Add ttgxvar.c.
* src/type1/t1driver.c (t1_service_multi_masters): Add T1_Get_MM_Var
and T1_Set_Var_Design.
* src/type1/t1load.c (FT_INT_TO_FIXED, FT_FIXED_TO_INT): New macros.
(T1_Get_MM_Var, T1_Set_Var_Design): New functions.
* src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New
function declarations.
2004-04-25 22:15:11 +02:00
|
|
|
#include "pcfutil.h"
|
Complete redesign of error codes. Please check ftmoderr.h for more
details.
* include/freetype/internal/cfferrs.h,
include/freetype/internal/tterrors.h,
include/freetype/internal/t1errors.h: Removed. Replaced with files
local to the module. All extra error codes have been moved to
`fterrors.h'.
* src/sfnt/ttpost.h: Move error codes to `fterrors.h'.
* src/autohint/aherrors.h, src/cache/ftcerror.h, src/cff/cfferrs.h,
src/cid/ciderrs.h, src/pcf/pcferror.h, src/psaux/psauxerr.h,
src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
src/type1/t1errors.h, src/winfonts/fnterrs.h: New files defining the
error names for the module it belongs to.
* include/freetype/ftmoderr.h: New file, defining the module error
offsets. Its structure is similar to `fterrors.h'.
* include/freetype/fterrors.h (FT_NOERRORDEF): New macro.
(FT_ERRORDEF): Redefined to use module error offsets.
All internal error codes are now public; unused error codes have
been removed, some are new.
* include/freetype/config/ftheader.h (FT_MODULE_ERRORS_H): New
macro.
* include/freetype/config/ftoption.h
(FT_CONFIG_OPTION_USE_MODULE_ERRORS): New macro.
All other source files have been updated to use the new error codes;
some already existing (internal) error codes local to a module have
been renamed to give them the same name as in the base module.
All make files have been updated to include the local error files.
* src/cid/cidtokens.h: Replaced with...
* src/cid/cidtoken.h: This file for 8+3 consistency.
* src/raster/ftraster.c: Use macros for header file names.
2001-06-06 19:30:41 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
#undef FT_COMPONENT
|
|
|
|
#define FT_COMPONENT trace_pcfread
|
|
|
|
|
* 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
|
|
|
#include FT_SERVICE_BDF_H
|
2015-03-11 08:09:13 +01:00
|
|
|
#include FT_SERVICE_FONT_FORMAT_H
|
2002-03-31 08:56:56 +02:00
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
|
2004-06-22 08:24:09 +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. */
|
|
|
|
/* */
|
|
|
|
#undef FT_COMPONENT
|
|
|
|
#define FT_COMPONENT trace_pcfdriver
|
|
|
|
|
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
typedef struct PCF_CMapRec_
|
2002-03-21 16:02:54 +01:00
|
|
|
{
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_CMapRec root;
|
2015-02-22 08:25:16 +01:00
|
|
|
FT_ULong num_encodings;
|
2002-03-21 16:02:54 +01:00
|
|
|
PCF_Encoding encodings;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
} PCF_CMapRec, *PCF_CMap;
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
pcf_cmap_init( FT_CMap pcfcmap, /* PCF_CMap */
|
|
|
|
FT_Pointer init_data )
|
2002-03-21 16:02:54 +01:00
|
|
|
{
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
PCF_CMap cmap = (PCF_CMap)pcfcmap;
|
|
|
|
PCF_Face face = (PCF_Face)FT_CMAP_FACE( pcfcmap );
|
|
|
|
|
|
|
|
FT_UNUSED( init_data );
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
|
2015-02-22 08:25:16 +01:00
|
|
|
cmap->num_encodings = face->nencodings;
|
2002-03-21 16:02:54 +01:00
|
|
|
cmap->encodings = face->encodings;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2013-03-14 11:21:17 +01:00
|
|
|
return FT_Err_Ok;
|
2002-03-21 16:02:54 +01:00
|
|
|
}
|
|
|
|
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
FT_CALLBACK_DEF( void )
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
pcf_cmap_done( FT_CMap pcfcmap ) /* PCF_CMap */
|
2002-03-21 16:02:54 +01:00
|
|
|
{
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
PCF_CMap cmap = (PCF_CMap)pcfcmap;
|
|
|
|
|
|
|
|
|
2002-06-11 00:41:57 +02:00
|
|
|
cmap->encodings = NULL;
|
2002-03-21 16:02:54 +01:00
|
|
|
cmap->num_encodings = 0;
|
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_UInt )
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
pcf_cmap_char_index( FT_CMap pcfcmap, /* PCF_CMap */
|
2002-03-21 16:02:54 +01:00
|
|
|
FT_UInt32 charcode )
|
|
|
|
{
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
PCF_CMap cmap = (PCF_CMap)pcfcmap;
|
2002-03-22 18:09:52 +01:00
|
|
|
PCF_Encoding encodings = cmap->encodings;
|
2015-02-22 08:25:16 +01:00
|
|
|
FT_ULong min, max, mid;
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_UInt result = 0;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
min = 0;
|
|
|
|
max = cmap->num_encodings;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
while ( min < max )
|
|
|
|
{
|
2009-07-31 17:30:22 +02:00
|
|
|
FT_ULong code;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
mid = ( min + max ) >> 1;
|
2015-02-22 08:25:16 +01:00
|
|
|
code = (FT_ULong)encodings[mid].enc;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
if ( charcode == code )
|
|
|
|
{
|
2002-06-16 03:14:16 +02:00
|
|
|
result = encodings[mid].glyph + 1;
|
2002-03-21 16:02:54 +01:00
|
|
|
break;
|
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
if ( charcode < code )
|
|
|
|
max = mid;
|
|
|
|
else
|
2002-03-31 08:56:56 +02:00
|
|
|
min = mid + 1;
|
2002-03-21 16:02:54 +01:00
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
return result;
|
2002-06-11 00:41:57 +02:00
|
|
|
}
|
2002-03-21 16:02:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_UInt )
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
pcf_cmap_char_next( FT_CMap pcfcmap, /* PCF_CMap */
|
2002-03-21 16:02:54 +01:00
|
|
|
FT_UInt32 *acharcode )
|
|
|
|
{
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
PCF_CMap cmap = (PCF_CMap)pcfcmap;
|
2002-03-21 16:02:54 +01:00
|
|
|
PCF_Encoding encodings = cmap->encodings;
|
2015-02-22 08:25:16 +01:00
|
|
|
FT_ULong min, max, mid;
|
2009-07-31 17:30:22 +02:00
|
|
|
FT_ULong charcode = *acharcode + 1;
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_UInt result = 0;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
min = 0;
|
|
|
|
max = cmap->num_encodings;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
while ( min < max )
|
|
|
|
{
|
2009-07-31 17:30:22 +02:00
|
|
|
FT_ULong code;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
mid = ( min + max ) >> 1;
|
2015-02-22 08:25:16 +01:00
|
|
|
code = (FT_ULong)encodings[mid].enc;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
if ( charcode == code )
|
|
|
|
{
|
2002-06-16 03:14:16 +02:00
|
|
|
result = encodings[mid].glyph + 1;
|
2002-03-21 16:02:54 +01:00
|
|
|
goto Exit;
|
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
if ( charcode < code )
|
|
|
|
max = mid;
|
|
|
|
else
|
2002-03-31 08:56:56 +02:00
|
|
|
min = mid + 1;
|
2002-03-21 16:02:54 +01:00
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
charcode = 0;
|
2002-06-11 00:41:57 +02:00
|
|
|
if ( min < cmap->num_encodings )
|
2002-03-21 16:02:54 +01:00
|
|
|
{
|
2015-02-22 08:25:16 +01:00
|
|
|
charcode = (FT_ULong)encodings[min].enc;
|
2002-06-16 03:14:16 +02:00
|
|
|
result = encodings[min].glyph + 1;
|
2002-03-21 16:02:54 +01:00
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
Exit:
|
2009-07-31 17:30:22 +02:00
|
|
|
if ( charcode > 0xFFFFFFFFUL )
|
|
|
|
{
|
|
|
|
FT_TRACE1(( "pcf_cmap_char_next: charcode 0x%x > 32bit API" ));
|
|
|
|
*acharcode = 0;
|
|
|
|
/* XXX: result should be changed to indicate an overflow error */
|
|
|
|
}
|
|
|
|
else
|
|
|
|
*acharcode = (FT_UInt32)charcode;
|
2002-03-21 16:02:54 +01:00
|
|
|
return result;
|
2002-06-11 00:41:57 +02:00
|
|
|
}
|
2002-03-21 16:02:54 +01:00
|
|
|
|
|
|
|
|
2014-03-18 08:39:35 +01:00
|
|
|
static
|
2004-06-22 08:24:09 +02:00
|
|
|
const FT_CMap_ClassRec pcf_cmap_class =
|
2002-03-21 16:02:54 +01:00
|
|
|
{
|
2004-06-22 08:24:09 +02:00
|
|
|
sizeof ( PCF_CMapRec ),
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
pcf_cmap_init,
|
|
|
|
pcf_cmap_done,
|
|
|
|
pcf_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
|
|
|
pcf_cmap_char_next,
|
|
|
|
|
|
|
|
NULL, NULL, NULL, NULL, NULL
|
2002-03-21 16:02:54 +01:00
|
|
|
};
|
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_CALLBACK_DEF( void )
|
|
|
|
PCF_Face_Done( FT_Face pcfface ) /* PCF_Face */
|
2001-06-27 21:46:12 +02:00
|
|
|
{
|
2008-10-02 00:39:05 +02:00
|
|
|
PCF_Face face = (PCF_Face)pcfface;
|
|
|
|
FT_Memory memory;
|
2001-01-01 18:24:31 +01:00
|
|
|
|
|
|
|
|
2008-10-02 00:39:05 +02:00
|
|
|
if ( !face )
|
|
|
|
return;
|
|
|
|
|
|
|
|
memory = FT_FACE_MEMORY( face );
|
|
|
|
|
2002-03-22 14:52:37 +01:00
|
|
|
FT_FREE( face->encodings );
|
|
|
|
FT_FREE( face->metrics );
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2002-02-06 12:22:56 +01:00
|
|
|
/* free properties */
|
2013-08-01 12:20:20 +02:00
|
|
|
if ( face->properties )
|
2001-01-01 18:24:31 +01:00
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
FT_Int i;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
|
2013-08-01 12:20:20 +02:00
|
|
|
for ( i = 0; i < face->nprops; i++ )
|
2002-02-06 12:22:56 +01:00
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
PCF_Property prop = &face->properties[i];
|
|
|
|
|
|
|
|
|
|
|
|
if ( prop )
|
2006-07-08 23:31:24 +02:00
|
|
|
{
|
2013-08-01 12:20:20 +02:00
|
|
|
FT_FREE( prop->name );
|
|
|
|
if ( prop->isString )
|
|
|
|
FT_FREE( prop->value.atom );
|
2006-07-08 23:31:24 +02:00
|
|
|
}
|
2002-02-06 12:22:56 +01:00
|
|
|
}
|
2013-08-01 12:20:20 +02:00
|
|
|
|
2002-03-22 14:52:37 +01:00
|
|
|
FT_FREE( face->properties );
|
2001-01-01 18:24:31 +01:00
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-22 14:52:37 +01:00
|
|
|
FT_FREE( face->toc.tables );
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_FREE( pcfface->family_name );
|
2004-07-28 02:09:02 +02:00
|
|
|
FT_FREE( pcfface->style_name );
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_FREE( pcfface->available_sizes );
|
2002-03-22 14:52:37 +01:00
|
|
|
FT_FREE( face->charset_encoding );
|
|
|
|
FT_FREE( face->charset_registry );
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2010-12-31 16:59:33 +01:00
|
|
|
/* close compressed stream if any */
|
|
|
|
if ( pcfface->stream == &face->comp_stream )
|
2002-10-31 23:19:27 +01:00
|
|
|
{
|
2010-12-31 16:59:33 +01:00
|
|
|
FT_Stream_Close( &face->comp_stream );
|
|
|
|
pcfface->stream = face->comp_source;
|
2002-10-31 23:19:27 +01:00
|
|
|
}
|
2001-01-01 18:24:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
2002-02-06 12:22:56 +01:00
|
|
|
PCF_Face_Init( FT_Stream stream,
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_Face pcfface, /* PCF_Face */
|
2001-06-27 21:46:12 +02:00
|
|
|
FT_Int face_index,
|
|
|
|
FT_Int num_params,
|
|
|
|
FT_Parameter* params )
|
2001-01-01 18:24:31 +01:00
|
|
|
{
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
PCF_Face face = (PCF_Face)pcfface;
|
2013-08-01 12:20:20 +02:00
|
|
|
FT_Error error;
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
FT_UNUSED( num_params );
|
|
|
|
FT_UNUSED( params );
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2001-01-01 18:24:31 +01: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(( "PCF driver\n" ));
|
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
error = pcf_load_font( stream, face );
|
|
|
|
if ( error )
|
2002-10-31 23:19:27 +01:00
|
|
|
{
|
2009-05-28 06:56:26 +02:00
|
|
|
PCF_Face_Done( pcfface );
|
2002-10-31 23:19:27 +01:00
|
|
|
|
2010-12-31 16:59:33 +01:00
|
|
|
#if defined( FT_CONFIG_OPTION_USE_ZLIB ) || \
|
|
|
|
defined( FT_CONFIG_OPTION_USE_LZW ) || \
|
|
|
|
defined( FT_CONFIG_OPTION_USE_BZIP2 )
|
2003-04-23 15:17:40 +02:00
|
|
|
|
2009-05-28 06:56:26 +02:00
|
|
|
#ifdef FT_CONFIG_OPTION_USE_ZLIB
|
|
|
|
{
|
|
|
|
FT_Error error2;
|
2006-07-08 23:31:24 +02:00
|
|
|
|
2002-10-31 23:19:27 +01:00
|
|
|
|
2009-05-28 06:56:26 +02:00
|
|
|
/* this didn't work, try gzip support! */
|
2010-12-31 16:59:33 +01:00
|
|
|
error2 = FT_Stream_OpenGzip( &face->comp_stream, stream );
|
2013-03-14 17:50:49 +01:00
|
|
|
if ( FT_ERR_EQ( error2, Unimplemented_Feature ) )
|
2009-05-28 06:56:26 +02:00
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
error = error2;
|
|
|
|
}
|
|
|
|
#endif /* FT_CONFIG_OPTION_USE_ZLIB */
|
|
|
|
|
2008-04-14 00:06:12 +02:00
|
|
|
#ifdef FT_CONFIG_OPTION_USE_LZW
|
2009-05-28 06:56:26 +02:00
|
|
|
if ( error )
|
2004-03-05 10:26:24 +01:00
|
|
|
{
|
|
|
|
FT_Error error3;
|
2002-10-31 23:19:27 +01:00
|
|
|
|
|
|
|
|
2004-03-05 10:26:24 +01:00
|
|
|
/* this didn't work, try LZW support! */
|
2010-12-31 16:59:33 +01:00
|
|
|
error3 = FT_Stream_OpenLZW( &face->comp_stream, stream );
|
2013-03-14 17:50:49 +01:00
|
|
|
if ( FT_ERR_EQ( error3, Unimplemented_Feature ) )
|
2004-03-05 10:26:24 +01:00
|
|
|
goto Fail;
|
2002-10-31 23:19:27 +01:00
|
|
|
|
2004-03-05 10:26:24 +01:00
|
|
|
error = error3;
|
2009-05-28 06:56:26 +02:00
|
|
|
}
|
|
|
|
#endif /* FT_CONFIG_OPTION_USE_LZW */
|
2004-03-05 10:26:24 +01:00
|
|
|
|
2010-12-31 16:59:33 +01:00
|
|
|
#ifdef FT_CONFIG_OPTION_USE_BZIP2
|
|
|
|
if ( error )
|
|
|
|
{
|
|
|
|
FT_Error error4;
|
|
|
|
|
|
|
|
|
|
|
|
/* this didn't work, try Bzip2 support! */
|
|
|
|
error4 = FT_Stream_OpenBzip2( &face->comp_stream, stream );
|
2013-03-14 17:50:49 +01:00
|
|
|
if ( FT_ERR_EQ( error4, Unimplemented_Feature ) )
|
2010-12-31 16:59:33 +01:00
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
error = error4;
|
|
|
|
}
|
|
|
|
#endif /* FT_CONFIG_OPTION_USE_BZIP2 */
|
|
|
|
|
2009-05-28 06:56:26 +02:00
|
|
|
if ( error )
|
|
|
|
goto Fail;
|
2004-03-05 10:26:24 +01:00
|
|
|
|
2010-12-31 16:59:33 +01:00
|
|
|
face->comp_source = stream;
|
|
|
|
pcfface->stream = &face->comp_stream;
|
2004-03-05 10:26:24 +01:00
|
|
|
|
2009-05-28 06:56:26 +02:00
|
|
|
stream = pcfface->stream;
|
|
|
|
|
|
|
|
error = pcf_load_font( stream, face );
|
|
|
|
if ( error )
|
2008-04-14 00:06:12 +02:00
|
|
|
goto Fail;
|
2004-03-05 10:26:24 +01:00
|
|
|
|
2010-12-31 16:59:33 +01:00
|
|
|
#else /* !(FT_CONFIG_OPTION_USE_ZLIB ||
|
|
|
|
FT_CONFIG_OPTION_USE_LZW ||
|
|
|
|
FT_CONFIG_OPTION_USE_BZIP2) */
|
2004-03-05 10:26:24 +01:00
|
|
|
|
2009-05-28 06:56:26 +02:00
|
|
|
goto Fail;
|
|
|
|
|
|
|
|
#endif
|
2002-10-31 23:19:27 +01:00
|
|
|
}
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2015-08-13 15:22:17 +02:00
|
|
|
/* PCF cannot have multiple faces in a single font file.
|
|
|
|
* XXX: A non-zero face_index is already an invalid argument, but
|
|
|
|
* Type1, Type42 drivers have a convention to return
|
2013-09-25 03:57:17 +02:00
|
|
|
* 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(( "PCF_Face_Init: invalid face index\n" ));
|
|
|
|
PCF_Face_Done( pcfface );
|
|
|
|
return FT_THROW( Invalid_Argument );
|
|
|
|
}
|
|
|
|
|
2004-06-22 08:24:09 +02:00
|
|
|
/* set up charmap */
|
2002-03-21 16:02:54 +01:00
|
|
|
{
|
2004-06-22 08:24:09 +02:00
|
|
|
FT_String *charset_registry = face->charset_registry;
|
|
|
|
FT_String *charset_encoding = face->charset_encoding;
|
2002-03-31 08:56:56 +02:00
|
|
|
FT_Bool unicode_charmap = 0;
|
2002-03-21 16:02:54 +01:00
|
|
|
|
|
|
|
|
2004-06-22 08:24:09 +02:00
|
|
|
if ( charset_registry && charset_encoding )
|
2002-03-21 16:02:54 +01:00
|
|
|
{
|
2004-06-22 08:24:09 +02:00
|
|
|
char* s = charset_registry;
|
2003-05-21 09:39:42 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Uh, oh, compare first letters manually to avoid dependency
|
|
|
|
on locales. */
|
|
|
|
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" ) ) )
|
2002-03-21 16:02:54 +01:00
|
|
|
unicode_charmap = 1;
|
2003-05-21 09:39:42 +02:00
|
|
|
}
|
2002-03-21 16:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
FT_CharMapRec charmap;
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
|
|
|
|
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-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01: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-03-21 16:02:54 +01:00
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
error = FT_CMap_New( &pcf_cmap_class, NULL, &charmap, NULL );
|
2002-06-19 17:57:55 +02:00
|
|
|
|
2002-07-18 00:51:06 +02:00
|
|
|
#if 0
|
2002-06-19 17:57:55 +02:00
|
|
|
/* Select default charmap */
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
if ( pcfface->num_charmaps )
|
|
|
|
pcfface->charmap = pcfface->charmaps[0];
|
2002-07-18 00:51:06 +02:00
|
|
|
#endif
|
2002-03-21 16:02:54 +01:00
|
|
|
}
|
|
|
|
}
|
2002-06-11 00:41:57 +02:00
|
|
|
|
2002-03-21 16:02:54 +01:00
|
|
|
Exit:
|
|
|
|
return error;
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2001-06-27 21:46:12 +02:00
|
|
|
Fail:
|
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 PCF file\n" ));
|
2006-07-08 23:31:24 +02:00
|
|
|
PCF_Face_Done( pcfface );
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Unknown_File_Format ); /* error */
|
2002-03-21 16:02:54 +01:00
|
|
|
goto Exit;
|
2001-01-01 18:24:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +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
|
|
|
PCF_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 )
|
2001-06-27 21:46:12 +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
|
|
|
PCF_Accel accel = &( (PCF_Face)size->face )->accel;
|
2001-01-01 18:24:31 +01: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 = accel->fontAscent * 64;
|
|
|
|
size->metrics.descender = -accel->fontDescent * 64;
|
|
|
|
size->metrics.max_advance = accel->maxbounds.characterWidth * 64;
|
2001-12-10 11:47:47 +01:00
|
|
|
|
2013-03-14 11:21:17 +01:00
|
|
|
return FT_Err_Ok;
|
2001-01-01 18:24:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +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
|
|
|
PCF_Size_Request( FT_Size size,
|
|
|
|
FT_Size_Request req )
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +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
|
|
|
PCF_Face face = (PCF_Face)size->face;
|
|
|
|
FT_Bitmap_Size* bsize = size->face->available_sizes;
|
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;
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
|
2004-07-25 23:18:29 +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 == ( face->accel.fontAscent +
|
|
|
|
face->accel.fontDescent ) )
|
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;
|
2004-07-25 23:18:29 +02:00
|
|
|
else
|
* 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
|
|
|
return PCF_Size_Select( size, 0 );
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FT_CALLBACK_DEF( FT_Error )
|
2002-02-06 12:22:56 +01:00
|
|
|
PCF_Glyph_Load( FT_GlyphSlot slot,
|
2001-06-27 21:46:12 +02:00
|
|
|
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 )
|
2001-06-27 21:46:12 +02:00
|
|
|
{
|
2001-01-01 18:24:31 +01:00
|
|
|
PCF_Face face = (PCF_Face)FT_SIZE_FACE( size );
|
2009-03-12 09:07:49 +01:00
|
|
|
FT_Stream stream;
|
2013-03-14 11:21:17 +01:00
|
|
|
FT_Error error = FT_Err_Ok;
|
2001-01-01 18:24:31 +01:00
|
|
|
FT_Bitmap* bitmap = &slot->bitmap;
|
|
|
|
PCF_Metric metric;
|
2015-02-22 08:25:16 +01:00
|
|
|
FT_ULong bytes;
|
2001-01-01 18:24:31 +01:00
|
|
|
|
|
|
|
FT_UNUSED( load_flags );
|
|
|
|
|
|
|
|
|
2013-08-26 12:55:48 +02:00
|
|
|
FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index ));
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2014-11-25 10:21:13 +01:00
|
|
|
if ( !face )
|
|
|
|
{
|
|
|
|
error = FT_THROW( Invalid_Face_Handle );
|
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( glyph_index >= (FT_UInt)face->root.num_glyphs )
|
2001-01-01 18:24:31 +01:00
|
|
|
{
|
2013-03-14 10:27:35 +01:00
|
|
|
error = FT_THROW( Invalid_Argument );
|
2001-01-01 18:24:31 +01:00
|
|
|
goto Exit;
|
|
|
|
}
|
|
|
|
|
2009-03-12 09:07:49 +01:00
|
|
|
stream = face->root.stream;
|
|
|
|
|
2002-06-16 03:14:16 +02:00
|
|
|
if ( glyph_index > 0 )
|
|
|
|
glyph_index--;
|
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
metric = face->metrics + glyph_index;
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2015-02-22 08:25:16 +01:00
|
|
|
bitmap->rows = (unsigned int)( metric->ascent +
|
|
|
|
metric->descent );
|
|
|
|
bitmap->width = (unsigned int)( metric->rightSideBearing -
|
|
|
|
metric->leftSideBearing );
|
2001-01-01 18:24:31 +01:00
|
|
|
bitmap->num_grays = 1;
|
* 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_MONO;
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
FT_TRACE6(( "BIT_ORDER %d ; BYTE_ORDER %d ; GLYPH_PAD %d\n",
|
|
|
|
PCF_BIT_ORDER( face->bitmapsFormat ),
|
|
|
|
PCF_BYTE_ORDER( face->bitmapsFormat ),
|
|
|
|
PCF_GLYPH_PAD( face->bitmapsFormat ) ));
|
|
|
|
|
|
|
|
switch ( PCF_GLYPH_PAD( face->bitmapsFormat ) )
|
|
|
|
{
|
2001-06-27 21:46:12 +02:00
|
|
|
case 1:
|
2015-02-22 08:25:16 +01:00
|
|
|
bitmap->pitch = (int)( ( bitmap->width + 7 ) >> 3 );
|
2001-01-01 18:24:31 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
2015-02-22 08:25:16 +01:00
|
|
|
bitmap->pitch = (int)( ( ( bitmap->width + 15 ) >> 4 ) << 1 );
|
2001-01-01 18:24:31 +01:00
|
|
|
break;
|
|
|
|
|
2001-06-27 21:46:12 +02:00
|
|
|
case 4:
|
2015-02-22 08:25:16 +01:00
|
|
|
bitmap->pitch = (int)( ( ( bitmap->width + 31 ) >> 5 ) << 2 );
|
2001-01-01 18:24:31 +01:00
|
|
|
break;
|
|
|
|
|
2001-06-27 21:46:12 +02:00
|
|
|
case 8:
|
2015-02-22 08:25:16 +01:00
|
|
|
bitmap->pitch = (int)( ( ( bitmap->width + 63 ) >> 6 ) << 3 );
|
2001-01-01 18:24:31 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2013-03-14 10:27:35 +01:00
|
|
|
return FT_THROW( Invalid_File_Format );
|
2001-01-01 18:24:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX: to do: are there cases that need repadding the bitmap? */
|
2015-02-22 08:25:16 +01:00
|
|
|
bytes = (FT_ULong)bitmap->pitch * bitmap->rows;
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2013-06-06 09:16:38 +02:00
|
|
|
error = ft_glyphslot_alloc_bitmap( slot, (FT_ULong)bytes );
|
2003-03-20 08:04:40 +01:00
|
|
|
if ( error )
|
2001-01-01 18:24:31 +01:00
|
|
|
goto Exit;
|
|
|
|
|
2002-03-31 08:56:56 +02:00
|
|
|
if ( FT_STREAM_SEEK( metric->bits ) ||
|
2002-03-20 11:49:31 +01:00
|
|
|
FT_STREAM_READ( bitmap->buffer, bytes ) )
|
2001-01-01 18:24:31 +01:00
|
|
|
goto Exit;
|
|
|
|
|
|
|
|
if ( PCF_BIT_ORDER( face->bitmapsFormat ) != MSBFirst )
|
2002-08-19 00:02:03 +02:00
|
|
|
BitOrderInvert( bitmap->buffer, bytes );
|
2001-01-01 18:24:31 +01:00
|
|
|
|
2001-06-27 21:46:12 +02:00
|
|
|
if ( ( PCF_BYTE_ORDER( face->bitmapsFormat ) !=
|
2001-01-01 18:24:31 +01:00
|
|
|
PCF_BIT_ORDER( face->bitmapsFormat ) ) )
|
|
|
|
{
|
|
|
|
switch ( PCF_SCAN_UNIT( face->bitmapsFormat ) )
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
TwoByteSwap( bitmap->buffer, bytes );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
FourByteSwap( bitmap->buffer, bytes );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-01-15 07:00:49 +01:00
|
|
|
slot->format = FT_GLYPH_FORMAT_BITMAP;
|
2001-05-08 15:54:36 +02:00
|
|
|
slot->bitmap_left = metric->leftSideBearing;
|
2001-01-01 18:24:31 +01:00
|
|
|
slot->bitmap_top = metric->ascent;
|
|
|
|
|
2015-08-01 07:53:48 +02:00
|
|
|
slot->metrics.horiAdvance = (FT_Pos)( metric->characterWidth * 64 );
|
|
|
|
slot->metrics.horiBearingX = (FT_Pos)( metric->leftSideBearing * 64 );
|
|
|
|
slot->metrics.horiBearingY = (FT_Pos)( metric->ascent * 64 );
|
2015-02-22 08:25:16 +01:00
|
|
|
slot->metrics.width = (FT_Pos)( ( metric->rightSideBearing -
|
2015-08-01 07:53:48 +02:00
|
|
|
metric->leftSideBearing ) * 64 );
|
|
|
|
slot->metrics.height = (FT_Pos)( bitmap->rows * 64 );
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2006-01-15 16:01:45 +01:00
|
|
|
ft_synthesize_vertical_metrics( &slot->metrics,
|
|
|
|
( face->accel.fontAscent +
|
2015-08-01 07:53:48 +02:00
|
|
|
face->accel.fontDescent ) * 64 );
|
2006-01-15 07:24:53 +01:00
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
Exit:
|
2001-06-27 21:46:12 +02:00
|
|
|
return error;
|
2001-01-01 18:24:31 +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
|
|
|
/*
|
|
|
|
*
|
|
|
|
* BDF SERVICE
|
|
|
|
*
|
|
|
|
*/
|
2004-04-21 16:30:37 +02:00
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
static FT_Error
|
|
|
|
pcf_get_bdf_property( PCF_Face face,
|
|
|
|
const char* prop_name,
|
|
|
|
BDF_PropertyRec *aproperty )
|
|
|
|
{
|
2003-04-23 15:17:40 +02:00
|
|
|
PCF_Property prop;
|
|
|
|
|
2003-01-22 23:45:28 +01:00
|
|
|
|
|
|
|
prop = pcf_find_property( face, prop_name );
|
|
|
|
if ( prop != NULL )
|
|
|
|
{
|
|
|
|
if ( prop->isString )
|
|
|
|
{
|
|
|
|
aproperty->type = BDF_PROPERTY_TYPE_ATOM;
|
|
|
|
aproperty->u.atom = prop->value.atom;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-07-31 17:30:23 +02:00
|
|
|
if ( prop->value.l > 0x7FFFFFFFL || prop->value.l < ( -1 - 0x7FFFFFFFL ) )
|
|
|
|
{
|
|
|
|
FT_TRACE1(( "pcf_get_bdf_property: " ));
|
|
|
|
FT_TRACE1(( "too large integer 0x%x is truncated\n" ));
|
|
|
|
}
|
2003-04-25 07:35:04 +02:00
|
|
|
/* Apparently, the PCF driver loads all properties as signed integers!
|
2003-04-23 15:17:40 +02:00
|
|
|
* This really doesn't seem to be a problem, because this is
|
|
|
|
* sufficient for any meaningful values.
|
|
|
|
*/
|
2003-01-22 23:45:28 +01:00
|
|
|
aproperty->type = BDF_PROPERTY_TYPE_INTEGER;
|
2009-07-31 17:30:23 +02:00
|
|
|
aproperty->u.integer = (FT_Int32)prop->value.l;
|
2003-01-22 23:45:28 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2003-04-23 15:17:40 +02:00
|
|
|
|
2013-03-14 10:27:35 +01:00
|
|
|
return FT_THROW( Invalid_Argument );
|
2003-01-22 23:45:28 +01:00
|
|
|
}
|
|
|
|
|
2003-09-17 07:26:33 +02:00
|
|
|
|
2003-12-11 07:55:59 +01:00
|
|
|
static FT_Error
|
|
|
|
pcf_get_charset_id( PCF_Face face,
|
|
|
|
const char* *acharset_encoding,
|
|
|
|
const char* *acharset_registry )
|
|
|
|
{
|
|
|
|
*acharset_encoding = face->charset_encoding;
|
|
|
|
*acharset_registry = face->charset_registry;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-21 16:30:37 +02:00
|
|
|
static const FT_Service_BDFRec pcf_service_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
|
|
|
{
|
2003-12-11 07:55:59 +01:00
|
|
|
(FT_BDF_GetCharsetIdFunc)pcf_get_charset_id,
|
2003-09-17 07:26:33 +02:00
|
|
|
(FT_BDF_GetPropertyFunc) pcf_get_bdf_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
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* SERVICE LIST
|
|
|
|
*
|
|
|
|
*/
|
2003-01-22 23:45:28 +01:00
|
|
|
|
2004-04-21 16:30:37 +02:00
|
|
|
static const FT_ServiceDescRec pcf_services[] =
|
* 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
|
|
|
{
|
2015-03-11 08:09:13 +01:00
|
|
|
{ FT_SERVICE_ID_BDF, &pcf_service_bdf },
|
|
|
|
{ FT_SERVICE_ID_FONT_FORMAT, FT_FONT_FORMAT_PCF },
|
* 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 }
|
|
|
|
};
|
2004-04-21 16:30:37 +02:00
|
|
|
|
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
FT_CALLBACK_DEF( FT_Module_Interface )
|
2003-01-22 23:45:28 +01:00
|
|
|
pcf_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( pcf_services, name );
|
2003-01-22 23:45:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
FT_CALLBACK_TABLE_DEF
|
* include/freetype/internal/ftdriver.h,
include/freetype/internal/ftobjs.h,
src/base/ftapi.c, src/base/ftobjs.c,
src/cff/cffdrivr.c, src/cff/cffdrivr.h,
src/cid/cidriver.c, src/cid/cidriver.h,
src/pcf/pcfdriver.c, src/pcf/pcfdriver.h,
src/truetype/ttdriver.c, src/truetype/ttdriver.h,
src/type1/t1driver.c, src/type1/t1driver.h,
src/winfonts/winfnt.c, src/winfonts/winfnt.h:
updating the type definitions for font font drivers
2002-03-14 10:22:48 +01:00
|
|
|
const FT_Driver_ClassRec pcf_driver_class =
|
2001-01-01 18:24:31 +01:00
|
|
|
{
|
|
|
|
{
|
* include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,
ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
FT_GLYPH_BBIX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* include/freetype/ftmodule.h (ft_module_font_driver,
ft_module_renderer, ft_module_hinter, ft_module_styler,
ft_module_driver_scalable, ft_module_driver_no_outlines,
ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
FT_MODULE_DRIVER_HAS_HINTER.
The lowercase variants are now (deprecated aliases) to the uppercase
versions.
Updated all other files.
* src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
as enumeration.
* src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
(winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
the FT_MODULE_DRIVER_NO_OUTLINES flag.
2003-06-17 12:42:27 +02:00
|
|
|
FT_MODULE_FONT_DRIVER |
|
|
|
|
FT_MODULE_DRIVER_NO_OUTLINES,
|
2001-01-01 18:24:31 +01:00
|
|
|
sizeof ( FT_DriverRec ),
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
"pcf",
|
|
|
|
0x10000L,
|
|
|
|
0x20000L,
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2001-01-01 18:24:31 +01:00
|
|
|
0,
|
2001-06-27 21:46:12 +02:00
|
|
|
|
2011-11-30 13:10:54 +01:00
|
|
|
0, /* FT_Module_Constructor */
|
|
|
|
0, /* FT_Module_Destructor */
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
pcf_driver_requester
|
2001-01-01 18:24:31 +01:00
|
|
|
},
|
2001-06-27 21:46:12 +02:00
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
sizeof ( PCF_FaceRec ),
|
|
|
|
sizeof ( FT_SizeRec ),
|
|
|
|
sizeof ( FT_GlyphSlotRec ),
|
2001-06-27 21:46:12 +02:00
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
PCF_Face_Init,
|
|
|
|
PCF_Face_Done,
|
|
|
|
0, /* FT_Size_InitFunc */
|
|
|
|
0, /* FT_Size_DoneFunc */
|
|
|
|
0, /* FT_Slot_InitFunc */
|
|
|
|
0, /* FT_Slot_DoneFunc */
|
2001-06-27 21:46:12 +02:00
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
PCF_Glyph_Load,
|
2001-01-01 18:24:31 +01:00
|
|
|
|
* 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): Access
root fields directly.
* src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
* src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
frame before calling TT_Vary_Get_Glyph_Deltas.
* src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
consistency.
(pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
are typecast to the proper PCF_XXX types within the function.
Update code accordingly.
(pcf_cmap_class): Remove casts.
(PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
PCF_XXX but FT_XXX arguments which are typecast to the proper
PCF_XXX types within the function.
Update code accordingly.
Use FT_CALLBACK_DEF throughout.
(PCF_Set_Point_Size): New wrapper function.
(PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
(pcf_driver_class): Remove casts.
2004-05-07 09:08:14 +02:00
|
|
|
0, /* FT_Face_GetKerningFunc */
|
|
|
|
0, /* FT_Face_AttachFunc */
|
* 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
|
|
|
0, /* FT_Face_GetAdvancesFunc */
|
|
|
|
|
|
|
|
PCF_Size_Request,
|
|
|
|
PCF_Size_Select
|
2001-01-01 18:24:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|