diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-09-05 21:50:05 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-09-06 15:08:34 +0200 |
commit | 70e97793769baaa8e0fbb8d8d3949655c4aeb654 (patch) | |
tree | b1bee2ca218c34694738dc34c0b90c56f0969b29 /vcl/unx/generic/fontmanager | |
parent | 789b517819495a9efff5538de7e8e5106fc64f81 (diff) |
vcl: Drop now unused SalGraphics::GetGlyphWidths()
Change-Id: Iec8974d6fc67d9d599c5e92aa325225963da0021
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139459
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl/unx/generic/fontmanager')
-rw-r--r-- | vcl/unx/generic/fontmanager/fontmanager.cxx | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 4ede52817180..4ee863a3a401 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -1081,57 +1081,4 @@ bool PrintFontManager::createFontSubset( return bSuccess; } -void PrintFontManager::getGlyphWidths( const vcl::font::PhysicalFontFace* pFace, - bool bVertical, - std::vector< sal_Int32 >& rWidths, - std::map< sal_Unicode, sal_uInt32 >& rUnicodeEnc ) -{ - PrintFont* pFont = getFont( pFace->GetFontId() ); - if (!pFont) - return; - TrueTypeFont* pTTFont = nullptr; - OString aFromFile = getFontFile( *pFont ); - if( OpenTTFontFile( aFromFile.getStr(), pFont->m_nCollectionEntry, &pTTFont ) != SFErrCodes::Ok ) - return; - int nGlyphs = pTTFont->glyphCount(); - if (nGlyphs > 0) - { - rWidths.resize(nGlyphs); - std::vector<sal_uInt16> aGlyphIds(nGlyphs); - for (int i = 0; i < nGlyphs; i++) - aGlyphIds[i] = sal_uInt16(i); - std::unique_ptr<sal_uInt16[]> pMetrics = GetTTSimpleGlyphMetrics(pTTFont, - aGlyphIds.data(), - nGlyphs, - bVertical); - if (pMetrics) - { - for (int i = 0; i< nGlyphs; i++) - rWidths[i] = pMetrics[i]; - pMetrics.reset(); - rUnicodeEnc.clear(); - } - - // fill the unicode map - FontCharMapRef xFontCharMap = pFace->GetFontCharMap(); - for (sal_uInt32 cOld = 0;;) - { - // get next unicode covered by font - const sal_uInt32 c = xFontCharMap->GetNextChar(cOld); - if (c == cOld) - break; - cOld = c; -#if 1 // TODO: remove when sal_Unicode covers all of unicode - if (c > sal_Unicode(~0)) - break; -#endif - // get the matching glyph index - const sal_GlyphId aGlyphId = xFontCharMap->GetGlyphIndex(c); - // update the requested map - rUnicodeEnc[static_cast<sal_Unicode>(c)] = aGlyphId; - } - } - CloseTTFont(pTTFont); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |