diff options
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r-- | vcl/source/outdev/font.cxx | 26 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 5 |
2 files changed, 15 insertions, 16 deletions
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 25f3feec001f..c65dd0d5cce9 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -887,10 +887,8 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan LogicalFontInstance* pFontInstance = pOutDev->mpFontCache->GetFontInstance( pOutDev->mpFontCollection, aFont, aSize, fExactHeight ); if (pFontInstance) { - if( pFontInstance->maFontSelData.mpFontData ) - aFont.SetFamilyName( pFontInstance->maFontSelData.mpFontData->GetFamilyName() ); - else - aFont.SetFamilyName( pFontInstance->maFontSelData.maTargetName ); + assert(pFontInstance->GetFontFace()); + aFont.SetFamilyName(pFontInstance->GetFontFace()->GetFamilyName()); pFontInstance->Release(); } } @@ -977,16 +975,17 @@ void OutputDevice::InitFont() const { // decide if antialiasing is appropriate bool bNonAntialiased(GetAntialiasing() & AntialiasingFlags::DisableText); + FontSelectPattern aPattern(mpFontInstance->GetFontSelectPattern()); if (!utl::ConfigManager::IsFuzzing()) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); bNonAntialiased |= bool(rStyleSettings.GetDisplayOptions() & DisplayOptions::AADisable); - bNonAntialiased |= (int(rStyleSettings.GetAntialiasingMinPixelHeight()) > mpFontInstance->maFontSelData.mnHeight); + bNonAntialiased |= (int(rStyleSettings.GetAntialiasingMinPixelHeight()) > aPattern.mnHeight); } - mpFontInstance->maFontSelData.mbNonAntialiased = bNonAntialiased; + aPattern.mbNonAntialiased = bNonAntialiased; // select font in the device layers - mpGraphics->SetFont( &(mpFontInstance->maFontSelData), 0 ); + mpGraphics->SetFont(&aPattern, 0); mbInitFont = false; } } @@ -1063,7 +1062,7 @@ bool OutputDevice::ImplNewFont() const { pFontInstance->mbInit = true; - pFontInstance->mxFontMetric->SetOrientation( sal::static_int_cast<short>(pFontInstance->maFontSelData.mnOrientation) ); + pFontInstance->mxFontMetric->SetOrientation( sal::static_int_cast<short>(mpFontInstance->GetFontSelectPattern().mnOrientation) ); pGraphics->GetFontMetric( pFontInstance->mxFontMetric, 0 ); pFontInstance->mxFontMetric->ImplInitTextLineSize( this ); @@ -1150,9 +1149,9 @@ bool OutputDevice::ImplNewFont() const void OutputDevice::SetFontOrientation( LogicalFontInstance* const pFontInstance ) const { - if( pFontInstance->maFontSelData.mnOrientation && !pFontInstance->mxFontMetric->GetOrientation() ) + if( pFontInstance->GetFontSelectPattern().mnOrientation && !pFontInstance->mxFontMetric->GetOrientation() ) { - pFontInstance->mnOwnOrientation = sal::static_int_cast<short>(pFontInstance->maFontSelData.mnOrientation); + pFontInstance->mnOwnOrientation = sal::static_int_cast<short>(pFontInstance->GetFontSelectPattern().mnOrientation); pFontInstance->mnOrientation = pFontInstance->mnOwnOrientation; } else @@ -1341,7 +1340,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt rLayoutArgs.ResetPos(); OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear(); - FontSelectPattern aFontSelData = mpFontInstance->maFontSelData; + FontSelectPattern aFontSelData(mpFontInstance->GetFontSelectPattern()); // try if fallback fonts support the missing code units for( int nFallbackLevel = 1; nFallbackLevel < MAX_FALLBACK; ++nFallbackLevel ) @@ -1357,13 +1356,12 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt break; aFontSelData.mpFontInstance = pFallbackFont; - aFontSelData.mpFontData = pFallbackFont->maFontSelData.mpFontData; if( nFallbackLevel < MAX_FALLBACK-1) { // ignore fallback font if it is the same as the original font // unless we are looking for a substitution for 0x202F, in which // case we'll just use a normal space - if( mpFontInstance->maFontSelData.mpFontData == aFontSelData.mpFontData && + if( mpFontInstance->GetFontFace() == pFallbackFont->GetFontFace() && aMissingCodes.indexOf(0x202F) == -1 ) { pFallbackFont->Release(); @@ -1379,7 +1377,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt if( !pMultiSalLayout ) pMultiSalLayout.reset( new MultiSalLayout( std::move(pSalLayout) ) ); pMultiSalLayout->AddFallback( std::move(pFallback), - rLayoutArgs.maRuns, aFontSelData.mpFontData ); + rLayoutArgs.maRuns, aFontSelData.mpFontInstance->GetFontFace() ); if (nFallbackLevel == MAX_FALLBACK-1) pMultiSalLayout->SetIncomplete(true); } diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index d794feb5ec42..1d115dc56397 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -217,9 +217,10 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout ) if( !pVDev->SetOutputSizePixel( aBoundRect.GetSize() ) ) return false; + const FontSelectPattern& rPattern = mpFontInstance->GetFontSelectPattern(); vcl::Font aFont( GetFont() ); aFont.SetOrientation( 0 ); - aFont.SetFontSize( Size( mpFontInstance->maFontSelData.mnWidth, mpFontInstance->maFontSelData.mnHeight ) ); + aFont.SetFontSize( Size( rPattern.mnWidth, rPattern.mnHeight ) ); pVDev->SetFont( aFont ); pVDev->SetTextColor( COL_BLACK ); pVDev->SetTextFillColor(); @@ -1358,7 +1359,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, // do glyph fallback if needed // #105768# avoid fallback for very small font sizes - if (aLayoutArgs.NeedFallback() && mpFontInstance->maFontSelData.mnHeight >= 3) + if (aLayoutArgs.NeedFallback() && mpFontInstance->GetFontSelectPattern().mnHeight >= 3) pSalLayout = ImplGlyphFallbackLayout(std::move(pSalLayout), aLayoutArgs); // position, justify, etc. the layout |