32#ifdef OSG_PROVIDE_READFILE
81 virtual const char*
className()
const {
return "Font"; }
88 typedef std::vector< osg::ref_ptr<osg::StateSet> >
StateSets;
108 virtual bool getVerticalSize(
float& ascender,
float& descender)
const {
return _implementation ? _implementation->getVerticalSize(ascender, descender) :
false; }
168 typedef std::map< unsigned int, osg::ref_ptr<Glyph> >
GlyphMap;
169 typedef std::map< unsigned int, osg::ref_ptr<Glyph3D> >
Glyph3DMap;
207 osg::Referenced(true),
228 _facade->addGlyph(fontRes, charcode, glyph);
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
void addGlyph(const FontResolution &fontRes, unsigned int charcode, Glyph *glyph)
Definition Font:226
virtual bool getVerticalSize(float &, float &) const
Definition Font:233
Font * _facade
Definition Font:231
virtual bool hasVertical() const =0
virtual osg::Vec2 getKerning(const FontResolution &fontRes, unsigned int leftcharcode, unsigned int rightcharcode, KerningType kerningType)=0
virtual Glyph * getGlyph(const FontResolution &fontRes, unsigned int charcode)=0
virtual bool supportsMultipleFontResolutions() const =0
virtual std::string getFileName() const =0
virtual Glyph3D * getGlyph3D(const FontResolution &fontRes, unsigned int charcode)=0
FontImplementation()
Definition Font:206
osg::Texture::FilterMode getMinFilterHint() const
void setMinFilterHint(osg::Texture::FilterMode mode)
void setImplementation(FontImplementation *implementation)
osg::ref_ptr< FontImplementation > _implementation
Definition Font:196
virtual void resizeGLObjectBuffers(unsigned int maxSize)
virtual bool hasVertical() const
GlyphTextureList _glyphTextureList
Definition Font:178
FontResolution _fontSize
Definition Font:184
FontSizeGlyphMap _sizeGlyphMap
Definition Font:177
void assignGlyphToGlyphTexture(Glyph *glyph, ShaderTechnique shaderTechnique)
osg::Texture::FilterMode getMagFilterHint() const
StateSets & getCachedStateSets()
Definition Font:89
virtual bool isSameKindAs(const osg::Object *obj) const
Definition Font:80
std::map< FontResolution, Glyph3DMap > FontSizeGlyph3DMap
Definition Font:172
virtual osg::Object * clone(const osg::CopyOp &) const
Definition Font:79
std::map< FontResolution, GlyphMap > FontSizeGlyphMap
Definition Font:171
void setNumberCurveSamples(unsigned int numSamples)
Definition Font:132
unsigned int _textureHeightHint
Definition Font:187
GlyphTextureList & getGlyphTextureList()
Definition Font:158
const FontImplementation * getImplementation() const
virtual void releaseGLObjects(osg::State *state=0) const
std::map< unsigned int, osg::ref_ptr< Glyph3D > > Glyph3DMap
Definition Font:169
virtual osg::Vec2 getKerning(const FontResolution &fontRes, unsigned int leftcharcode, unsigned int rightcharcode, KerningType kerningType)
unsigned int _textureWidthHint
Definition Font:186
void setMagFilterHint(osg::Texture::FilterMode mode)
virtual std::string getFileName() const
FontSizeGlyph3DMap _sizeGlyph3DMap
Definition Font:181
std::vector< osg::ref_ptr< osg::StateSet > > StateSets
Definition Font:88
StateSets _statesets
Definition Font:176
virtual Glyph * getGlyph(const FontResolution &fontSize, unsigned int charcode)
osg::Texture::FilterMode _magFilterHint
Definition Font:189
float getMaxAnisotropy() const
Definition Font:128
osg::Texture::FilterMode _minFilterHint
Definition Font:188
unsigned int getTextureHeightHint() const
unsigned int _depth
Definition Font:192
unsigned int getFontDepth() const
Definition Font:130
unsigned int _numCurveSamples
Definition Font:193
virtual void setThreadSafeRefUnref(bool threadSafe)
float _maxAnisotropy
Definition Font:190
std::vector< osg::ref_ptr< GlyphTexture > > GlyphTextureList
Definition Font:157
FontImplementation * getImplementation()
std::map< unsigned int, osg::ref_ptr< Glyph > > GlyphMap
Definition Font:168
const StateSets & getCachedStateSets() const
Definition Font:90
Font(FontImplementation *implementation=0)
virtual osg::Object * cloneType() const
Definition Font:78
void setMaxAnisotropy(float anis)
Definition Font:127
virtual Glyph3D * getGlyph3D(const FontResolution &fontSize, unsigned int charcode)
unsigned int getTextureWidthHint() const
unsigned int getNumberCurveSamples() const
Definition Font:133
OpenThreads::Mutex FontMutex
Definition Font:155
virtual const char * libraryName() const
Definition Font:82
void addGlyph(const FontResolution &fontRes, unsigned int charcode, Glyph *glyph)
OpenThreads::Mutex _glyphMapMutex
Definition Font:174
virtual bool getVerticalSize(float &ascender, float &descender) const
Definition Font:108
static osg::ref_ptr< Font > getDefaultFont()
void setTextureSizeHint(unsigned int width, unsigned int height)
virtual const char * className() const
Definition Font:81
FilterMode
Definition Texture:499
std::pair< unsigned int, unsigned int > FontResolution
Definition KerningType:20
OSGTEXT_EXPORT osg::ref_ptr< Font > readRefFontFile(const std::string &filename, const osgDB::Options *userOptions=0)
KerningType
Definition KerningType:23
OSGTEXT_EXPORT std::string findFontFile(const std::string &str)
OSGTEXT_EXPORT osg::ref_ptr< Font > readRefFontStream(std::istream &stream, const osgDB::Options *userOptions=0)
ShaderTechnique
Definition Glyph:42
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19
#define OSGTEXT_EXPORT
Definition osgText/Export:39
#define NULL
Definition osg/Export:55