how do you change colors on these new font types?
how do you change colors on these new font types?
Posted Aug 29, 2013 14:50 UTC (Thu) by lambda (subscriber, #40735)In reply to: how do you change colors on these new font types? by dlang
Parent article: Chromatic fonts are coming
Presumably, if you used Microsoft's proposal, tools could allow you to select between the different palettes that the font provides, or define your own entirely custom palette. For things like Emoji, you would probably only select between different palettes, as there would be way too many colors to make customizing it practical. But for the use case that's now filled by layering two or three fonts, manually specifying your own palette would be the way to go.
The other proposals don't seem as well tailored to that approach. I suppose the SVG approach could give you some way to apply custom CSS, but that seems like even more complication. Font renderers are complicated enough; building a full SVG and CSS engine into them seems like massive overkill.
Posted Aug 30, 2013 3:50 UTC (Fri)
by roc (subscriber, #30627)
[Link] (2 responses)
Posted Aug 30, 2013 5:15 UTC (Fri)
by lambda (subscriber, #40735)
[Link] (1 responses)
Yes, but on most platforms those are provided by a browser engine. Which generally depends on the font rendering layer. Which would then need to depend on a browser engine. Which gives you a nice circular dependency.
For web browsers, it's obviously not a problem, but there are lots of things which use fonts which may not want to add a full browser engine as a dependency. I know there's librsvg, but you still wind up with the circular dependency problem there (it depends on Pango, which depends on FreeType, which would need to depend on librsvg or something of the sort), and you would have to deal with all of the librsvg rendering bugs.
In fact, how do you get around the circular dependency problem that SVG can include text which requires font rendering to work? What if you want to render a font which uses SVG glyphs within an SVG glyph? Of course that's on top of all of the other subsetting problems; do you require full SVG, or some subset? The existing proposal refers to "secure animated mode" and "secure static mode" of the SVG Integration spec, but those still seem to require that a DOM is constructed and accessible from clients, which doesn't seem like a feature that font glyphs generally have, and of course they also require font rendering as well.
Furthermore, on some platforms (*cough*Windows*cough*), font rendering is apparently done in the kernel. Adding big extra blob of code to implement XML parsing, CSS parsing, and SVG rendering (including filter effects and everything else you can do in SVG) in the kernel seems like a non-starter. I can imagine why Microsoft would make the proposal that they did; it's the simplest possible way to achieve what they want, without introducing too much new, untrusted code. And for font rendering, I think that's a good thing.
In fact, I wonder if it wouldn't be a good idea, instead of embedding SVG (as in the Adobe/Mozilla proposal) or PNG (as in Apple's implementation) within the font itself, to just define a CSS glyph mapping feature, that would map glyphs (or characters) to any element you want, which could be an <svg> element, an <img>, a <video>, a <canvas>, or what have you, covering all of the possible use cases. Obviously, this would only apply in a web browser or something that already used an embedded a web browser to render text, but as far as I can tell, that seems to already be a dependency for this proposal to work anyhow.
Posted Aug 30, 2013 9:39 UTC (Fri)
by roc (subscriber, #30627)
[Link]
I imagine that if Microsoft were to implement this proposal they would use a similar approach to call out to user space to render glyphs. (If they're still rasterizing text in the kernel ... that never made any sense to me.)
In the secure subsets of SVG used for glyphs, we prevent the glyphs document from triggering its own external resource loads. E.g. a glyphs document can't use an HTTP URL to load some other resource. There is therefore no way for a glyph to refer to its own font or otherwise create a real cyclic dependency.
There is no requirement that the DOM of SVG glyphs be exposed to clients of the font. You don't necessarily need to even construct or retain a DOM.
how do you change colors on these new font types?
how do you change colors on these new font types?
how do you change colors on these new font types?