2018-06-03 09:01:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* ttcmap.h
|
|
|
|
*
|
|
|
|
* TrueType character mapping table (cmap) support (specification).
|
|
|
|
*
|
2021-01-17 07:18:48 +01:00
|
|
|
* Copyright (C) 2002-2021 by
|
2018-06-03 09:01:17 +02:00
|
|
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
|
|
*
|
|
|
|
* This file is part of the FreeType project, and may only be used,
|
|
|
|
* modified, and distributed under the terms of the FreeType project
|
|
|
|
* license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
|
|
* this file you indicate that you have read the license and
|
|
|
|
* understand and accept it fully.
|
|
|
|
*
|
|
|
|
*/
|
2002-02-22 19:28:11 +01:00
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef TTCMAP_H_
|
|
|
|
#define TTCMAP_H_
|
2002-02-22 19:28:11 +01:00
|
|
|
|
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/internal/tttypes.h>
|
|
|
|
#include <freetype/internal/ftvalid.h>
|
|
|
|
#include <freetype/internal/services/svttcmap.h>
|
2002-02-22 19:28:11 +01:00
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
2005-11-29 12:32:53 +01:00
|
|
|
|
2005-11-30 19:47:49 +01:00
|
|
|
#define TT_CMAP_FLAG_UNSORTED 1
|
|
|
|
#define TT_CMAP_FLAG_OVERLAPPING 2
|
2005-11-29 12:32:53 +01:00
|
|
|
|
2002-03-31 20:48:24 +02:00
|
|
|
typedef struct TT_CMapRec_
|
2002-03-01 03:26:22 +01:00
|
|
|
{
|
|
|
|
FT_CMapRec cmap;
|
2002-03-31 20:48:24 +02:00
|
|
|
FT_Byte* data; /* pointer to in-memory cmap table */
|
2005-11-29 12:32:53 +01:00
|
|
|
FT_Int flags; /* for format 4 only */
|
2002-03-01 03:26:22 +01:00
|
|
|
|
|
|
|
} TT_CMapRec, *TT_CMap;
|
|
|
|
|
2002-03-31 20:48:24 +02:00
|
|
|
typedef const struct TT_CMap_ClassRec_* TT_CMap_Class;
|
2002-03-01 03:26:22 +01:00
|
|
|
|
|
|
|
|
2002-03-31 20:48:24 +02:00
|
|
|
typedef FT_Error
|
|
|
|
(*TT_CMap_ValidateFunc)( FT_Byte* data,
|
|
|
|
FT_Validator valid );
|
|
|
|
|
|
|
|
typedef struct TT_CMap_ClassRec_
|
2002-03-01 03:26:22 +01:00
|
|
|
{
|
|
|
|
FT_CMap_ClassRec clazz;
|
|
|
|
FT_UInt format;
|
|
|
|
TT_CMap_ValidateFunc validate;
|
2003-12-17 15:28:22 +01:00
|
|
|
TT_CMap_Info_GetFunc get_cmap_info;
|
2002-03-01 03:26:22 +01:00
|
|
|
|
|
|
|
} TT_CMap_ClassRec;
|
|
|
|
|
2012-08-27 05:48:23 +02:00
|
|
|
|
|
|
|
#define FT_DEFINE_TT_CMAP( class_, \
|
|
|
|
size_, \
|
|
|
|
init_, \
|
|
|
|
done_, \
|
|
|
|
char_index_, \
|
|
|
|
char_next_, \
|
|
|
|
char_var_index_, \
|
|
|
|
char_var_default_, \
|
|
|
|
variant_list_, \
|
|
|
|
charvariant_list_, \
|
|
|
|
variantchar_list_, \
|
|
|
|
format_, \
|
|
|
|
validate_, \
|
|
|
|
get_cmap_info_ ) \
|
|
|
|
FT_CALLBACK_TABLE_DEF \
|
|
|
|
const TT_CMap_ClassRec class_ = \
|
|
|
|
{ \
|
|
|
|
{ size_, \
|
|
|
|
init_, \
|
|
|
|
done_, \
|
|
|
|
char_index_, \
|
|
|
|
char_next_, \
|
|
|
|
char_var_index_, \
|
|
|
|
char_var_default_, \
|
|
|
|
variant_list_, \
|
|
|
|
charvariant_list_, \
|
|
|
|
variantchar_list_ \
|
|
|
|
}, \
|
|
|
|
\
|
|
|
|
format_, \
|
|
|
|
validate_, \
|
|
|
|
get_cmap_info_ \
|
Position Independent Code (PIC) support in sfnt driver.
* include/freetype/internal/services/svbdf.h add macros to init
instances of FT_Service_BDFRec.
* include/freetype/internal/services/svgldict.h add macros to init
instances of FT_Service_GlyphDictRec.
* include/freetype/internal/services/svpostnm.h add macros to init
instances of FT_Service_PsFontNameRec.
* include/freetype/internal/services/svsfnt.h add macros to init
instances of FT_Service_SFNT_TableRec.
* include/freetype/internal/services/svttcmap.h add macros to init
instances of FT_Service_TTCMapsRec.
* include/freetype/internal/sfnt.h add macros to init
instances of SFNT_Interface.
* src/sfnt/sfdriver.h declare sfnt_module_class using macros from
ftmodapi.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
functions will be declared.
* src/sfnt/sfdriver.c when FT_CONFIG_OPTION_PIC is defined
the following structs:
sfnt_service_sfnt_table, sfnt_service_glyph_dict, sfnt_service_ps_name
tt_service_get_cmap_info, sfnt_service_bdf, sfnt_interface,
sfnt_module_class, and sfnt_services array
will have functions to init or create and destroy them
instead of being allocated in the global scope.
And macros will be used from sfntpic.h in order to access them
from the pic_container.
* src/sfnt/ttcmap.h add macros to init
instances of TT_CMap_ClassRec.
* src/sfnt/ttcmap.c when FT_CONFIG_OPTION_PIC is defined
the following structs:
tt_cmap0_class_rec, tt_cmap2_class_rec, tt_cmap4_class_rec
tt_cmap6_class_rec, tt_cmap8_class_rec, tt_cmap10_class_rec,
tt_cmap12_class_rec, tt_cmap14_class_rec and tt_cmap_classes array
will have functions to init or create and destroy them
instead of being allocated in the global scope.
And macros will be used from sfntpic.h in order to access them
from the pic_container.
The content of tt_cmap_classes is now described in the
new file 'ttcmapc.h'.
New Files:
* src/sfnt/sfntpic.h declare struct to hold PIC globals for sfnt
driver and macros to access them.
* src/sfnt/sfntpic.c implement functions to allocate, destroy and
initialize PIC globals for sfnt driver.
* src/sfnt/ttcmapc.h describing the content of
tt_cmap_classes allocated in ttcmap.c
* src/sfnt/sfnt.c add new file to build: sfntpic.c.
* src/sfnt/jamfile add new files to FT2_MULTI build: sfntpic.c.
2009-04-05 17:08:32 +02:00
|
|
|
};
|
|
|
|
|
2012-08-27 05:48:23 +02:00
|
|
|
|
2020-07-07 16:58:14 +02:00
|
|
|
#undef TTCMAPCITEM
|
|
|
|
#define TTCMAPCITEM( a ) FT_CALLBACK_TABLE const TT_CMap_ClassRec a;
|
|
|
|
#include "ttcmapc.h"
|
|
|
|
|
|
|
|
|
2002-03-31 20:48:24 +02:00
|
|
|
typedef struct TT_ValidatorRec_
|
2002-03-22 16:02:38 +01:00
|
|
|
{
|
2002-03-22 18:09:52 +01:00
|
|
|
FT_ValidatorRec validator;
|
|
|
|
FT_UInt num_glyphs;
|
* include/freetype/config/ftoption.h, include/freetype/internal/tttypes.h,
src/base/ftobjs.c, src/bdf/bdfdrivr.c, src/cff/cffobjs.c,
src/pcf/pcfdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
src/type42/t42objs.c, src/winfonts/winfnt.c: code cleanup,
FT_CONFIG_OPTION_USE_CMAPS is now the default
2002-07-17 23:52:20 +02:00
|
|
|
|
2002-03-22 16:02:38 +01:00
|
|
|
} TT_ValidatorRec, *TT_Validator;
|
|
|
|
|
2002-03-31 20:48:24 +02:00
|
|
|
|
2012-08-27 05:48:23 +02:00
|
|
|
#define TT_VALIDATOR( x ) ( (TT_Validator)( x ) )
|
2002-03-31 20:48:24 +02:00
|
|
|
#define TT_VALID_GLYPH_COUNT( x ) TT_VALIDATOR( x )->num_glyphs
|
2002-03-22 16:02:38 +01:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
|
* Version 2.8.1 released.
=========================
Tag sources with `VER-2-8-1'.
* docs/VERSION.TXT: Add entry for version 2.8.1.
* docs/CHANGES: Updated.
* README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
builds/windows/vc2005/index.html,
builds/windows/vc2008/freetype.vcproj,
builds/windows/vc2008/index.html,
builds/windows/vc2010/freetype.vcxproj,
builds/windows/vc2010/index.html,
builds/windows/visualc/freetype.dsp,
builds/windows/visualc/freetype.vcproj,
builds/windows/visualc/index.html,
builds/windows/visualce/freetype.dsp,
builds/windows/visualce/freetype.vcproj,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.8/2.8.1/, s/28/281/.
* include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
* builds/unix/configure.raw (version_info): Set to 21:0:15.
* CMakeLists.txt (VERSION_PATCH): Set to 1.
2017-09-16 19:08:17 +02:00
|
|
|
FT_CALLBACK_TABLE const TT_CMap_ClassRec tt_cmap_unicode_class_rec;
|
2017-06-22 04:52:37 +02:00
|
|
|
|
2002-03-01 03:26:22 +01:00
|
|
|
FT_LOCAL( FT_Error )
|
* 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
|
|
|
tt_face_build_cmaps( TT_Face face );
|
2002-02-22 19:28:11 +01:00
|
|
|
|
2003-12-17 15:28:22 +01:00
|
|
|
/* used in tt-cmaps service */
|
|
|
|
FT_LOCAL( FT_Error )
|
|
|
|
tt_get_cmap_info( FT_CharMap charmap,
|
|
|
|
TT_CMapInfo *cmap_info );
|
|
|
|
|
2002-02-22 19:28:11 +01:00
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* TTCMAP_H_ */
|
2002-02-22 19:28:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|