Changeset 13041 for OpenSceneGraph/trunk/src/osgText/DefaultFont.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgText/DefaultFont.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgText/DefaultFont.cpp
r12949 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY{ … … 11 11 12 12 without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 14 * OpenSceneGraph Public License for more details. 15 15 */ … … 62 62 63 63 // new find the glyph for the required charcode. 64 GlyphMap& glyphmap = itr->second; 64 GlyphMap& glyphmap = itr->second; 65 65 GlyphMap::iterator gitr = glyphmap.find(charcode); 66 66 67 67 if (gitr!=glyphmap.end()) return gitr->second.get(); 68 68 else return 0; … … 181 181 {0x00, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x00, 0x00} 182 182 }; 183 183 184 184 unsigned int sourceWidth = 8; 185 185 unsigned int sourceHeight = 12; 186 186 187 187 FontResolution fontRes(sourceWidth,sourceHeight); 188 188 … … 191 191 { 192 192 osg::ref_ptr<Glyph> glyph = new Glyph(this, i); 193 193 194 194 unsigned int dataSize = sourceWidth*sourceHeight; 195 195 unsigned char* data = new unsigned char[dataSize]; … … 197 197 // clear the image to zeros. 198 198 for(unsigned char* p=data;p<data+dataSize;) { *p++ = 0; } 199 199 200 200 glyph->setImage(sourceWidth,sourceHeight,1, 201 201 GL_ALPHA, … … 217 217 (*data++)=((*ptr)&64)?value_on:value_off; 218 218 (*data++)=((*ptr)&32)?value_on:value_off; 219 (*data++)=((*ptr)&16)?value_on:value_off; 219 (*data++)=((*ptr)&16)?value_on:value_off; 220 220 (*data++)=((*ptr)&8)?value_on:value_off; 221 221 (*data++)=((*ptr)&4)?value_on:value_off;
