From bd2ff931428a7007ef639004ea6a65a2fa417cb1 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Mon, 7 Nov 2016 07:52:21 +0200 Subject: Set Kashida width also on macOS Otherwise we might not get any Kashida justification at all. Change-Id: I6521d5a267392314d5d0da84b93fcd80c7b7cc57 --- vcl/quartz/ctfonts.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vcl') diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 11905c24d8e7..735a30b689c9 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -143,6 +143,15 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricDataRef& rxFontMetric ) const rxFontMetric->SetScalableFlag( true ); rxFontMetric->SetTrueTypeFlag( true ); // Not sure, but this field is used only for Windows so far rxFontMetric->SetKernableFlag( true ); + + UniChar nKashidaCh = 0x0640; + CGGlyph nKashidaGid = 0; + if (CTFontGetGlyphsForCharacters(aCTFontRef, &nKashidaCh, &nKashidaGid, 1)) + { + double nKashidaAdv = CTFontGetAdvancesForGlyphs(aCTFontRef, + kCTFontHorizontalOrientation, &nKashidaGid, nullptr, 1); + rxFontMetric->SetMinKashida(lrint(nKashidaAdv)); + } } bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const -- cgit