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