1/* 2 ******************************************************************************* 3 * 4 * Copyright (C) 1999-2013, International Business Machines 5 * Corporation and others. All Rights Reserved. 6 * 7 ******************************************************************************* 8 * file name: SimpleFontInstance.h 9 * 10 * created on: 03/30/2006 11 * created by: Eric R. Mader 12 */ 13 14#ifndef __SIMPLEFONTINSTANCE_H 15#define __SIMPLEFONTINSTANCE_H 16 17#include "layout/LETypes.h" 18#include "layout/LEFontInstance.h" 19 20U_NAMESPACE_USE 21 22class SimpleFontInstance : public LEFontInstance 23{ 24private: 25 float fPointSize; 26 le_int32 fAscent; 27 le_int32 fDescent; 28 29protected: 30 const void *readFontTable(LETag tableTag) const; 31 32public: 33 SimpleFontInstance(float pointSize, LEErrorCode &status); 34 35 virtual ~SimpleFontInstance(); 36 37 virtual const void *getFontTable(LETag tableTag) const; 38 39 virtual le_int32 getUnitsPerEM() const; 40 41 virtual le_int32 getAscent() const; 42 43 virtual le_int32 getDescent() const; 44 45 virtual le_int32 getLeading() const; 46 47 // We really want to inherit this method from the superclass, but some compilers 48 // issue a warning if we don't implement it... 49 virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper, le_bool filterZeroWidth) const; 50 51 // We really want to inherit this method from the superclass, but some compilers 52 // issue a warning if we don't implement it... 53 virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const; 54 55 virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch) const; 56 57 virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const; 58 59 virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const; 60 61 float getXPixelsPerEm() const; 62 63 float getYPixelsPerEm() const; 64 65 float getScaleFactorX() const; 66 67 float getScaleFactorY() const; 68 69}; 70 71#endif 72