diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-16 00:09:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-16 00:09:26 +0000 |
commit | 6c0eafbb1395d426a72a74538e0b2a95e8344ca6 (patch) | |
tree | 2a5f80b80fc76086a2602b812c2a182d00f961b7 /Build/source/libs/libttf/ttcmap.h | |
parent | 70f7efeb5c9965a63a4143ad1c1f473585dc364c (diff) |
libs 1
git-svn-id: svn://tug.org/texlive/trunk@1483 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/libttf/ttcmap.h')
-rw-r--r-- | Build/source/libs/libttf/ttcmap.h | 169 |
1 files changed, 169 insertions, 0 deletions
diff --git a/Build/source/libs/libttf/ttcmap.h b/Build/source/libs/libttf/ttcmap.h new file mode 100644 index 00000000000..f6be5f108e4 --- /dev/null +++ b/Build/source/libs/libttf/ttcmap.h @@ -0,0 +1,169 @@ +/******************************************************************* + * + * ttcmap.h 1.0 + * + * TrueType Character Mappings + * + * Copyright 1996-1999 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 "ttconfig.h" +#include "tttypes.h" + + +#ifdef __cplusplus + extern "C" { +#endif + + /* format 0 */ + + struct TCMap0_ + { + PByte glyphIdArray; + }; + + typedef struct TCMap0_ TCMap0; + typedef TCMap0* PCMap0; + + + /* format 2 */ + + 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 */ + }; + + typedef struct TCMap2SubHeader_ TCMap2SubHeader; + typedef TCMap2SubHeader* PCMap2SubHeader; + + struct TCMap2_ + { + PUShort subHeaderKeys; + /* high byte mapping table */ + /* value = subHeader index * 8 */ + + PCMap2SubHeader subHeaders; + PUShort glyphIdArray; + UShort numGlyphId; /* control value */ + }; + + typedef struct TCMap2_ TCMap2; + typedef TCMap2* PCMap2; + + + /* format 4 */ + + struct TCMap4Segment_ + { + UShort endCount; + UShort startCount; + Short idDelta; /* in the specs defined as UShort but the + example there gives negative values... */ + UShort idRangeOffset; + }; + + typedef struct TCMap4Segment_ TCMap4Segment; + typedef TCMap4Segment* PCMap4Segment; + + struct TCMap4_ + { + UShort segCountX2; /* number of segments * 2 */ + UShort searchRange; /* these parameters can be used */ + UShort entrySelector; /* for a binary search */ + UShort rangeShift; + + PCMap4Segment segments; + PUShort glyphIdArray; + UShort numGlyphId; /* control value */ + }; + + typedef struct TCMap4_ TCMap4; + typedef TCMap4* PCMap4; + + + /* format 6 */ + + struct TCMap6_ + { + UShort firstCode; /* first character code of subrange */ + UShort entryCount; /* number of character codes in subrange */ + + PUShort glyphIdArray; + }; + + typedef struct TCMap6_ TCMap6; + typedef TCMap6* PCMap6; + + + /* charmap table */ + + struct TCMapTable_ + { + UShort platformID; + UShort platformEncodingID; + UShort format; + UShort length; + UShort version; + + Bool loaded; + ULong 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. */ + + LOCAL_DEF + TT_Error CharMap_Load( PCMapTable table, + TT_Stream input ); + + + /* Destroy one character mapping table */ + + LOCAL_DEF + TT_Error CharMap_Free( PCMapTable table ); + + + /* Use character mapping table to perform mapping */ + + LOCAL_DEF + UShort CharMap_Index( PCMapTable cmap, + ULong charCode ); + + /* NOTE: The PFace type isn't defined at this point */ + +#ifdef __cplusplus + } +#endif + +#endif /* TTCMAP_H */ + + +/* END */ |