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:
00036     virtual LEUnicode32 mapChar(LEUnicode32 ch) const = 0;
00037 };
00038 
00051 class LEFontInstance /* not : public UObject because this is an interface/mixin class */ {
00052 public:
00053 
00060     virtual ~LEFontInstance() { };
00061 
00062     //
00063     // Font file access
00064     //
00065 
00075     virtual const void *getFontTable(LETag tableTag) const = 0;
00076 
00089     virtual le_bool canDisplay(LEUnicode32 ch) const = 0;
00090 
00099     virtual le_int32 getUnitsPerEM() const = 0;
00100 
00116     virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, const LECharMapper *mapper, LEGlyphID glyphs[]) const = 0;
00117 
00131     virtual LEGlyphID mapCharToGlyph(LEUnicode32 ch, const LECharMapper *mapper) const = 0;
00132 
00146     virtual le_int32 getName(le_uint16 platformID, le_uint16 scriptID, le_uint16 languageID, le_uint16 nameID, LEUnicode *name) const = 0;
00147 
00148     //
00149     // Metrics
00150     //
00151 
00160     virtual void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const = 0;
00161 
00174     virtual le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const = 0;
00175 
00184     virtual float getXPixelsPerEm() const = 0;
00185 
00194     virtual float getYPixelsPerEm() const = 0;
00195 
00206     virtual float xUnitsToPoints(float xUnits) const = 0;
00207 
00218     virtual float yUnitsToPoints(float yUunits) const = 0;
00219 
00228     virtual void unitsToPoints(LEPoint &units, LEPoint &points) const = 0;
00229 
00240     virtual float xPixelsToUnits(float xPixels) const = 0;
00241 
00252     virtual float yPixelsToUnits(float yPixels) const = 0;
00253 
00262     virtual void pixelsToUnits(LEPoint &pixels, LEPoint &units) const = 0;
00263 
00274     virtual void transformFunits(float xFunits, float yFunits, LEPoint &pixels) const = 0;
00275 
00286     static float fixedToFloat(le_int32 fixed)
00287     {
00288         return (float) (fixed / 65536.0);
00289     };
00290 
00299     static le_int32 floatToFixed(float theFloat)
00300     {
00301         return (le_int32) (theFloat * 65536.0);
00302     };
00303 };
00304 
00305 U_NAMESPACE_END
00306 #endif
00307 
00308 

Generated on Thu Aug 15 14:13:25 2002 for ICU 2.2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001