diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-09-11 22:07:12 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-09-15 06:42:33 +0200 |
commit | c7482bc2904401e7d975b5721ec861b8589253f9 (patch) | |
tree | dbb52861749112e67b338f0c6348a541f7b83d2a /vcl/source/font | |
parent | a88c9752c6251dceb77c809b4592f2516e10f3e6 (diff) |
Replace FindCmap with ParseCMAP
This introduces a potential performance regression, because
FindCmap works on the existing font tables and just sets up
a lookup function, while ParseCMAP creates some optimized,
in-memory lookup table, which needs a bit more work, but
is faster in its usage, I think. At least the initial usage
is faster the old way, as the CMAPs aren't decoded at all.
As you can see, the old code is just used on Windows and
MacOS / iOS. Deep in the bowels of the PrintFontManager, the
CMAP is also decoded using ParseCMAP...
So I'm not sure this potential regression really exists. Most
fonts will already have a decoded CMAP, so my guess is this
is actually faster in the end. No idea, how to measure.
Change-Id: I52caac1264cd3ff11a2a3fa6e9c800f67f146a79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102685
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/source/font')
-rw-r--r-- | vcl/source/font/fontcharmap.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/font/fontcharmap.cxx b/vcl/source/font/fontcharmap.cxx index 61f22f48f141..05a800fe1af7 100644 --- a/vcl/source/font/fontcharmap.cxx +++ b/vcl/source/font/fontcharmap.cxx @@ -54,6 +54,7 @@ ImplFontCharMap::ImplFontCharMap( const CmapResult& rCR ) , mpGlyphIds( rCR.mpGlyphIds ) , mnRangeCount( rCR.mnRangeCount ) , mnCharCount( 0 ) + , m_bSymbolic(rCR.mbSymbolic) { const sal_UCS4* pRangePtr = mpRangeCodes; for( int i = mnRangeCount; --i >= 0; pRangePtr += 2 ) @@ -429,6 +430,8 @@ bool FontCharMap::IsDefaultMap() const return mpImplFontCharMap->isDefaultMap(); } +bool FontCharMap::isSymbolic() const { return mpImplFontCharMap->m_bSymbolic; } + int FontCharMap::GetCharCount() const { return mpImplFontCharMap->mnCharCount; |