0

How do you determine the height (in pixels) of a font/line of text as it appears on a canvas? Any ideas how this can be done using GWT are appreciated.

4

1 回答 1

1

GWT translates to Javascript and hence can only work on canvas via javascript api's. So you can either use the javascript solution invoked in GWT JSNI or rewrite the solution in native GWT Java.

I would pick Daniel Earwicker solution on stackoverflow - How can you find the height of text on an HTML canvas?

于 2013-03-30T15:24:41.183 回答