W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2006

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

From: Stefan Haustein <sh@kobjects.org>
Date: Wed, 18 Oct 2006 00:42:31 +0200
Message-ID: <45355C57.8020700@kobjects.org>
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 example image looks like single characters are placed 
at fixed positions out of context.
Of course, this will lead to problems not only when the fonts are 
substituted, but also for the slight differences in font sizes...

Best regards,
Stefan


James Graham wrote:
> 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 have with exactly the use cases you 
> propose (e.g. [1]).
>
> [1] http://golem.ph.utexas.edu/~distler/blog/archives/000888.html
Received on Tuesday, 17 October 2006 15:42:31 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:48 UTC