Changeset 13041 for OpenSceneGraph/trunk/src/osgQt/QFontImplementation.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgQt/QFontImplementation.cpp
r12407 r13041 1 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 2009-2010 Mathias Froehlich 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; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 45 45 unsigned int fontSize = fontRes.second; 46 46 _font.setPixelSize(fontSize); 47 47 48 48 float coord_scale = 1.0f/float(fontSize); 49 49 … … 88 88 } 89 89 } 90 90 91 91 // the glyph texture in osg 92 92 glyph->setImage(imageWidth, imageHeight, 1, … … 97 97 1); 98 98 glyph->setInternalTextureFormat(GL_ALPHA); 99 99 100 100 glyph->setWidth((float)imageWidth * coord_scale); 101 101 glyph->setHeight((float)imageHeight * coord_scale); … … 115 115 glyph->setVerticalBearing(topMiddle * coord_scale); 116 116 glyph->setVerticalAdvance((rectF.height() + fontMetricsF.overlinePos() - fontMetricsF.xHeight()) * coord_scale); 117 117 118 118 // ... ready 119 119 //addGlyph(fontRes, charcode, glyph.get()); 120 120 121 121 return glyph.release(); 122 122 }
