summaryrefslogtreecommitdiffstats
path: root/vcl/unx/generic/gdi/cairotextrender.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-11-24 08:54:11 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-11-24 10:06:26 +0000
commitb30e298c3f8d9202a14e0ca08120ccde31e413ee (patch)
treeca6cb130002c55994838cdc6cc1816973c276cb6 /vcl/unx/generic/gdi/cairotextrender.cxx
parentShow also the message for the last Windows error in our own error handler (diff)
downloadcore-b30e298c3f8d9202a14e0ca08120ccde31e413ee.tar.gz
core-b30e298c3f8d9202a14e0ca08120ccde31e413ee.zip
move the FontConfigFontOptions out of FreetypeFontInstance now
Change-Id: Ic6ff21533a53df16fed4ee086f78ff368cb23afd Reviewed-on: https://gerrit.libreoffice.org/31130 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/generic/gdi/cairotextrender.cxx')
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx38
1 files changed, 3 insertions, 35 deletions
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 55d5e49c5025..eb941e2b384c 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -138,31 +138,12 @@ bool CairoTextRender::setFont( const FontSelectPattern *pEntry, int nFallbackLev
// register to use the font
mpFreetypeFont[ nFallbackLevel ] = pFreetypeFont;
- // apply font specific-hint settings
- FreetypeFontInstance* pSFE = static_cast<FreetypeFontInstance*>( pEntry->mpFontInstance );
- pSFE->HandleFontOptions();
-
return true;
}
return false;
}
-void FreetypeFontInstance::HandleFontOptions()
-{
- if( !mpFreetypeFont )
- return;
- if( !mbGotFontOptions )
- {
- // get and cache the font options
- mbGotFontOptions = true;
- mxFontOptions.reset(GetFCFontOptions( *maFontSelData.mpFontData,
- maFontSelData.mnHeight ));
- }
- // apply the font options
- mpFreetypeFont->SetFontOptions(mxFontOptions);
-}
-
void CairoFontsCache::CacheFont(void *pFont, const CairoFontsCache::CacheId &rId)
{
maLRUFonts.push_front( std::pair<void*, CairoFontsCache::CacheId>(pFont, rId) );
@@ -461,29 +442,16 @@ void CairoTextRender::GetDevFontList( PhysicalFontCollection* pFontCollection )
ImplGetSVData()->maGDIData.mbNativeFontConfig = true;
}
-void cairosubcallback(void* pPattern)
+void FontConfigFontOptions::cairo_font_options_substitute(FcPattern* pPattern)
{
ImplSVData* pSVData = ImplGetSVData();
const cairo_font_options_t* pFontOptions = pSVData->mpDefInst->GetCairoFontOptions();
if( !pFontOptions )
return;
- cairo_ft_font_options_substitute(pFontOptions, static_cast<FcPattern*>(pPattern));
+ cairo_ft_font_options_substitute(pFontOptions, pPattern);
}
-FontConfigFontOptions* GetFCFontOptions( const FontAttributes& rFontAttributes, int nSize)
-{
- psp::FastPrintFontInfo aInfo;
-
- aInfo.m_aFamilyName = rFontAttributes.GetFamilyName();
- aInfo.m_eItalic = rFontAttributes.GetItalic();
- aInfo.m_eWeight = rFontAttributes.GetWeight();
- aInfo.m_eWidth = rFontAttributes.GetWidthType();
-
- return psp::PrintFontManager::getFontOptions(aInfo, nSize, cairosubcallback);
-}
-
-void
-CairoTextRender::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int nFallbackLevel )
+void CairoTextRender::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int nFallbackLevel )
{
if( nFallbackLevel >= MAX_FALLBACK )
return;