summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs6
-rw-r--r--vcl/inc/impfontmetricdata.hxx2
-rw-r--r--vcl/source/font/fontmetric.cxx20
3 files changed, 11 insertions, 17 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index fb262b8e7ab3..714fa8ccc485 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5613,8 +5613,10 @@
</desc>
</info>
<value>
- <!-- tdf#152267 -->
- <it>Liberation Serif,100,-123,100,420</it>
+ <!-- tdf#152267, tdf#154235 -->
+ <it>Liberation Serif</it>
+ <it>Liberation Sans</it>
+ <it>Liberation Mono</it>
</value>
</prop>
<prop oor:name="PluginsEnabled" oor:type="xs:boolean" oor:nillable="false">
diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx
index 5625cfa726b5..63394a93eb23 100644
--- a/vcl/inc/impfontmetricdata.hxx
+++ b/vcl/inc/impfontmetricdata.hxx
@@ -102,7 +102,7 @@ public:
void ImplInitBaselines(LogicalFontInstance *pFontInstance);
private:
- bool ShouldNotUseUnderlineMetrics(int, int, int, int) const;
+ bool ShouldNotUseUnderlineMetrics() const;
bool ImplInitTextLineSizeHarfBuzz(LogicalFontInstance *pFontInstance);
bool ShouldUseWinMetrics(int, int, int, int, int, int) const;
diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index 3f87950d5314..8a998c6815c6 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -176,23 +176,16 @@ ImplFontMetricData::ImplFontMetricData( const vcl::font::FontSelectPattern& rFon
SetStyleName( rFontSelData.GetStyleName() );
}
-bool ImplFontMetricData::ShouldNotUseUnderlineMetrics(int nUnderlineSize, int nUnderlineOffset,
- int nStrikeoutSize,
- int nStrikeoutOffset) const
+bool ImplFontMetricData::ShouldNotUseUnderlineMetrics() const
{
if (utl::ConfigManager::IsFuzzing())
return false;
- OUString aFontIdentifier(GetFamilyName() + "," + OUString::number(nUnderlineSize) + ","
- + OUString::number(nUnderlineOffset) + ","
- + OUString::number(nStrikeoutSize) + ","
- + OUString::number(nStrikeoutOffset));
-
css::uno::Sequence<OUString> rNoUnderlineMetricsList(
officecfg::Office::Common::Misc::FontsDontUseUnderlineMetrics::get());
- if (comphelper::findValue(rNoUnderlineMetricsList, aFontIdentifier) != -1)
+ if (comphelper::findValue(rNoUnderlineMetricsList, GetFamilyName()) != -1)
{
- SAL_INFO("vcl.gdi.fontmetric", "Not using underline metrics for: " << aFontIdentifier);
+ SAL_INFO("vcl.gdi.fontmetric", "Not using underline metrics for: " << GetFamilyName());
return true;
}
return false;
@@ -200,6 +193,9 @@ bool ImplFontMetricData::ShouldNotUseUnderlineMetrics(int nUnderlineSize, int nU
bool ImplFontMetricData::ImplInitTextLineSizeHarfBuzz(LogicalFontInstance* pFont)
{
+ if (ShouldNotUseUnderlineMetrics())
+ return false;
+
auto* pHbFont = pFont->GetHbFont();
hb_position_t nUnderlineSize;
@@ -215,10 +211,6 @@ bool ImplFontMetricData::ImplInitTextLineSizeHarfBuzz(LogicalFontInstance* pFont
if (!hb_ot_metrics_get_position(pHbFont, HB_OT_METRICS_TAG_STRIKEOUT_OFFSET, &nStrikeoutOffset))
return false;
- if (ShouldNotUseUnderlineMetrics(nUnderlineSize, nUnderlineOffset, nStrikeoutSize,
- nStrikeoutOffset))
- return false;
-
double fScale = 0;
pFont->GetScale(nullptr, &fScale);