diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-08-14 04:05:56 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-08-15 13:18:05 +0200 |
commit | 4c05d61a4393d38834254f03a83aa01b7582060b (patch) | |
tree | 59e2d51d9ba1e9abc346e6d3f35c851617048077 /vcl/unx/generic/fontmanager | |
parent | 71c160de978f615fb7e68fb7413c1d907ae53072 (diff) |
Refactor vcl::TrueTypeFont class member access
This hides all members, which are needed to create a new TTF font
by calling vcl::CreateTTFromTTGlyphs, and adds an abstraction
to access individual font tables. This is needed, because Qt5
just allows access to the raw font based on font tables.
Change-Id: I74e34cf1aa2529a06ec5ec53aa2be751e58982ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100717
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/unx/generic/fontmanager')
-rw-r--r-- | vcl/unx/generic/fontmanager/fontmanager.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index d1601335a1cd..e04b31224b9c 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -1011,9 +1011,9 @@ bool PrintFontManager::createFontSubset( const OString aToFile( OUStringToOString( aSysPath, aEncoding ) ); // do CFF subsetting if possible - int nCffLength = 0; - const sal_uInt8* pCffBytes = nullptr; - if( GetSfntTable( pTTFont, O_CFF, &pCffBytes, &nCffLength ) ) + sal_uInt32 nCffLength = 0; + const sal_uInt8* pCffBytes = pTTFont->table(vcl::O_CFF, nCffLength); + if (pCffBytes) { rInfo.LoadFont( FontType::CFF_FONT, pCffBytes, nCffLength ); #if 1 // TODO: remove 16bit->long conversion when related methods handle non-16bit glyphids @@ -1101,7 +1101,7 @@ void PrintFontManager::getGlyphWidths( fontID nFont, OString aFromFile = getFontFile( pFont ); if( OpenTTFontFile( aFromFile.getStr(), pFont->m_nCollectionEntry, &pTTFont ) != SFErrCodes::Ok ) return; - int nGlyphs = GetTTGlyphCount(pTTFont); + int nGlyphs = pTTFont->glyphCount(); if (nGlyphs > 0) { rWidths.resize(nGlyphs); @@ -1122,9 +1122,9 @@ void PrintFontManager::getGlyphWidths( fontID nFont, // fill the unicode map // TODO: isn't this map already available elsewhere in the fontmanager? - const sal_uInt8* pCmapData = nullptr; - int nCmapSize = 0; - if (GetSfntTable(pTTFont, O_cmap, &pCmapData, &nCmapSize)) + sal_uInt32 nCmapSize = 0; + const sal_uInt8* pCmapData = pTTFont->table(O_cmap, nCmapSize); + if (pCmapData) { CmapResult aCmapResult; if (ParseCMAP(pCmapData, nCmapSize, aCmapResult)) |