From 744e964619b5c49870ceab7f59daf1272f24cf75 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 22 Jun 2021 17:13:39 +0100 Subject: disable ligatures for monospace fonts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we don't want e.g. a ffi ligature for Courier/Nimbus Mono PS Change-Id: I292c6e2ea217b511b4affcd8dab4a4bda85ab5da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117644 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/gdi/CommonSalLayout.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vcl/source/gdi') diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 801abdd16670..50ad02843887 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -351,6 +351,12 @@ bool GenericSalLayout::LayoutText(ImplLayoutArgs& rArgs, const SalLayoutGlyphsIm maFeatures.push_back({ HB_TAG('k','e','r','n'), 0, 0, static_cast(-1) }); } + if (rFontSelData.GetPitch() == PITCH_FIXED) + { + SAL_INFO("vcl.harfbuzz", "Disabling ligatures for font: " << rFontSelData.maTargetName); + maFeatures.push_back({ HB_TAG('l','i','g','a'), 0, 0, static_cast(-1) }); + } + ParseFeatures(rFontSelData.maTargetName); double nXScale = 0; -- cgit