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