1,295
edits
No edit summary |
No edit summary |
||
| Line 28: | Line 28: | ||
* Support referencing SVG Opentype Font elements from @font-face and the SVG 'font' attribute | * Support referencing SVG Opentype Font elements from @font-face and the SVG 'font' attribute | ||
* Add an API that takes a DOM reference to a font element and returns a [http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob Blob] for a binary OpenType font (SVG glyphs will be discarded) | * Add an API that takes a DOM reference to a font element and returns a [http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob Blob] for a binary OpenType font (SVG glyphs will be discarded) | ||
= Style Inheritance = | |||
The way SVG font glyphs inherit style from the text is both broken for authors and difficult to implement. | |||
An example of how it's broken for authors: if the author specifies 'stroke-width:2' on a piece of text where some characters are rendered with system font F and other characters are rendered with SVG font S, and the glyphs of S contain simple path shapes, then the glyphs of F get a stroke width of 2 user-space units, but the glyphs of S get a stroke width of 2 glyph-space units, which will typically be invisible. | |||
It's difficult to implement because Gecko (and Webkit, and probably other engines) keep persistent style data attached to DOM nodes, so having the style inherit differently depending on how the nodes are being used is inefficient and intrusive. | |||
A better design would be to specify new values for 'stroke', 'fill' and 'stroke-width' such as 'text-stroke', 'text-fill' and 'text-stroke-width' to be used in glyphs. These new values would automatically grab the stroke, fill and stroke-width from the text, rescaling them as necessary. | |||
edits