[whatwg] Text APIs on <canvas>
ian at hixie.ch
Wed May 7 13:01:10 PDT 2008
On Wed, 7 May 2008, Tim Johansson wrote:
> On Tue, 06 May 2008 05:10:41 +0200, Ian Hickson <ian at hixie.ch> wrote:
> > I have introduced the following APIs:
> > context.font
> > context.textAlign
> > context.textBaseline
> > context.fillText()
> > context.strokeText()
> strokeText more or less requires a scalable font, which is not available
> in all fonts (and frequently not in mobile phones). I cannot see any
> comments on what should happen when the specified font is not capable of
> generating a stroke. I guess doing a fill instead is the only sensible
> thing to do (as the author has no way of knowing which fonts are
> available and/or scalable and it's bad if text disappears).
> Stroking text is complicated as it is generally less common to have
> support for it in the font library. I would prefer to see stroking
> removed from the spec as it will not work well with all fonts/devices.
The idea is that only scalable (vector) fonts should be used, since
otherwise things will quickly look ugly. I've made the spec require this.
Going forward the spec is likely to require effects such as adding text to
paths, which will require vector data for all fonts used anyway. I don't
want to mislead implementators into thinking bitmap fonts are in any way
an option in this day and age.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg