Relative Content

Tag Archive for javaawtjava-2d

Java TextLayout ignores trailing whitespace

I am using TextLayout to measure the bounds of a text string. In this measurement I need to include any trailing whitespace. However it seems that by default, TextLayout ignores any trailing whitespace when computing text bounds. Here’s an example: