Bug 572805 - [Cocoa] GC.drawString(), GC.drawText() and FontMetrics ignore leading
Summary: [Cocoa] GC.drawString(), GC.drawText() and FontMetrics ignore leading
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.19   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-13 09:24 EDT by Stefan Mücke CLA
Modified: 2021-05-26 08:02 EDT (History)
1 user (show)

See Also:


Attachments
Snippet to reproduce (2.66 KB, application/octet-stream)
2021-04-13 09:24 EDT, Stefan Mücke CLA
no flags Details
Screenshot on macOS and Windows 7 (69.57 KB, image/png)
2021-04-13 09:28 EDT, Stefan Mücke CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Mücke CLA 2021-04-13 09:24:12 EDT
Created attachment 286092 [details]
Snippet to reproduce

On macOS, FontMetrics.getLeading() always returns zero. GC.drawString() and GC.drawText() don't seem to take leading into account. Tested with Eclipse 4.19 and the very old 4.8.

I first noticed this problem with the "SBL Hebrew" font that has a large leading value (font is available here: https://www.sbl-site.org/Fonts/SBL_Hbrw.ttf).

To reproduce, run the attached snippet. For comparison with Windows, see attached sceenshot.

This is a serious problem because text is drawn outside the computed bounds. When clipping is used (e.g. in Draw2D), text will be partially cut off. I would be very grateful if this could be fixed for 4.20 M2.
Comment 1 Stefan Mücke CLA 2021-04-13 09:28:21 EDT
Created attachment 286093 [details]
Screenshot on macOS  and Windows 7

This problem doesn't seem to depend on the macOS version and is at least present on 10.13 (High Sierra) and 11.0 (Big Sur).