- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/freetype/FreeTypeLibrary.cpp
r12577 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; 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 */ … … 25 25 FreeTypeLibrary::FreeTypeLibrary() 26 26 { 27 OSG_INFO << "FreeTypeLibrary::FreeTypeLibrary()" << std::endl; 27 OSG_INFO << "FreeTypeLibrary::FreeTypeLibrary()" << std::endl; 28 28 FT_Error error = FT_Init_FreeType( &_ftlibrary ); 29 29 if (error) … … 49 49 else fontImplementation->_facade = 0; 50 50 } 51 51 52 52 FT_Done_FreeType( _ftlibrary); 53 53 } … … 76 76 return false; 77 77 } 78 78 79 79 #ifdef PRINT_OUT_FONT_DETAILS 80 80 … … 85 85 FT_SfntName names; 86 86 FT_Error error = FT_Get_Sfnt_Name(face, i, &names); 87 87 88 88 std::string name((char*)names.string, (char*)names.string + names.string_len); 89 89 90 90 OSG_NOTICE<<"names "<<name<<std::endl; 91 91 } … … 98 98 // 99 99 verifyCharacterMap(face); 100 100 101 101 return true; 102 102 } … … 146 146 // 147 147 verifyCharacterMap(face); 148 148 149 149 return buffer; 150 150 } … … 157 157 158 158 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(getMutex()); 159 159 160 160 FreeTypeFont* fontImp = new FreeTypeFont(fontfile,face,flags); 161 161 osgText::Font* font = new osgText::Font(fontImp); 162 162 163 163 _fontImplementationSet.insert(fontImp); 164 164 165 165 return font; 166 166 } … … 171 171 if (face == 0) return (0); 172 172 173 173 174 174 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(getMutex()); 175 175 176 176 FreeTypeFont* fontImp = new FreeTypeFont(buffer,face,flags); 177 177 osgText::Font* font = new osgText::Font(fontImp); 178 178 179 179 _fontImplementationSet.insert(fontImp); 180 180 … … 185 185 { 186 186 // 187 // GT: Verify the correct character mapping for MS windows 187 // GT: Verify the correct character mapping for MS windows 188 188 // as symbol fonts were being returned incorrectly 189 189 // … … 191 191 if (face->charmap == NULL) 192 192 { 193 for (int n = 0; n < face->num_charmaps; n++) 194 { 195 charmap = face->charmaps[n]; 196 if (charmap->platform_id == TT_PLATFORM_MICROSOFT) 197 { 193 for (int n = 0; n < face->num_charmaps; n++) 194 { 195 charmap = face->charmaps[n]; 196 if (charmap->platform_id == TT_PLATFORM_MICROSOFT) 197 { 198 198 FT_Set_Charmap(face, charmap); 199 break; 200 } 199 break; 200 } 201 201 } 202 202 }
