home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: SysTools
/
SysTools.zip
/
ft-beta.zip
/
freetype
/
lib
/
ttcmap.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-10-06
|
4KB
|
143 lines
/*******************************************************************
*
* ttcmap.h 1.0
*
* TrueType Character Mappings
*
* Copyright 1996, 1997 by
* 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.
*
*
******************************************************************/
#ifndef TTCMAP_H
#define TTCMAP_H
#include "ttcommon.h"
#include "tttypes.h"
/* format 0 */
typedef struct _TCMap0
{
PByte glyphIdArray;
} TCMap0;
typedef TCMap0* PCMap0;
/* format 2 */
typedef struct _TCMap2SubHeader
{
UShort firstCode; /* first valid low byte */
UShort entryCount; /* number of valid low bytes */
Short idDelta; /* delta value to glyphIndex */
UShort idRangeOffset; /* offset from here to 1st code */
} TCMap2SubHeader;
typedef TCMap2SubHeader* PCMap2SubHeader;
typedef struct _TCMap2
{
PUShort subHeaderKeys;
/* high byte mapping table */
/* value = subHeader index * 8 */
PCMap2SubHeader subHeaders;
PUShort glyphIdArray;
} TCMap2;
typedef TCMap2* PCMap2;
/* format 4 */
typedef struct _TCMap4Segment
{
UShort endCount;
UShort startCount;
Short idDelta; /* in the specs defined as UShort but the
example there gives negative values... */
UShort idRangeOffset;
} TCMap4Segment;
typedef TCMap4Segment* PCMap4Segment;
typedef struct _TCMap4
{
UShort segCountX2; /* segments number * 2 */
UShort searchRange; /* these parameters can be used */
UShort entrySelector; /* for a binary search */
UShort rangeShift;
PCMap4Segment segments;
PUShort glyphIdArray;
} TCMap4;
typedef TCMap4* PCMap4;
/* format 6 */
typedef struct _TCMap6
{
UShort firstCode; /* first character code of subrange */
UShort entryCount; /* number of character codes in subrange */
PUShort glyphIdArray;
} TCMap6;
typedef TCMap6* PCMap6;
/* charmap table */
struct _TCMapTable
{
UShort platformID;
UShort platformEncodingID;
UShort format;
UShort length;
UShort version;
Bool loaded;
Long offset;
union
{
TCMap0 cmap0;
TCMap2 cmap2;
TCMap4 cmap4;
TCMap6 cmap6;
} c;
};
typedef struct _TCMapTable TCMapTable;
typedef TCMapTable* PCMapTable;
/* Load character mappings directory when face is loaded */
/* the mappings themselves are only loaded on demand */
TT_Error CharMap_Load( PCMapTable table, TT_Stream input );
/* Destroy one character mapping table */
TT_Error CharMap_Free( PCMapTable table );
/* Use character mapping table to perform mapping */
Int CharMap_Index( PCMapTable cmap,
UShort charcode );
/* NOTE : The PFace type isn't defined at this point */
#endif /* TTCMAP_H */