Changeset 10959

Show
Ignore:
Timestamp:
01/14/10 16:15:42 (4 years ago)
Author:
robert
Message:

Added setting of the charcode during construction of osgText::Font::Glyph()

Location:
OpenSceneGraph/trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgText/Font

    r10699 r10959  
    279279    public: 
    280280 
    281         Glyph(); 
    282  
    283         unsigned int getGlyphCode() const; 
     281        Glyph(unsigned int glyphCode); 
     282 
     283        unsigned int getGlyphCode() const { return _glyphCode; } 
    284284 
    285285        void setHorizontalBearing(const osg::Vec2& bearing); 
  • OpenSceneGraph/trunk/src/osgPlugins/freetype/FreeTypeFont.cpp

    r7874 r10959  
    136136    unsigned int height = sourceHeight; 
    137137 
    138     osg::ref_ptr<osgText::Font::Glyph> glyph = new osgText::Font::Glyph; 
     138    osg::ref_ptr<osgText::Font::Glyph> glyph = new osgText::Font::Glyph(charcode); 
    139139     
    140140    unsigned int dataSize = width*height; 
  • OpenSceneGraph/trunk/src/osgPlugins/txf/TXFFont.cpp

    r7743 r10959  
    231231 
    232232        // add the characters ... 
    233         osgText::Font::Glyph* glyph = new osgText::Font::Glyph; 
     233        osgText::Font::Glyph* glyph = new osgText::Font::Glyph(glyphs[i].ch); 
    234234 
    235235        unsigned sourceWidth = glyphs[i].width; 
     
    272272 
    273273    // insert a trivial blank character 
    274     osgText::Font::Glyph* glyph = new osgText::Font::Glyph; 
     274    osgText::Font::Glyph* glyph = new osgText::Font::Glyph(' '); 
    275275 
    276276    unsigned width = 1; 
  • OpenSceneGraph/trunk/src/osgText/DefaultFont.cpp

    r7747 r10959  
    206206    for(unsigned int i=32;i<127;i++) 
    207207    { 
    208         osg::ref_ptr<Glyph> glyph = new Glyph; 
     208        osg::ref_ptr<Glyph> glyph = new Glyph(i); 
    209209         
    210210        unsigned int dataSize = sourceWidth*sourceHeight; 
  • OpenSceneGraph/trunk/src/osgText/Font.cpp

    r10703 r10959  
    805805 
    806806// all the methods in Font::Glyph have been made non inline because VisualStudio6.0 is STUPID, STUPID, STUPID PILE OF JUNK. 
    807 Font::Glyph::Glyph(): 
     807Font::Glyph::Glyph(unsigned int glyphCode): 
    808808    _font(0), 
    809     _glyphCode(0), 
     809    _glyphCode(glyphCode), 
    810810    _horizontalBearing(0.0f,0.f), 
    811811    _horizontalAdvance(0.f), 
     
    825825} 
    826826 
    827 unsigned int Font::Glyph::getGlyphCode() const { return _glyphCode; } 
    828  
    829 // void Font::Glyph::setFont(Font* font) { _font = font; } 
    830 // Font* Font::Glyph::getFont() const { return _font; } 
    831  
    832827void Font::Glyph::setHorizontalBearing(const osg::Vec2& bearing) {  _horizontalBearing=bearing; } 
    833828const osg::Vec2& Font::Glyph::getHorizontalBearing() const { return _horizontalBearing; } 
  • OpenSceneGraph/trunk/src/osgWrappers/osgText/Font.cpp

    r10767 r10959  
    281281        I_DeclaringFile("osgText/Font"); 
    282282        I_BaseType(osg::Image); 
    283         I_Constructor0(____Glyph, 
     283        I_Constructor1(IN, unsigned int, glyphCode, 
     284                       Properties::NON_EXPLICIT, 
     285                       ____Glyph__unsigned_int, 
    284286                       "", 
    285287                       "");