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
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
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.
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
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
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
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
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,
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
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:
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
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
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
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
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
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...
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
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
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
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?
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
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
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
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
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.
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
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
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
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
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
30 matches
Mail list logo