Re: Firefox and text on canvas

Chrome has some long-standing defects in its handling of 
globalCompositeOperation on fillText and strokeText in Windows.

Mozilla's font support in canvas was not introduced until FF 3.5, I believe.

Prior to that, one had to implement it.
SVG Fonts are a handy spec for doing so, as they are easier to parse 
than the binary WOFF format, and other post script/ttf formats.

Mozilla's developers have blocked implementation of SVG Fonts as well as 
detecting current zoom level, in their code base.

In version 3.5, they enabled fillText and strokeText in canvas.
In version 4.0 they enabled page zoom detection, via CSS selectors (an 
obfuscated method).


Background:

The use of text is highly controversial, and one of the major points 
we've brought up on public-canvas-api.

It occupies a gray area that WCAG 2.0 calls "1.4.5 Images of Text". WCAG 
2.0 was authored prior to the wide-distribution of Canvas.

Many of the reasons put forward by Mozilla for barring SVG 
implementations are also used for rejecting text use cases. These 
include substandard hinting for small text, various type setting and 
internationalization algorithms, and the generally complexity with which 
vendors have implemented CSS line boxes. They also include accessibility 
use cases; with Mozilla enforcing the logic that font rendering should 
be managed by the UA and OS APIs.

In practical use: packaging most common fonts into an SVG file runs 
afoul of licensing. When an open license font is used, SVG fonts are 
only practical for a subset of uses. They work quite well for Roman 
script; they work just fine for English-language applications that are 
screen based, and not intended to be printed out as a facsimile of their 
screen representation.

Having worked with Canvas + fonts since early 2007, adapting true type 
1/post script to Canvas and VML, I've had a good deal of exposure to 
this issue.
For the longest time, controversies on text revolved around issues on 
licensing. Many common/commercial fonts have very strict licensing 
requirements.

WOFF has broken through that controversy, with Google taking a stake in 
it by providing a hosted web archive:
http://www.google.com/webfonts

We are now -stuck- on the controversy of whether or not authors can 
render fonts accessibly, and what formats they can use.
Mozilla has taken a hard-line that the users should only use TTF and 
WOFF fonts, and that the user agents should render them.

WebKit has been more lax on the issue: Webkit is more of a consortium, 
Mozilla is a top-down monolith.

My opinion is that Mozilla has taken to the wrong-side of 'language 
standardization' practices. Their font requirements are too formal. This 
increases the entry costs for minority languages, scripts and expression 
to be used on their platform. And I get rather passionate about that 
issue. Like the HTML5 editor, and several others, Mozilla has made the 
process more difficult, intentionally. While this does not -block- 
authors like me from doing our work, it does make accessibility more 
difficult. An unfortunate casualty.

If there are objections by Mozilla and/or the HTML5 editor and various 
others about these positions, I'll provide various links to discussions 
so we may establish some clarity. Until they chime in, I'd say their 
common message is:
Use SVG and WOFF; other methods for presenting written language are 
unsupported and actively discouraged.
Both groups have said this is position is "best for the web".

I disagree with their position, and have called it hubris, culturally 
insensitive and anti-competitive.
Unfortunately, those words come across as ad hominem attacks... I've 
lost credibility when expressing them.


-Charles



On 9/22/2011 8:01 AM, paniz alipour wrote:
> Hello All,
>
> I am using FF3.0.19 and investigating Text on Canvas but as I see Text 
> doesn't appear on Canvas however when
>
> I run it by Google Chrome text appears on Canvas .
>
> Is there any problem with Canvas , Text and Firefox?
>
> Thanks in advance
>
> -- 
> Paniz Alipour

Received on Thursday, 22 September 2011 16:05:59 UTC