Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

LEFontInstance.h

Go to the documentation of this file.
00001 
00002 /*
00003  * @(#)LEFontInstance.h 1.3 00/03/15
00004  *
00005  * (C) Copyright IBM Corp. 1998, 1999, 2000, 2001, 2002 - All Rights Reserved
00006  *
00007  */
00008 
00009 #ifndef __LEFONTINSTANCE_H
00010 #define __LEFONTINSTANCE_H
00011 
00012 #include "LETypes.h"
00013 
00014 U_NAMESPACE_BEGIN
00015 
00025 class LECharMapper /* not : public UObject because this is an interface/mixin class */ {
00026 public:
00031     virtual inline ~LECharMapper() {};
00032 
00042     virtual LEUnicode32 mapChar(LEUnicode32 ch) const = 0;
00043 };
00044 
00057 class LEFontInstance /* not : public UObject because this is an interface/mixin class */ {
00058 public:
00059 
00066     virtual inline ~LEFontInstance() {};
00067 
00068     //
00069     // Font file access
00070     //
00071 
00081     virtual const void *getFontTable(LETag tableTag) const = 0;
00082 
00095     virtual le_bool canDisplay(LEUnicode32 ch) const = 0;
00096 
00105     virtual le_int32 getUnitsPerEM() const = 0;
00106 
00122     virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, LEGlyphID glyphs[]) const = 0;
00123 
00137     virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const = 0;
00138 
00152     virtual le_int32 getName(le_uint16 platformID, le_uint16 scriptID, le_uint16 languageID, le_uint16 nameID, LEUnicode *name) const = 0;
00153 
00154     //
00155     // Metrics
00156     //
00157 
00166     virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const = 0;
00167 
00180     virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const = 0;
00181 
00190     virtual float getXPixelsPerEm() const = 0;
00191 
00200     virtual float getYPixelsPerEm() const = 0;
00201 
00212     virtual float xUnitsToPoints(float xUnits) const = 0;
00213 
00224     virtual float yUnitsToPoints(float yUunits) const = 0;
00225 
00234     virtual void unitsToPoints(LEPoint &units, LEPoint &points) const = 0;
00235 
00246     virtual float xPixelsToUnits(float xPixels) const = 0;
00247 
00258     virtual float yPixelsToUnits(float yPixels) const = 0;
00259 
00268     virtual void pixelsToUnits(LEPoint &pixels, LEPoint &units) const = 0;
00269 
00280     virtual void transformFunits(float xFunits, float yFunits, LEPoint &pixels) const = 0;
00281 
00292     static float fixedToFloat(le_int32 fixed)
00293     {
00294         return (float) (fixed / 65536.0);
00295     };
00296 
00307     static le_int32 floatToFixed(float theFloat)
00308     {
00309         return (le_int32) (theFloat * 65536.0);
00310     };
00311 };
00312 
00313 U_NAMESPACE_END
00314 #endif
00315 
00316 

Generated on Wed Dec 18 16:49:37 2002 for ICU 2.4 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001