<AWT Dev> [OpenJDK 2D-Dev] [9] Review request for 8076545 Text size is twice bigger under Windows L&F on Win 8.1 with HiDPI display

Jim Graham james.graham at oracle.com
Fri Oct 30 19:40:56 UTC 2015

In this case round may be better.  ceil() is more for cases where you 
needed "at least X amount of room", but I don't think a font size is an 
"at least this much" kind of case.

Also, I've been toying with the idea that use of ceil() and floor() in 
any DPI-adjustment equations should really be "ceil(val - epsilon)" or 
"floor(ceil + epsilon)" for some small value of epsilon chosen just 
large enough to prevent various round-off errors from affecting the 
outcome.  One idea is for 1/256 as the value of epsilon since that could 
equate to the smallest measurable difference in terms of alpha or 
interpolation results (or 1/512 for "half the smallest quantum")...


On 10/29/15 1:36 PM, Phil Race wrote:
> size->cx = (int)ceil(size->cx / scale);
> So if size->cx / scale works out to be 12.0001 you will round it up to 13?
> Can you check what pixel size windows gives you in such a case ?
> I'd be a little surprised if they did that rather than round.
> Is the SetFontProperty that does not accept a scale parameter still used
> somewhere ?
> -phil.
> On 10/29/2015 04:53 AM, Sergey Bylokhov wrote:
>> On 17.07.15 16:27, Alexander Scherbatiy wrote:
>>>> - Sergey's point about multi-mon should be checked out.
>>>      Windows 8.1 has option "Let me choose one scaling level for all my
>>> displays".
>>>      If I unset it I am able to change the size of all items. However,
>>> the DPI which returns GetDPIForMonitor is still 2 on HiDPI displays.
>> This version looks fine, but I am sure it can be double checked on
>> windows 10 at some moment as well.

More information about the awt-dev mailing list