[whatwg] font security on measureText

Rik Cabanier cabanier at gmail.com
Thu May 2 14:36:14 PDT 2013


The canvas 2d spec currently states that a font has to be local in order
for measureText to work: [1][2]

If doing these measurements requires using a font that has an origin that
is not the same as that of the Document object that owns the canvas element
(even if "using a font" means just checking if that font has a particular
glyph in it before falling back to another font), then the method must
throw a SecurityError exception.


Does anyone know what this is? It seems to us, that if the font is
available to CSS (depending on if the browser supports CORS for fonts), it
should be fine to call measureText.

1:
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-measuretext
2: http://www.w3.org/TR/2dcontext/#dom-context-2d-measuretext


More information about the whatwg mailing list