2001-10-03 21:48:10 +00:00
|
|
|
/*
|
|
|
|
* %W% %E%
|
|
|
|
*
|
|
|
|
* (C) Copyright IBM Corp. 1998 - All Rights Reserved
|
|
|
|
*
|
|
|
|
* Portions Copyright 1998 by Sun Microsystems, Inc.,
|
|
|
|
* 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This software is the confidential and proprietary information
|
|
|
|
* of Sun Microsystems, Inc. ("Confidential Information"). You
|
|
|
|
* shall not disclose such Confidential Information and shall use
|
|
|
|
* it only in accordance with the terms of the license agreement
|
|
|
|
* you entered into with Sun.
|
|
|
|
*
|
|
|
|
* The original version of this source code and documentation is
|
|
|
|
* copyrighted and owned by IBM. These materials are provided
|
|
|
|
* under terms of a License Agreement between IBM and Sun.
|
|
|
|
* This technology is protected by multiple US and International
|
|
|
|
* patents. This notice and attribution to IBM may not be removed.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SFNT_H
|
|
|
|
#define __SFNT_H
|
|
|
|
|
|
|
|
#include "LETypes.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ANY_NUMBER
|
|
|
|
#define ANY_NUMBER 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct DirectoryEntry
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 tag;
|
|
|
|
le_uint32 checksum;
|
|
|
|
le_uint32 offset;
|
|
|
|
le_uint32 length;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct SFNTDirectory
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 scalerType;
|
|
|
|
le_uint16 numTables;
|
|
|
|
le_uint16 searchRange;
|
|
|
|
le_uint16 entrySelector;
|
|
|
|
le_uint16 rangeShift;
|
|
|
|
DirectoryEntry tableDirectory[ANY_NUMBER];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct CMAPEncodingSubtableHeader
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint16 platformID;
|
|
|
|
le_uint16 platformSpecificID;
|
|
|
|
le_uint32 encodingOffset;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPTable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint16 version;
|
|
|
|
le_uint16 numberSubtables;
|
|
|
|
CMAPEncodingSubtableHeader encodingSubtableHeaders[ANY_NUMBER];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPEncodingSubtable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint16 format;
|
|
|
|
le_uint16 length;
|
|
|
|
le_uint16 language;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat0Encoding : CMAPEncodingSubtable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint8 glyphIndexArray[256];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat2Subheader
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint16 firstCode;
|
|
|
|
le_uint16 entryCount;
|
|
|
|
le_int16 idDelta;
|
|
|
|
le_uint16 idRangeOffset;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat2Encoding : CMAPEncodingSubtable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint16 subHeadKeys[256];
|
|
|
|
CMAPFormat2Subheader subheaders[ANY_NUMBER];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat4Encoding : CMAPEncodingSubtable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
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];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat6Encoding : CMAPEncodingSubtable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint16 firstCode;
|
|
|
|
le_uint16 entryCount;
|
|
|
|
le_uint16 glyphIndexArray[ANY_NUMBER];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPEncodingSubtable32
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 format;
|
|
|
|
le_uint32 length;
|
|
|
|
le_uint32 language;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPGroup
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 startCharCode;
|
|
|
|
le_uint32 endCharCode;
|
|
|
|
le_uint32 startGlyphCode;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat8Encoding : CMAPEncodingSubtable32
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 is32[65536/32];
|
|
|
|
le_uint32 nGroups;
|
|
|
|
CMAPGroup groups[ANY_NUMBER];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat10Encoding : CMAPEncodingSubtable32
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 startCharCode;
|
|
|
|
le_uint32 numCharCodes;
|
|
|
|
le_uint16 glyphs[ANY_NUMBER];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CMAPFormat12Encoding : CMAPEncodingSubtable32
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 nGroups;
|
|
|
|
CMAPGroup groups[ANY_NUMBER];
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef le_int32 fixed;
|
|
|
|
|
|
|
|
struct BigDate
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint32 bc;
|
|
|
|
le_uint32 ad;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct HEADTable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
fixed version;
|
|
|
|
fixed fontRevision;
|
|
|
|
le_uint32 checksumAdjustment;
|
|
|
|
le_uint32 magicNumber;
|
|
|
|
le_uint16 flags;
|
|
|
|
le_uint16 unitsPerEm;
|
|
|
|
BigDate created;
|
|
|
|
BigDate modified;
|
|
|
|
le_int16 xMin;
|
|
|
|
le_int16 yMin;
|
|
|
|
le_int16 xMax;
|
|
|
|
le_int16 yMax;
|
|
|
|
le_int16 lowestRecPPEM;
|
|
|
|
le_int16 fontDirectionHint;
|
|
|
|
le_int16 indexToLocFormat;
|
|
|
|
le_int16 glyphDataFormat;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MAXPTable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
fixed version;
|
|
|
|
le_uint16 numGlyphs;
|
|
|
|
le_uint16 maxPoints;
|
|
|
|
le_uint16 maxContours;
|
|
|
|
le_uint16 maxComponentPoints;
|
|
|
|
le_uint16 maxComponentContours;
|
|
|
|
le_uint16 maxZones;
|
|
|
|
le_uint16 maxTwilightPoints;
|
|
|
|
le_uint16 maxStorage;
|
|
|
|
le_uint16 maxFunctionDefs;
|
|
|
|
le_uint16 maxInstructionDefs;
|
|
|
|
le_uint16 maxStackElements;
|
|
|
|
le_uint16 maxSizeOfInstructions;
|
|
|
|
le_uint16 maxComponentElements;
|
|
|
|
le_uint16 maxComponentDepth;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct HHEATable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
fixed version;
|
|
|
|
le_int16 ascent;
|
|
|
|
le_int16 descent;
|
|
|
|
le_int16 lineGap;
|
|
|
|
le_uint16 advanceWidthMax;
|
|
|
|
le_int16 minLeftSideBearing;
|
|
|
|
le_int16 minRightSideBearing;
|
|
|
|
le_int16 xMaxExtent;
|
|
|
|
le_int16 caretSlopeRise;
|
|
|
|
le_int16 caretSlopeRun;
|
|
|
|
le_int16 caretOffset;
|
|
|
|
le_int16 reserved1;
|
|
|
|
le_int16 reserved2;
|
|
|
|
le_int16 reserved3;
|
|
|
|
le_int16 reserved4;
|
|
|
|
le_int16 metricDataFormat;
|
|
|
|
le_uint16 numOfLongHorMetrics;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct LongHorMetric
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
le_uint16 advanceWidth;
|
|
|
|
le_int16 leftSideBearing;
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct HMTXTable
|
|
|
|
{
|
2002-04-02 02:55:31 +00:00
|
|
|
LongHorMetric hMetrics[ANY_NUMBER]; // ANY_NUMBER = numOfLongHorMetrics from hhea table
|
|
|
|
// le_int16 leftSideBearing[ANY_NUMBER]; // ANY_NUMBER = numGlyphs - numOfLongHorMetrics
|
2001-10-03 21:48:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|