Re: [whatwg] Canvas lack of drawString method

2006-11-06 Thread Stefan Haustein
Hi Joao, the Canvas API is already using CSS-like color definitions, so any Canvas API implementation is already forced to implement some small bits of CSS. It would be just consistent to describe a font request in a similar way. Not using CSS names and values for describing font properties

Re: [whatwg] Canvas lack of drawString method

2006-10-26 Thread Joao Eiras
I think mixing CSS and Canvas is a bad idea. You could develop an application which would implement the canvas APi, and be easily programed with ecmascript or java. Adding this kind of feature would force the implementor to support CSS too, at least partially. Stefan Haustein [EMAIL

Re: [whatwg] Canvas lack of drawString method

2006-10-26 Thread Gervase Markham
dolphinling wrote: What if the canvas and span are surrounded by something with font-weight:bold? Will the text in the canvas be drawn bold, too? It's the responsibility of the page designer to make sure the text they are measuring is styled the same as the text they want the metrics of.

Re: [whatwg] Canvas lack of drawString method (p.s.)

2006-10-25 Thread Stefan Haustein
p.s.: However, I would still prefer an API design that keeps it simple to add those methods later. ^ those = the metrics query methods, of course Deleted some text block and then it became a bit out of context

Re: [whatwg] Canvas lack of drawString method

2006-10-25 Thread Charles Iliya Krempeaux
Hello,I believe it starts to gets more complex when you get into globalization. (Not that I'm an expert on that, but) More thought may be needed to be put into this to make this work in a global sense (and not just with roman-based alphabets like ours.) See yaOn 10/25/06, Stefan Haustein

Re: [whatwg] Canvas lack of drawString method

2006-10-25 Thread Stefan Haustein
Charles Iliya Krempeaux wrote: I believe it starts to gets more complex when you get into globalization. (Not that I'm an expert on that, but) More thought may be needed to be put into this to make this work in a global sense (and not just with roman-based alphabets like ours.) Hi

Re: [whatwg] Canvas lack of drawString method

2006-10-25 Thread Charles Iliya Krempeaux
Hello Stefan,(Like I said, I'm not an expert on this, but) For a specific issue... One thing that comes to mind is Ruby in the Japanese language.On 10/25/06, Stefan Haustein [EMAIL PROTECTED] wrote: Charles Iliya Krempeaux wrote: I believe it starts to gets more complex when you get into

Re: [whatwg] Canvas lack of drawString method

2006-10-25 Thread Gervase Markham
Stefan Haustein wrote: I think it is very important to be able to determine the rendered size of the text. Can't you determine the size from the accessible version you are doubtless creating inside the canvas element? ;-) (This assumes that if you draw a string in 8px Monaco on a canvas,

Re: [whatwg] Canvas lack of drawString method

2006-10-25 Thread James Graham
David Hyatt wrote: I'm very reluctant to expose font metrics and information (yet). I think once you start getting into specifying fonts, you open up a can of worms that would make this sort of API addition a lot harder. I still believe that any api that does not allow the author to query

Re: [whatwg] Canvas lack of drawString method

2006-10-25 Thread David Hyatt
Yeah I see what you mean. In addition to a drawText you probably want something like a metricsForText API that would tell you the extent of the string and the font metrics (line height, ascent, descent, baseline). dave On Oct 25, 2006, at 3:10 AM, James Graham wrote: David Hyatt wrote:

Re: [whatwg] Canvas lack of drawString method

2006-10-25 Thread dolphinling
Gervase Markham wrote: Stefan Haustein wrote: I think it is very important to be able to determine the rendered size of the text. Can't you determine the size from the accessible version you are doubtless creating inside the canvas element? ;-) (This assumes that if you draw a string in

Re: [whatwg] Canvas lack of drawString method

2006-10-24 Thread Gervase Markham
David Hyatt wrote: and then the API would be something like: drawText(y-coord of baseline, barchart, myText) I like this idea :-) At the risk of overcomplicating, vertical text is a common requirement for graphs and charts. If this is simpler to implement than the arbitrary text rotation

Re: [whatwg] Canvas lack of drawString method

2006-10-24 Thread Lachlan Hunt
Alfonso Baqueiro wrote: The canvas component is very promising, but the lack of drawString method could be a great error for its success, this lack is a huge limitation, how could you resolve this problem? Just for a bit of fun, I created a demo to show how it is already possible to render

Re: [whatwg] Canvas lack of drawString method

2006-10-24 Thread Stefan Haustein
Hi David, I think it is very important to be able to determine the rendered size of the text. Otherwise, there is no reliable way to make sure things do not overlap. Also, some kinds of applications (flash-like effects, labels expressing weight or distance, WYSIWYG text editors) may require

Re: [whatwg] Canvas lack of drawString method

2006-10-23 Thread Stefan Haustein
Gervase Markham wrote: Stefan Haustein wrote: I think drawElement(elem) opens up a whole new can of worms: - how would an application determine the size of the text box? - where is the baseline position, needed for exact axis label positioning? - there are probably issues with dynamically

Re: [whatwg] Canvas lack of drawString method

2006-10-23 Thread David Hyatt
I think a drawText method would be extremely useful. Rather than specifying stylistic information explicitly (via a font object), I'd use a special parenthetical pseudo-element. thus allowing the author to specify the style as for any other element on a page something like this...

Re: [whatwg] Canvas lack of drawString method

2006-10-18 Thread Stefan Haustein
PROTECTED] Sent: Tuesday, October 17, 2006 2:50 PM Subject: Re: [whatwg] Canvas lack of drawString method Hi, I would like to second the drawString() request. It makes sense to have a simple API, but it should be balanced with application simplicity and readability to some extent. Doing CSS

Re: [whatwg] Canvas lack of drawString method

2006-10-18 Thread Gervase Markham
Alfonso Baqueiro wrote: The canvas component is very promising, but the lack of drawString method could be a great error for its success, this lack is a huge limitation, how could you resolve this problem? I've suggested this in the past as a solution to this problem: why not have a

Re: [whatwg] Canvas lack of drawString method

2006-10-18 Thread Mathieu Henri
On Wed, 18 Oct 2006 20:52:35 +0200, Gervase Markham [EMAIL PROTECTED] wrote: Alfonso Baqueiro wrote: The canvas component is very promising, but the lack of drawString method could be a great error for its success, this lack is a huge limitation, how could you resolve this problem? I've

[whatwg] Canvas lack of drawString method

2006-10-17 Thread Alfonso Baqueiro
The canvas component is very promising, but the lack of drawString method could be a great error for its success, this lack is a huge limitation, how could you resolve this problem?

Re: [whatwg] Canvas lack of drawString method

2006-10-17 Thread Charles Iliya Krempeaux
Hello Alfonso,On 10/17/06, Alfonso Baqueiro [EMAIL PROTECTED] wrote: The canvas component is very promising, but the lack of drawString method could be a great error for its success, this lack is a huge limitation, how could you resolve this problem? I believe that some people's reason for not

Re: [whatwg] Canvas lack of drawString method

2006-10-17 Thread Mathieu Henri
On Tue, 17 Oct 2006 20:16:33 +0200, Charles Iliya Krempeaux [EMAIL PROTECTED] wrote: Hello Alfonso, On 10/17/06, Alfonso Baqueiro [EMAIL PROTECTED] wrote: The canvas component is very promising, but the lack of drawString method could be a great error for its success, this lack is a huge

Re: [whatwg] Canvas lack of drawString method

2006-10-17 Thread Alfonso Baqueiro
Hello Charles,2006/10/17, Charles Iliya Krempeaux [EMAIL PROTECTED]: Hello Alfonso,On 10/17/06, Alfonso Baqueiro [EMAIL PROTECTED] wrote: The canvas component is very promising, but the lack of drawString method could be a great error for its success, this lack is a huge limitation, how could you

Re: [whatwg] Canvas lack of drawString method

2006-10-17 Thread Mathieu Henri
On Tue, 17 Oct 2006 20:32:11 +0200, Mathieu Henri [EMAIL PROTECTED] wrote: On Tue, 17 Oct 2006 20:16:33 +0200, Charles Iliya Krempeaux [EMAIL PROTECTED] wrote: Hello Alfonso, On 10/17/06, Alfonso Baqueiro [EMAIL PROTECTED] wrote: The canvas component is very promising, but the lack of

Re: [whatwg] Canvas lack of drawString method

2006-10-17 Thread Stefan Haustein
Hi, I would like to second the drawString() request. It makes sense to have a simple API, but it should be balanced with application simplicity and readability to some extent. Doing CSS black magic to overlay text and a Canvas object just seems inadequate for something like axis labeling.

Re: [whatwg] Canvas lack of drawString method (p.s.)

2006-10-17 Thread Stefan Haustein
p.s.: To simplify coping with changing font sizes, it probably makes sense to add an align parameter (left|center|right top|center|baseline|bottom) to the drawString call... Stefan Haustein wrote: Hi, I would like to second the drawString() request. It makes sense to have a simple API, but

Re: [whatwg] Canvas lack of drawString method (p.s.)

2006-10-17 Thread James Graham
Stefan Haustein wrote: p.s.: To simplify coping with changing font sizes, it probably makes sense to add an align parameter (left|center|right top|center|baseline|bottom) to the drawString call... How does that solve the font substitution problem? This is a real problem that people actually

Re: [whatwg] Canvas lack of drawString method

2006-10-17 Thread Charles Iliya Krempeaux
Hello Stefan,You'll probably need alot of info, about the font, to be able to really handle fonts properly.It's been a while since I've really written that kind of code.But just consider the concept of kerning. Any API would need to expose that kind of info too. See yaOn 10/17/06, Stefan Haustein

Re: [whatwg] Canvas lack of drawString method (p.s.)

2006-10-17 Thread Stefan Haustein
James, the second image exposes exactly the problem that an alignment parameter would solve: TR and 1/2pi could be drawn aligned baseline right to the references point on the y-axis. 0.97 and pi could be drawn aligned top center to the reference points on the x-axis. The badly rendered

Re: [whatwg] Canvas lack of drawString method

2006-10-17 Thread Stefan Haustein
Charles Iliya Krempeaux wrote: Hello Stefan, You'll probably need alot of info, about the font, to be able to really handle fonts properly. It's been a while since I've really written that kind of code. But just consider the concept of kerning. Any API would need to expose that kind of info