summaryrefslogtreecommitdiff
path: root/vcl/quartz/ctfonts.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-11-07 07:52:21 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-11-07 07:52:21 +0200
commitbd2ff931428a7007ef639004ea6a65a2fa417cb1 (patch)
tree873763dd6d9e354fcf128ba6afeb09999229a27d /vcl/quartz/ctfonts.cxx
parent639735edaffd35dfe99e527789402e030d95ab45 (diff)
Set Kashida width also on macOS
Otherwise we might not get any Kashida justification at all. Change-Id: I6521d5a267392314d5d0da84b93fcd80c7b7cc57
Diffstat (limited to 'vcl/quartz/ctfonts.cxx')
-rw-r--r--vcl/quartz/ctfonts.cxx9
1 files changed, 9 insertions, 0 deletions
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