Presently the only way to measure text is to create a Text node, insert it into a scene, and
ask for its bounds : logical or visual. To make matters a bit worse, those bounds will be
padded because they are overloaded to handle dirty regions.
To help lay out etc, a client will benefit from being able to ask for exact advance of at
least a single line string (perhaps with styling ?). The client will need to specify
a suitable render context (graphics transform and font) as well as the specific
text for this to be valid.
ask for its bounds : logical or visual. To make matters a bit worse, those bounds will be
padded because they are overloaded to handle dirty regions.
To help lay out etc, a client will benefit from being able to ask for exact advance of at
least a single line string (perhaps with styling ?). The client will need to specify
a suitable render context (graphics transform and font) as well as the specific
text for this to be valid.
- duplicates
-
JDK-8098301 No public Font Metrics API
- Closed
-
JDK-8100568 There is need for font metrics
- Closed
- relates to
-
JDK-8300569 ☂ Missing APIs related to rich text control
- In Progress