Re: Know how wide text will be on a Canvas

2012-07-06 Thread Sean
Ah, thank you! On Thursday, July 5, 2012 8:37:00 PM UTC-4, Jim Douglas wrote: http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/canvas/dom/client/Context2d.html#setFont(java.lang.String)

Re: Know how wide text will be on a Canvas

2012-07-06 Thread Jim Douglas
Thanks for giving me a reason to go looking for it. I added the incubator Canvas to my app a few years ago; I hadn't noticed that GWT now includes an official Canvas implementation (as of 2.2, apparently). On Jul 6, 4:33 am, Sean slough...@gmail.com wrote: Ah, thank you! On Thursday,

Know how wide text will be on a Canvas

2012-07-05 Thread Sean
Hey guys, I was wondering if there was a way I can set the font in a canvas: *m_context.setFont(bold 12px sans-serif);* Then take some text, like Hello World! and know how many pixels wide that will be? I have a set space on my canvas, and I want to maximize the size of the text or justify it

Re: Know how wide text will be on a Canvas

2012-07-05 Thread Jim Douglas
http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/canvas/dom/client/Context2d.html#setFont(java.lang.String) http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/canvas/dom/client/Context2d.html#measureText(java.lang.String)