API review: RT-27762: Text not centered vertically in bounds for windows default 12px
Felipe Heidrich
felipe.heidrich at oracle.com
Mon Feb 25 16:48:42 PST 2013
Hi,
In order to fix RT-27762 Jasper and I have been experiment with a new type of text bounds.
What this new type does is to change the metrics of the node so that the pixel space above the bellow the cap height are the same (either by increasing the descent, or the internal leading).
We are do this to improve the visual appearance of UI components holding vertically centered text, such buttons, labels, and others.
New API proposal:
TextBoundsType#LOGICAL_V_CENTER:
/**
* Use logical vertical centered bounds as the basis for calculating the bounds.
* <p>
* This bounds type is typically used to center {@code Text} nodes vertically
* within the bounds of its parent.
*/
LOGICAL_V_CENTER
Here is a screenshot of new mode in action (hopping the mailing allows attachments):
Left is regular logical bounds, right is logical v center bounds, you need ninja eyes to see the difference:
Regards
Felipe
More information about the openjfx-dev
mailing list