I've been looking around to see how stretching of characters is handled in other typesetting systems. I stumbled across this article about how Mozilla handles this: http://www.mozilla.org/projects/mathml/fonts/encoding/ They compose a single stretchy character (e.g a right curly brack { ) from a number of glyph components. They have a mapping table that maps characters to glyphs in specialized fonts and then they stack these glyphs vertically as appropriate. Is this possible in WebKit's internals today? The end effect for Mozilla is that they have nice stretchy characters for Mathematics. The consequence is that you need to have the right fonts or it just doesn't work. -- --Alex Milowski "The excellence of grammar as a guide is proportional to the paucity of the inflexions, i.e. to the degree of analysis effected by the language considered." Bertrand Russell in a footnote of Principles of Mathematics
Hi Alex, AFAIK, the approach of stacking special characters goes back to TeX, and you even have special Unicode code points for this purpose (see http://www.unicode.org/charts/PDF/U2300.pdf), so the approach at least has broad consensus. ^_- You're right however, that having the right font glyphs is essential. Furthermore, e.g. TeX's MetaFont has several glyphs for the same bracket part in different point sizes to absolutely get the layout and optical weight right. The difference this makes is most noticeable on the parts that make up a (square,etc.) root symbol. However, since these are still only a handful of code points, I wonder if it wouldn't be safer to have a special font consisting of only those glyphs linked with WebKit directly, so you can be sure that they are available. Cheers, Roland On Wed, Sep 9, 2009 at 9:08 AM, Alex Milowski <alex@milowski.org> wrote:
I've been looking around to see how stretching of characters is handled in other typesetting systems. I stumbled across this article about how Mozilla handles this:
http://www.mozilla.org/projects/mathml/fonts/encoding/
They compose a single stretchy character (e.g a right curly brack { ) from a number of glyph components. They have a mapping table that maps characters to glyphs in specialized fonts and then they stack these glyphs vertically as appropriate.
Is this possible in WebKit's internals today?
The end effect for Mozilla is that they have nice stretchy characters for Mathematics. The consequence is that you need to have the right fonts or it just doesn't work.
-- --Alex Milowski "The excellence of grammar as a guide is proportional to the paucity of the inflexions, i.e. to the degree of analysis effected by the language considered."
Bertrand Russell in a footnote of Principles of Mathematics _______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
On Tue, Sep 8, 2009 at 10:17 PM, Roland Steiner<rolandsteiner@google.com> wrote:
Hi Alex,
AFAIK, the approach of stacking special characters goes back to TeX, and you even have special Unicode code points for this purpose (see http://www.unicode.org/charts/PDF/U2300.pdf), so the approach at least has broad consensus. ^_-
You're right however, that having the right font glyphs is essential. Furthermore, e.g. TeX's MetaFont has several glyphs for the same bracket part in different point sizes to absolutely get the layout and optical weight right. The difference this makes is most noticeable on the parts that make up a (square,etc.) root symbol.
Thanks for the pointer. I've been able to make a mockup of the use of these code points. I should now be able to stack a set of glyphs for certain symbols that can stretch. I've attached the mock-up if you are interested.
However, since these are still only a handful of code points, I wonder if it wouldn't be safer to have a special font consisting of only those glyphs linked with WebKit directly, so you can be sure that they are available.
The 'Symbol' font on the Mac actually handles the stackable glyphs quite nicely. I'll have to test on other platforms. The STIX fonts (beta version) that I have seem to have some problems. I'll have to see what kind of metrics I can get about certain characters because I suspect the vertical adjustments for the start and end of the stack are different depending on the font used. Is there a precedence for packaging a font with WebKit? -- --Alex Milowski "The excellence of grammar as a guide is proportional to the paucity of the inflexions, i.e. to the degree of analysis effected by the language considered." Bertrand Russell in a footnote of Principles of Mathematics
participants (2)
-
Alex Milowski
-
Roland Steiner