3 *******************************************************************************
5 * Copyright (C) 1999-2003, International Business Machines
6 * Corporation and others. All Rights Reserved.
8 *******************************************************************************
9 * file name: PortableFontInstance.h
11 * created on: 11/12/1999
12 * created by: Eric R. Mader
15 #ifndef __PORTABLEFONTINSTANCE_H
16 #define __PORTABLEFONTINSTANCE_H
20 #include "layout/LETypes.h"
21 #include "layout/LEFontInstance.h"
23 #include "FontTableCache.h"
28 class PortableFontInstance
: public LEFontInstance
, protected FontTableCache
39 const SFNTDirectory
*fDirectory
;
46 CMAPMapper
*fCMAPMapper
;
48 const HMTXTable
*fHMTXTable
;
50 le_uint16 fNumLongHorMetrics
;
52 static le_int8
highBit(le_int32 value
);
54 const DirectoryEntry
*findTable(LETag tag
) const;
55 const void *readTable(LETag tag
, le_uint32
*length
) const;
56 void deleteTable(const void *table
) const;
59 CMAPMapper
*findUnicodeMapper();
62 const void *readFontTable(LETag tableTag
) const;
65 PortableFontInstance(char *fileName
, float pointSize
, LEErrorCode
&status
);
67 virtual ~PortableFontInstance();
69 virtual const void *getFontTable(LETag tableTag
) const;
71 virtual le_int32
getUnitsPerEM() const
76 virtual le_int32
getAscent() const
81 virtual le_int32
getDescent() const
86 virtual le_int32
getLeading() const
91 virtual LEGlyphID
mapCharToGlyph(LEUnicode32 ch
) const
93 return fCMAPMapper
->unicodeToGlyph(ch
);
96 virtual void getGlyphAdvance(LEGlyphID glyph
, LEPoint
&advance
) const;
98 virtual le_bool
getGlyphPoint(LEGlyphID glyph
, le_int32 pointNumber
, LEPoint
&point
) const;
100 float getXPixelsPerEm() const
105 float getYPixelsPerEm() const
110 float getScaleFactorX() const
115 float getScaleFactorY() const