Is it possible to use FontMetrics to predict the size of drawn strings and still make it available on the gallery? If not, is there any other way to make these calculations, that are allowed by the gallery?
Is it possible to use FontMetrics to predict the size of drawn strings and still make it available on the gallery? If not, is there any other way to make these calculations, that are allowed by the gallery?
Please give details on what you want to do, by example
I want to draw a string let's use "Hello World". This string should be drawn using a font of choice, for this example let it be "Arial" size 24. I would like to know the width and the height of this drawn string, so I can use a GreenfootImage with the correct size. For further use I would like to implement automatic line breaking for longer strings.
I want to draw a string let's use "Hello World". This string should be drawn using a font of choice, for this example let it be "Arial" size 24. I would like to know the width and the height of this drawn string, so I can use a GreenfootImage with the correct size. For further use I would like to implement automatic line breaking for longer strings.
You know -- I would like to know how also -- without using any of the AWT package. I have a TextImage Support Class scenario which will not work in javascript translation.