Ticket #106: font.patch
| File font.patch, 4.7 kB (added by odole, 1 year ago) |
|---|
-
BAL/ChangeLog
old new 1 2008-01-07 Olivier Dole <odole@sand-labs.org> 2 3 Reviewed by NOBODY (OOPS!). 4 Tiny improvement in fonts. 5 Remove some potential leaks. 6 7 * Implementations/Fonts/Embedded/FontPlatformDataEmbedded.cpp: 8 (BAL::BTFontPlatformData::operator==): 9 Add another check for embedded fonts 10 * Implementations/Fonts/FreeType/BCFontPlatformDataPrivateFreeType.cpp: 11 (BAL::BCFontPlatformDataPrivateFreeType::~BCFontPlatformDataPrivateFreeType): 12 De-initialize fontconfig with FcFini() 13 (BAL::BCFontPlatformDataPrivateFreeType::configureFontconfig): 14 Move FcConfigDestroy() => remove a possible leak 15 * Implementations/Fonts/FreeType/FontDataFreeType.cpp: 16 (BAL::BTFontData::platformInit): 17 Use space glyph to compute m_spaceWidth 18 (BAL::BTFontData::platformDestroy): 19 Use FcPatternDestroy() when necessary 20 (BAL::BTFontData::smallCapsFontData): 21 * Implementations/Fonts/FreeType/FontPlatformDataFreeType.cpp: 22 (BAL::BTFontPlatformData::operator==): 23 Coding style 24 1 25 2008-01-04 Olivier Dole <odole@sand-labs.org> 2 26 3 27 Reviewed by Sebastien Roret. -
BAL/Implementations/Fonts/Embedded/FontPlatformDataEmbedded.cpp
old new 61 61 { 62 62 if (!d && !other.d) 63 63 return true; 64 if (!d || !other.d) 65 return false; 64 66 return (d->isEqual(other.d)); 65 67 } 66 68 -
BAL/Implementations/Fonts/FreeType/BCFontPlatformDataPrivateFreeType.cpp
old new 64 64 m_isInitialized--; 65 65 DBGML(MODULE_FONTS, LEVEL_INFO, "BCFontPlatformDataPrivateFreeType::~BCFontPlatformDataPrivateFreeType(): m_isInitialized=%d\n", m_isInitialized); 66 66 if (!m_isInitialized && m_library) { 67 FcFini(); 67 68 FT_Done_FreeType(m_library); 68 69 m_library = 0; 69 70 } … … 146 147 if (!m_pattern) 147 148 goto freePattern; 148 149 149 FcConfigDestroy(config);150 151 150 freePattern: 152 151 FcPatternDestroy(pattern); 152 FcConfigDestroy(config); 153 153 } 154 154 155 155 void BCFontPlatformDataPrivateFreeType::configureFreetype(const FontDescription& fontDescription) -
BAL/Implementations/Fonts/FreeType/FontDataFreeType.cpp
old new 56 56 57 57 FT_Load_Char(face, 'x', FT_LOAD_DEFAULT); 58 58 m_xHeight = DOUBLE_FROM_26_6(face->glyph->metrics.height); 59 FT_Load_Char(face, ' ', FT_LOAD_DEFAULT); 59 60 m_spaceWidth = DOUBLE_FROM_26_6(face->glyph->metrics.horiAdvance); 60 61 m_lineGap = m_lineSpacing - m_ascent + m_descent; 61 62 } … … 68 69 69 70 void BTFontData::platformDestroy() 70 71 { 72 FcPattern *pattern = static_cast<BCFontPlatformDataPrivateFreeType *> (m_font.impl())->fcPattern(); 73 if (pattern && (FcPattern*)-1 != pattern) 74 FcPatternDestroy(pattern); 71 75 if (m_smallCapsFontData) 72 76 delete m_smallCapsFontData; 73 77 m_smallCapsFontData = NULL; … … 79 83 FontDescription desc = FontDescription(fontDescription); 80 84 desc.setSpecifiedSize(0.70f*fontDescription.computedSize()); 81 85 const FontPlatformData* pdata = new FontPlatformData(desc, desc.family().family()); 82 m_smallCapsFontData = new FontData(*pdata );86 m_smallCapsFontData = new FontData(*pdata, true, false); 83 87 } 84 88 return m_smallCapsFontData; 85 89 } -
BAL/Implementations/Fonts/FreeType/FontPlatformDataFreeType.cpp
old new 63 63 if (!d && !other.d) 64 64 return true; 65 65 if (!d || !other.d) 66 return false;66 return false; 67 67 return (d->isEqual(other.d)); 68 68 } 69 69
