Quoting Keith Packard <keithp@...579...>:
I'll read through the SVG spec and see whether this is always true; it may be that SVG allows applications to request text wrapping or embed newlines.
Newlines in SVG text are just whitespace; they don't introduce a new line:
http://www.w3.org/TR/SVG/text.html#WhiteSpace
However, SVG 1.2 introduces flowing text and graphics, where text flowing/wrapping is performed according to a specified greedy algorithm.
http://www.w3.org/TR/SVG12/flow.html
Speaking for Inkscape, we're currently in the progress of implementing support for this in Inkscape, and we do use pango for what we can, but I'm fairly certain we ended up having to do line breaking/wrapping ourselves as the required algorithm is very different from what Pango wants to do.
(Admittedly, I'm not very personally involved with that part of the codebase these days so I might be off on some of the details; I'll CC the list in case anyone more familiar wants to correct me...)
-mental
On Tue, 2005-03-15 at 13:53 -0500, mental@...3... wrote:
Speaking for Inkscape, we're currently in the progress of implementing support for this in Inkscape, and we do use pango for what we can, but I'm fairly certain we ended up having to do line breaking/wrapping ourselves as the required algorithm is very different from what Pango wants to do.
It would be, of course, much appreciated if you communicated with us on the topic, and helped enhance Pango to meet your needs.
You aren't going to internationalization right on your own.
Owen
It would be, of course, much appreciated if you communicated with us on the topic, and helped enhance Pango to meet your needs.
You aren't going to internationalization right on your own.
I'm the one to blame for the latest rewrite of the text layout code. Off the top of my head, here are the reasons that Pango Layout was not a suitable solution for Inkscape. I may be mistaken about it's support for some of these items, but when starting out it became clear that Pango Layout did not support all of them.
1) Non-rectangular wrapping (<flowtext> element).
2) Custom kerning attributes on <tspan> elements (x, y, dx, dy and rotate).
3) Vertical text does not seem to be available (although I expect my implementation of this is broken at the moment; it usually is).
4) The SVG spec requires that glyphs are output in logical order, not visual order.
5) Hinting cannot be disabled (I didn't write that bit of the code, so haven't fully explored whether this is true).
6) The list of text styles available is too limited.
Having said that, Pango itself is truly excellent and you are absolutely right that I could not have got anywhere near where I am now without it.
I believe that there is a place for a library supporting advanced text applications, but that Pango Layout is not it. The overhead is really quite large and seems unnecessary for an API whose primary goal is laying out text in widgets.
I look forward to continuing this discussion.
Richard.
On Wed, Mar 16, 2005 at 12:27:32AM +0000, Richard Hughes wrote:
- Non-rectangular wrapping (<flowtext> element).
Richard is referring to http://www.w3.org/TR/2004/WD-SVG12-20041027/flow.html. The name `flowText' is actually from an older draft, but people still tend to use that word when discussing the facility.
Inkscape may well also implement
- The SVG spec requires that glyphs are output in logical order, not
visual order.
Richard is referring to http://www.w3.org/TR/SVG11/text.html#TextRenderingOrder
Richard speculates that this is probably so that z-order is correct for glyphs that overlap each other due to thick stroking or over-tight kerning/tracking.
(My initial suggestion was that it may be to facilitate conversion from e.g. postscript to text.)
I believe that there is a place for a library supporting advanced text applications, but that Pango Layout is not it. The overhead is really quite large and seems unnecessary for an API whose primary goal is laying out text in widgets.
Owen, can you comment on what you see as pango's scope? Are you interested in non-rectangular text regions? Are you interested in non-greedy line breaking? (I'd guess that non-greedy line breaking would be desirable even for dialog boxes, at least from a functional point of view; the only question is whether it justifies the cost in terms of maintainability of pango code and perhaps code size.)
pjrm.
participants (4)
-
unknown@example.com
-
Owen Taylor
-
Peter Moulder
-
Richard Hughes