]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/letest/sfnt.h
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / test / letest / sfnt.h
index 27fe92b91b0cc56afe23e9d92783ea79357905a9..f39d64a9c7bbe2e632356b580a325ea0297e722f 100644 (file)
@@ -1,6 +1,6 @@
 /***************************************************************************
 *
-*   Copyright (C) 1998-2005, International Business Machines
+*   Copyright (C) 1998-2013, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ************************************************************************/
@@ -8,8 +8,9 @@
 #ifndef __SFNT_H
 #define __SFNT_H
 
-#include "LETypes.h"
+#include "layout/LETypes.h"
 
+U_NAMESPACE_USE
 
 #ifndef ANY_NUMBER
 #define ANY_NUMBER 1
@@ -23,6 +24,10 @@ struct DirectoryEntry
     le_uint32   length;
 };
 
+#ifndef __cplusplus
+typedef struct DirectoryEntry DirectoryEntry;
+#endif
+
 struct SFNTDirectory
 {
     le_uint32       scalerType;
@@ -33,6 +38,10 @@ struct SFNTDirectory
     DirectoryEntry  tableDirectory[ANY_NUMBER];
 };
 
+#ifndef __cplusplus
+typedef struct SFNTDirectory SFNTDirectory;
+#endif
+
 
 struct CMAPEncodingSubtableHeader
 {
@@ -41,6 +50,10 @@ struct CMAPEncodingSubtableHeader
     le_uint32   encodingOffset;
 };
 
+#ifndef __cplusplus
+typedef struct CMAPEncodingSubtableHeader CMAPEncodingSubtableHeader;
+#endif
+
 struct CMAPTable
 {
     le_uint16   version;
@@ -48,6 +61,10 @@ struct CMAPTable
     CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
 };
 
+#ifndef __cplusplus
+typedef struct CMAPTable CMAPTable;
+#endif
+
 struct CMAPEncodingSubtable
 {
     le_uint16   format;
@@ -55,10 +72,25 @@ struct CMAPEncodingSubtable
     le_uint16   language;
 };
 
+#ifndef __cplusplus
+typedef struct CMAPEncodingSubtable CMAPEncodingSubtable;
+#endif
+
+#ifdef __cplusplus
 struct CMAPFormat0Encoding : CMAPEncodingSubtable
 {
     le_uint8    glyphIndexArray[256];
 };
+#else
+struct CMAPFormat0Encoding
+{
+       CMAPEncodingSubtable base;
+
+       le_uint8 glyphIndexArray[256];
+};
+
+typedef struct CMAPFormat0Encoding CMAPFormat0Encoding;
+#endif
 
 struct CMAPFormat2Subheader
 {
@@ -68,12 +100,29 @@ struct CMAPFormat2Subheader
     le_uint16   idRangeOffset;
 };
 
+#ifndef __cplusplus
+typedef struct CMAPFormat2Subheader CMAPFormat2Subheader;
+#endif
+
+#ifdef __cplusplus
 struct CMAPFormat2Encoding : CMAPEncodingSubtable
 {
     le_uint16  subHeadKeys[256];
     CMAPFormat2Subheader subheaders[ANY_NUMBER];
 };
+#else
+struct CMAPFormat2Encoding
+{
+       CMAPEncodingSubtable base;
+
+    le_uint16  subHeadKeys[256];
+    CMAPFormat2Subheader subheaders[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat2Encoding CMAPFormat2Encoding;
+#endif
 
+#ifdef __cplusplus
 struct CMAPFormat4Encoding : CMAPEncodingSubtable
 {
     le_uint16   segCountX2;
@@ -81,19 +130,55 @@ struct CMAPFormat4Encoding : CMAPEncodingSubtable
     le_uint16   entrySelector;
     le_uint16   rangeShift;
     le_uint16   endCodes[ANY_NUMBER];
+/*
+    le_uint16   reservedPad;
+    le_uint16   startCodes[ANY_NUMBER];
+    le_uint16   idDelta[ANY_NUMBER];
+    le_uint16   idRangeOffset[ANY_NUMBER];
+    le_uint16   glyphIndexArray[ANY_NUMBER];
+*/
+};
+#else
+struct CMAPFormat4Encoding
+{
+       CMAPEncodingSubtable base;
+
+    le_uint16   segCountX2;
+    le_uint16   searchRange;
+    le_uint16   entrySelector;
+    le_uint16   rangeShift;
+    le_uint16   endCodes[ANY_NUMBER];
+/*
 //  le_uint16   reservedPad;
 //  le_uint16   startCodes[ANY_NUMBER];
 //  le_uint16   idDelta[ANY_NUMBER];
 //  le_uint16   idRangeOffset[ANY_NUMBER];
 //  le_uint16   glyphIndexArray[ANY_NUMBER];
+*/
 };
 
+typedef struct CMAPFormat4Encoding CMAPFormat4Encoding;
+#endif
+
+#ifdef __cplusplus
 struct CMAPFormat6Encoding : CMAPEncodingSubtable
 {
     le_uint16   firstCode;
     le_uint16   entryCount;
     le_uint16   glyphIndexArray[ANY_NUMBER];
 };
+#else
+struct CMAPFormat6Encoding
+{
+       CMAPEncodingSubtable base;
+
+    le_uint16   firstCode;
+    le_uint16   entryCount;
+    le_uint16   glyphIndexArray[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat6Encoding CMAPFormat6Encoding;
+#endif
 
 struct CMAPEncodingSubtable32
 {
@@ -102,6 +187,10 @@ struct CMAPEncodingSubtable32
     le_uint32   language;
 };
 
+#ifndef __cplusplus
+typedef struct CMAPEncodingSubtable32 CMAPEncodingSubtable32;
+#endif
+
 struct CMAPGroup
 {
     le_uint32   startCharCode;
@@ -109,25 +198,67 @@ struct CMAPGroup
     le_uint32   startGlyphCode;
 };
 
+#ifndef __cplusplus
+typedef struct CMAPGroup CMAPGroup;
+#endif
+
+#ifdef __cplusplus
 struct CMAPFormat8Encoding : CMAPEncodingSubtable32
 {
     le_uint32   is32[65536/32];
     le_uint32   nGroups;
     CMAPGroup   groups[ANY_NUMBER];
 };
+#else
+struct CMAPFormat8Encoding
+{
+       CMAPEncodingSubtable32 base;
+
+    le_uint32   is32[65536/32];
+    le_uint32   nGroups;
+    CMAPGroup   groups[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat8Encoding CMAPFormat8Encoding;
+#endif
 
+#ifdef __cplusplus
 struct CMAPFormat10Encoding : CMAPEncodingSubtable32
 {
     le_uint32   startCharCode;
     le_uint32   numCharCodes;
     le_uint16   glyphs[ANY_NUMBER];
 };
+#else
+struct CMAPFormat10Encoding
+{
+       CMAPEncodingSubtable32 base;
 
+    le_uint32   startCharCode;
+    le_uint32   numCharCodes;
+    le_uint16   glyphs[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat10Encoding CMAPFormat10Encoding;
+#endif
+
+#ifdef __cplusplus
 struct CMAPFormat12Encoding : CMAPEncodingSubtable32
 {
     le_uint32   nGroups;
     CMAPGroup   groups[ANY_NUMBER];
 };
+#else
+struct CMAPFormat12Encoding
+{
+       CMAPEncodingSubtable32 base;
+
+    le_uint32   nGroups;
+    CMAPGroup   groups[ANY_NUMBER];
+};
+
+typedef struct CMAPFormat12Encoding CMAPFormat12Encoding;
+#endif
 
 typedef le_int32 fixed;
 
@@ -137,6 +268,10 @@ struct BigDate
     le_uint32   ad;
 };
 
+#ifndef __cplusplus
+typedef struct BigDate BigDate;
+#endif
+
 struct HEADTable
 {
     fixed       version;
@@ -157,6 +292,10 @@ struct HEADTable
     le_int16    glyphDataFormat;
 };
 
+#ifndef __cplusplus
+typedef struct HEADTable HEADTable;
+#endif
+
 struct MAXPTable
 {
     fixed       version;
@@ -176,6 +315,10 @@ struct MAXPTable
     le_uint16   maxComponentDepth;
 };
 
+#ifndef __cplusplus
+typedef struct MAXPTable MAXPTable;
+#endif
+
 struct HHEATable
 {
     fixed       version;
@@ -197,18 +340,30 @@ struct HHEATable
     le_uint16   numOfLongHorMetrics;
 };
 
+#ifndef __cplusplus
+typedef struct HHEATable HHEATable;
+#endif
+
 struct LongHorMetric
 {
     le_uint16   advanceWidth;
     le_int16    leftSideBearing;
 };
 
+#ifndef __cplusplus
+typedef struct LongHorMetric LongHorMetric;
+#endif
+
 struct HMTXTable
 {
-    LongHorMetric hMetrics[ANY_NUMBER];        // ANY_NUMBER = numOfLongHorMetrics from hhea table
-//  le_int16        leftSideBearing[ANY_NUMBER]; // ANY_NUMBER = numGlyphs - numOfLongHorMetrics
+    LongHorMetric hMetrics[ANY_NUMBER];       /* ANY_NUMBER = numOfLongHorMetrics from hhea table */
+/* le_int16        leftSideBearing[ANY_NUMBER];  ANY_NUMBER = numGlyphs - numOfLongHorMetrics     */
 };
 
+#ifndef __cplusplus
+typedef struct HMTXTable HMTXTable;
+#endif
+
 enum PlatformID
 {
     PLATFORM_UNICODE = 0,
@@ -228,6 +383,17 @@ enum MacintoshLanguageID
     MACINTOSH_ENGLISH = 0
 };
 
+enum MicrosoftEncodingID
+{
+    MICROSOFT_UNICODE_BMP  =  1,
+    MICROSOFT_UNICODE_FULL = 10
+};
+
+enum MicrosoftLanguageID
+{
+    MICROSOFT_ENGLISH = 0x409
+};
+
 enum NameID
 {
     NAME_COPYRIGHT_NOTICE     = 0,
@@ -263,6 +429,10 @@ struct NameRecord
     le_uint16 offset;
 };
 
+#ifndef __cplusplus
+typedef struct NameRecord NameRecord;
+#endif
+
 struct NAMETable
 {
     le_uint16 version;
@@ -271,5 +441,9 @@ struct NAMETable
     NameRecord nameRecords[ANY_NUMBER];
 };
 
+#ifndef __cplusplus
+typedef struct NAMETable NAMETable;
+#endif
+
 #endif