[whatwg] [canvas] letter-spaceing

Ian Hickson ian at hixie.ch
Thu Sep 20 15:48:25 PDT 2012

On Thu, 26 Apr 2012, Tyler Larson wrote:
> In this version of the canvas spec, 
> http://www.whatwg.org/specs/web-apps/current-work which as far as I know 
> of is the new one being worked on, there are two mentions of 
> letter-spacing but no way to set the letter-spacing.

The mentions of letter-spacing there are in the part of the spec relating 
to rendering HTML, not the section on canvas.

> If you take a look at 
> http://www.whatwg.org/specs/web-apps/current-work/#text-styles it has 
> the same properties as it did before. It seems like this is already 
> being thought about but just not yet formalized.

I haven't yet added anything to CanvasDrawingStyles for fonts other than 
the alignment and what is supported by the 'font' shorthand property. I 
expect we will eventually add more, but in the meantime I recommend using 
the new TextMetrics features to perform manual letter spacing 
adjustements. If this is something that is commonly done, it would be a 
good argument for adding native support.

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