[whatwg] Text APIs on <canvas>

Ian Hickson ian at hixie.ch
Fri Jun 13 01:38:53 PDT 2008


On Thu, 8 May 2008, Mathieu HENRI wrote:
> > 
> > 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.
> 
> The problem is that bitmap fonts flourish on handheld and devices and, 
> as mentioned by others, in high density alphabets. With the Text APIs 
> being a MUST, this can be a bugger.

This will improve over time, though. It's not like bitmap fonts are the 
solution people want, they're just the stopgap while systems improve to 
the point of being able to handle real fonts.


> Apropos context.fillText() and the maxWidth attribute, the spec now says
> 
> 	" 4. If the maxWidth argument was specified and the hypothetical 
> width of the inline box in the hypothetical line box is greater than 
> maxWidth CSS pixels, then change font to have a more condensed font (if 
> one is available or if a reasonably readable one can be synthesised by 
> applying a horizontal scale factor to the font) or a smaller font, and 
> return to the previous step. "
> 
> Scaling the glyphs uniformly, vertically anchored to the textBaseline, 
> would look much more coherent and be more predictable for developers 
> than applying a non-uniform scaling or changing the font altogether.
> 
> If possible I would loose the part about changing the font or applying 
> an horizontal scale factor to the font.

I think that slight condensing, if possible, looks much better than 
varying the font size slightly. At the moment, it's up to the UAs to 
decide what to do, though, so if implementations decide scaling is 
better, they are welcome to do that.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list