diff options
Diffstat (limited to 'vcl/quartz/salgdi.cxx')
-rw-r--r-- | vcl/quartz/salgdi.cxx | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index fc986eba5806..2bc08551c1cc 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -701,75 +701,6 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData, return true; } -void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bVertical, - std::vector< sal_Int32 >& rGlyphWidths, Ucs2UIntMap& rUnicodeEnc ) -{ - rGlyphWidths.clear(); - rUnicodeEnc.clear(); - - std::vector<unsigned char> aBuffer; - if( !GetRawFontData( pFontData, aBuffer, nullptr ) ) - return; - - // TODO: modernize psprint's horrible fontsubset C-API - // this probably only makes sense after the switch to another SCM - // that can preserve change history after file renames - - // use the font subsetter to get the widths - TrueTypeFont* pSftFont = nullptr; - SFErrCodes nRC = ::OpenTTFontBuffer( static_cast<void*>(aBuffer.data()), aBuffer.size(), 0, &pSftFont); - if( nRC != SFErrCodes::Ok ) - return; - - const int nGlyphCount = ::GetTTGlyphCount( pSftFont ); - if( nGlyphCount > 0 ) - { - // get glyph metrics - rGlyphWidths.resize(nGlyphCount); - std::vector<sal_uInt16> aGlyphIds(nGlyphCount); - for( int i = 0; i < nGlyphCount; i++ ) - { - aGlyphIds[i] = static_cast<sal_uInt16>(i); - } - - std::unique_ptr<sal_uInt16[]> pGlyphMetrics = ::GetTTSimpleGlyphMetrics( pSftFont, aGlyphIds.data(), - nGlyphCount, bVertical ); - if( pGlyphMetrics ) - { - for( int i = 0; i < nGlyphCount; ++i ) - { - rGlyphWidths[i] = pGlyphMetrics[i]; - } - pGlyphMetrics.reset(); - } - - rtl::Reference<CoreTextFontFace> rCTFontData(new CoreTextFontFace(*pFontData, pFontData->GetFontId())); - FontCharMapRef xFCMap = rCTFontData->GetFontCharMap(); - SAL_WARN_IF( !xFCMap.is() || !xFCMap->GetCharCount(), "vcl", "no charmap" ); - - // get unicode<->glyph encoding - // TODO? avoid sft mapping by using the xFCMap itself - int nCharCount = xFCMap->GetCharCount(); - sal_uInt32 nChar = xFCMap->GetFirstChar(); - for( ; --nCharCount >= 0; nChar = xFCMap->GetNextChar( nChar ) ) - { - if( nChar > 0xFFFF ) // TODO: allow UTF-32 chars - break; - - sal_Ucs nUcsChar = static_cast<sal_Ucs>(nChar); - sal_uInt32 nGlyph = ::MapChar( pSftFont, nUcsChar ); - if( nGlyph > 0 ) - { - rUnicodeEnc[ nUcsChar ] = nGlyph; - } - } - - xFCMap = nullptr; - } - - ::CloseTTFont( pSftFont ); -} - const void* AquaSalGraphics::GetEmbedFontData(const PhysicalFontFace*, long* /*pDataLen*/) { return nullptr; |