10 #ifndef ossimFreeTypeFont_HEADER 11 #define ossimFreeTypeFont_HEADER 15 #if OSSIM_HAS_FREETYPE 17 # include <ft2build.h> 18 # include FT_FREETYPE_H 20 # include FT_MODULE_H // for FT_Done_Library 26 typedef struct TGlyph_
38 ossimFreeTypeFont(
const ossimFreeTypeFont& rhs);
42 return new ossimFreeTypeFont(*
this);
47 return theOutputBuffer;
50 void layoutGlyphs(vector<TGlyph>& glyphs,
56 long getNumberOfFaces()
const 60 return theFontFace->num_faces;
64 void setCurrentFace(
long index);
73 return (theFontFace->num_fixed_sizes > 0);
87 virtual void enableKerningSupport()
89 theKerningEnabledFlag =
true;
90 theBoundingRectIsValid =
false;
96 virtual void disableKerningSupport()
98 theKerningEnabledFlag =
false;
99 theBoundingRectIsValid =
false;
103 double verticalShear)
107 theBoundingRectIsValid =
false;
109 virtual void setScale(
double horizontal,
114 theBoundingRectIsValid =
false;
118 int verticalPixelSize)
122 theBoundingRectIsValid =
false;
127 theBoundingRectIsValid =
false;
131 int verticalDeviceUnits)
134 verticalDeviceUnits);
135 theBoundingRectIsValid =
false;
140 theBoundingRectIsValid =
false;
141 theNeedToLayoutGlyphsFlag =
true;
144 const FT_Face getFontFace()
const 149 virtual ~ossimFreeTypeFont();
152 FT_Library theLibrary;
159 bool theKerningEnabledFlag;
160 bool theNeedToLayoutGlyphsFlag;
161 FT_Vector theStringCenter;
166 vector<TGlyph> theStringLayout;
173 mutable ossimIrect thePrecomputedBoundingRect;
179 mutable bool theBoundingRectIsValid;
182 void setBaseClassInformation();
183 void setupForRasterization();
184 void allocateBuffer();
186 void drawBitmap(FT_Bitmap* bitmap,
190 void computeGlyphBox(FT_Glyph,
192 void deleteGlyphs(vector<TGlyph>& glyphs);
virtual const ossim_uint8 * rasterize()=0
virtual bool isFixed() const =0
virtual void getBoundingBox(ossimIrect &box)=0
virtual ossimObject * dup() const =0
virtual void setHorizontalVerticalShear(double horizontalShear, double verticalShear)
virtual void setDeviceDpi(int horizontalDeviceUnits, int verticalDeviceUnits)
virtual void setString(const ossimString &s)
virtual void setScale(double horizontal, double vertical)
virtual void getFixedSizes(vector< ossimIpt > &sizes) const =0
virtual void setPixelSize(int horizontalPixelSize, int verticalPixelSize)
virtual const ossim_uint8 * getBuf() const =0
unsigned char ossim_uint8