[ 
https://issues.apache.org/jira/browse/PIVOT-1060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17320476#comment-17320476
 ] 

Roger Lee Whitcomb commented on PIVOT-1060:
-------------------------------------------

Just wanted to say that just because on OSX there are no (apparent) problems 
doesn't mean that the calculations are correct, but probably just that the font 
used on OSX has different metrics that somehow mask the problems.  But, I can 
already see that the calculations in TextAreaSkinParagraphView.java do not 
include the font leading in the line height (just ascent + descent), while 
NumberRulerSkin does use the leading (because it is included in the 
LineMetrics.getHeight() according to the Javadoc). TextPaneSkinTextNodeView 
also calculates lineHeight as ascent + descent + leading (or the same as 
"getHeight()"). Not sure why there is the ~1 pix baseline difference, though.  
So, probably the font in OSX has 0 leading, but I will confirm with the metrics 
values.

> Inconsistencies with font measurement on some platforms
> -------------------------------------------------------
>
>                 Key: PIVOT-1060
>                 URL: https://issues.apache.org/jira/browse/PIVOT-1060
>             Project: Pivot
>          Issue Type: Bug
>          Components: wtk-terra
>         Environment: Windows 10 with 18 pt FontUtilities.MONOSPACED_FONTS 
> (which could be any of "Courier", "Courier New", "Andale Mono", "Monaco", 
> "Menlo", or "MONOSPACED" depending on platform).
>            Reporter: Roger Lee Whitcomb
>            Assignee: Roger Lee Whitcomb
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: font_measure_osx.png, font_measure_windows.png
>
>
> Using a (new) NumberRuler with both TextArea and TextPane shows 
> inconsistencies (only on Windows that I can tell) between the font height and 
> positioning between the ruler and the two components. Specifically:
> * with TextPane the numbers are ~1 pix lower in ruler than in text
> * with TextArea the numbers in ruler are same ~1 pix lower on normal lines, 
> BUT on wrapped lines the TextArea seems to ignore leading so that the lines 
> get higher and higher WRT ruler
> On OSX there seems to be none of the problems.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to