summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/font/LogicalFontInstance.cxx (renamed from vcl/source/font/fontinstance.cxx)63
-rw-r--r--vcl/source/font/fontcache.cxx2
-rw-r--r--vcl/source/font/fontmetric.cxx2
3 files changed, 38 insertions, 29 deletions
diff --git a/vcl/source/font/fontinstance.cxx b/vcl/source/font/LogicalFontInstance.cxx
index 6b9f9b16ed26..0936bb7286b9 100644
--- a/vcl/source/font/fontinstance.cxx
+++ b/vcl/source/font/LogicalFontInstance.cxx
@@ -23,17 +23,18 @@
#include <hb-graphite2.h>
#include <font/PhysicalFontFace.hxx>
-#include <fontinstance.hxx>
+#include <font/LogicalFontInstance.hxx>
#include <impfontcache.hxx>
-LogicalFontInstance::LogicalFontInstance(const vcl::font::PhysicalFontFace& rFontFace, const vcl::font::FontSelectPattern& rFontSelData )
- : mxFontMetric( new ImplFontMetricData( rFontSelData ))
- , mpConversion( nullptr )
- , mnLineHeight( 0 )
- , mnOwnOrientation( 0 )
- , mnOrientation( 0 )
- , mbInit( false )
- , mpFontCache( nullptr )
+LogicalFontInstance::LogicalFontInstance(const vcl::font::PhysicalFontFace& rFontFace,
+ const vcl::font::FontSelectPattern& rFontSelData)
+ : mxFontMetric(new ImplFontMetricData(rFontSelData))
+ , mpConversion(nullptr)
+ , mnLineHeight(0)
+ , mnOwnOrientation(0)
+ , mnOrientation(0)
+ , mbInit(false)
+ , mpFontCache(nullptr)
, m_aFontSelData(rFontSelData)
, m_pHbFont(nullptr)
, m_nAveWidthFactor(1.0f)
@@ -99,20 +100,23 @@ void LogicalFontInstance::GetScale(double* nXScale, double* nYScale) const
*nXScale = nWidth / nUPEM;
}
-void LogicalFontInstance::AddFallbackForUnicode(sal_UCS4 cChar, FontWeight eWeight, const OUString& rFontName,
- bool bEmbolden, const ItalicMatrix& rMatrix)
+void LogicalFontInstance::AddFallbackForUnicode(sal_UCS4 cChar, FontWeight eWeight,
+ const OUString& rFontName, bool bEmbolden,
+ const ItalicMatrix& rMatrix)
{
- MapEntry& rEntry = maUnicodeFallbackList[ std::pair< sal_UCS4, FontWeight >(cChar,eWeight) ];
+ MapEntry& rEntry = maUnicodeFallbackList[std::pair<sal_UCS4, FontWeight>(cChar, eWeight)];
rEntry.sFontName = rFontName;
rEntry.bEmbolden = bEmbolden;
rEntry.aItalicMatrix = rMatrix;
}
bool LogicalFontInstance::GetFallbackForUnicode(sal_UCS4 cChar, FontWeight eWeight,
- OUString* pFontName, bool* pEmbolden, ItalicMatrix* pMatrix) const
+ OUString* pFontName, bool* pEmbolden,
+ ItalicMatrix* pMatrix) const
{
- UnicodeFallbackList::const_iterator it = maUnicodeFallbackList.find( std::pair< sal_UCS4, FontWeight >(cChar,eWeight) );
- if( it == maUnicodeFallbackList.end() )
+ UnicodeFallbackList::const_iterator it
+ = maUnicodeFallbackList.find(std::pair<sal_UCS4, FontWeight>(cChar, eWeight));
+ if (it == maUnicodeFallbackList.end())
return false;
const MapEntry& rEntry = (*it).second;
@@ -122,17 +126,20 @@ bool LogicalFontInstance::GetFallbackForUnicode(sal_UCS4 cChar, FontWeight eWeig
return true;
}
-void LogicalFontInstance::IgnoreFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, std::u16string_view rFontName )
+void LogicalFontInstance::IgnoreFallbackForUnicode(sal_UCS4 cChar, FontWeight eWeight,
+ std::u16string_view rFontName)
{
- UnicodeFallbackList::iterator it = maUnicodeFallbackList.find( std::pair< sal_UCS4,FontWeight >(cChar,eWeight) );
- if( it == maUnicodeFallbackList.end() )
+ UnicodeFallbackList::iterator it
+ = maUnicodeFallbackList.find(std::pair<sal_UCS4, FontWeight>(cChar, eWeight));
+ if (it == maUnicodeFallbackList.end())
return;
const MapEntry& rEntry = (*it).second;
if (rEntry.sFontName == rFontName)
- maUnicodeFallbackList.erase( it );
+ maUnicodeFallbackList.erase(it);
}
-bool LogicalFontInstance::GetGlyphBoundRect(sal_GlyphId nID, tools::Rectangle &rRect, bool bVertical) const
+bool LogicalFontInstance::GetGlyphBoundRect(sal_GlyphId nID, tools::Rectangle& rRect,
+ bool bVertical) const
{
if (mpFontCache && mpFontCache->GetCachedGlyphBoundRect(this, nID, rRect))
return true;
@@ -147,7 +154,8 @@ bool LogicalFontInstance::IsGraphiteFont()
{
if (!m_xbIsGraphiteFont)
{
- m_xbIsGraphiteFont = hb_graphite2_face_get_gr_face(hb_font_get_face(GetHbFont())) != nullptr;
+ m_xbIsGraphiteFont
+ = hb_graphite2_face_get_gr_face(hb_font_get_face(GetHbFont())) != nullptr;
}
return *m_xbIsGraphiteFont;
}
@@ -161,8 +169,9 @@ bool LogicalFontInstance::NeedOffsetCorrection(sal_Int32 nYOffset)
m_xeFontFamilyEnum = FontFamilyEnum::Unclassified;
- if (hb_ot_name_get_utf8 (hb_font_get_face(GetHbFont()),
- HB_OT_NAME_ID_FONT_FAMILY , HB_LANGUAGE_INVALID, &familyname_size, familyname) == 8)
+ if (hb_ot_name_get_utf8(hb_font_get_face(GetHbFont()), HB_OT_NAME_ID_FONT_FAMILY,
+ HB_LANGUAGE_INVALID, &familyname_size, familyname)
+ == 8)
{
// DFKai-SB (ukai.ttf) is a built-in font under traditional Chinese
// Windows. It has wrong extent values in glyf table. The problem results
@@ -178,10 +187,10 @@ bool LogicalFontInstance::NeedOffsetCorrection(sal_Int32 nYOffset)
switch (*m_xeFontFamilyEnum)
{
case FontFamilyEnum::DFKaiSB:
- // -839: optimization for one third of ukai.ttf
- if (nYOffset == -839)
- bRet = false;
- break;
+ // -839: optimization for one third of ukai.ttf
+ if (nYOffset == -839)
+ bRet = false;
+ break;
default:
bRet = false;
}
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index 9a87d02bcda2..ef08a5467321 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -24,7 +24,7 @@
#include <font/PhysicalFontCollection.hxx>
#include <font/PhysicalFontFace.hxx>
#include <font/PhysicalFontFamily.hxx>
-#include <fontinstance.hxx>
+#include <font/LogicalFontInstance.hxx>
#include <impfontcache.hxx>
using namespace vcl::font;
diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index 428af2e46e86..4f398ba76a57 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -28,7 +28,7 @@
#include <font/FontSelectPattern.hxx>
#include <font/PhysicalFontFace.hxx>
-#include <fontinstance.hxx>
+#include <font/LogicalFontInstance.hxx>
#include <impfontmetricdata.hxx>
#include <sft.hxx>