I've just committed the first part of my text layout rewrite. The patch got a little excessively large so there's bound to be breakage somewhere (probably a lot of places). If you assign any bug that looks to be my fault to me (cyreve) that would be helpful.
It's a little sparse at the moment, but I'm hoping to ramp up the features fairly quickly now I've got a decent base to work on.
Known regressions:
1) Things go wrong if you delete a line break and then add one in the same place. I know exactly what I need to fix.
2) Linespacing was implemented as a custom attribute on the <tspan> fields. I want to move this into the css before I enable it (it's neater if everything is in SPStyle) but will, of course, retain backward compatibility with old files.
3) Likewise justification on <flowtext> (although I don't imagine anybody's seriously using this currently).
4) flowtext editing on the canvas didn't work very well before, and it still doesn't work very well.
5) I think vertical text is probably broken. It's been a while since I tried it. The old implementation was actually wrong according to the css spec, because the latin glyphs should have been rotated 90 degrees by default.
New stuff that works now:
1) share/examples/flowsample.svg renders the rtl portions correctly
2) Up/down movement in text goes straight up and down, rather than going to the same character index in the line above. Also, it doesn't jump from one side of the gap in flowsample.svg to the other. It still drifts a bit over repeated up/down because I've left some compatibility layers in.
3) Insertion and deletion of text with styles should keep the XML tree a bit cleaner than before.
4) Um...I made the cursor go italic when you're over italic text (well I thought it was cool). This doesn't work for Bitstream Vera because oddly enough they didn't specify the angle of the italic text in the font file.
New stuff that will work in the short to medium term:
1) Editing <flowtext>
2) Line spacing, full justification and whatever other 'easy' css properties I can find
3) Text selection, maybe a text toolbar too if I can persuade Bulia to write it for me :-)
New stuff that will work eventually:
1) Moderately complete css3 Text functionality
2) Anything else that I dream up along the way
That's it I think. Now I just wait for the bug reports to fly in.
Richard.
Compile warnings:
sp-text.cpp: In function `void sp_text_set_shape(SPText*)': sp-text.cpp:605: warning: missing initializer for member `SPSVGLength::unit' sp-text.cpp:605: warning: missing initializer for member `SPSVGLength::value' sp-text.cpp:605: warning: missing initializer for member `SPSVGLength::computed'
More:
libnrtype/Layout-TNG-Compute.cpp: In copy constructor `Inkscape::Text::Layout::Calculator::PangoGlyphStringAutoPtr::PangoGlyphStringAutoPtr(const Inkscape::Text::Layout::Calculator::PangoGlyphStringAutoPtr&)': libnrtype/Layout-TNG-Compute.cpp:115: warning: base class `class std::auto_ptr<PangoGlyphString>' should be explicitly initialized in the copy constructor libnrtype/Layout-TNG-Compute.cpp: In member function `bool Inkscape::Text::Layout::Calculator::Calculate()': libnrtype/Layout-TNG-Compute.cpp:1177: warning: missing initializer for member `Inkscape::Text::Layout::Character::x' libnrtype/Layout-TNG-Compute.cpp:1177: warning: missing initializer for member `Inkscape::Text::Layout::Character::char_attributes' libnrtype/Layout-TNG-Compute.cpp:1177: warning: missing initializer for member `Inkscape::Text::Layout::Character::in_glyph'
libnrtype/Layout-TNG-OutIter.cpp: In member function `Inkscape::Text::Layout::iterator Inkscape::Text::Layout::getNearestCursorPositionTo(double, double) const': libnrtype/Layout-TNG-OutIter.cpp:57: warning: 'bestT' might be used uninitialized in this function
In Layout-TNG.h I had to include additionally nr-matrix-ops.h to compile.
And you forgot to add the new files to libnrtype/Makefile_insert. That broke Linux compilation. I fixed it.
This is re: compilation, running it is a topic for another message :)
Running it:
There's lot of debug output. Can you switch it off before compiling? Is there a single place to turn it off?
Kerning by Alt+arrows does not work (though letterspacing by Alt+>< works). Old files with kerning don't work too. Hmm, in share/examples/text-on-path.svg, old kerning is seen (maybe because it's text on path?) but in the attached file it's not.
Same for linespacing (Ctrl+Alt+><), and old files with linespacing (e.g. tutorials) lost it too.
share/examples/flowsample works (without justification) but flow-go.svg is broken (missing text)
Ad for the good news, this bug is fixed:
http://sourceforge.net/tracker/index.php?func=detail&aid=1077374&gro...
However in RTL text, cursor movement is still logical, not visual, as explained in 3. here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1093660&gro...
I could not test 1. and 2. because I cannot type RTL chars, but I guess the situation there is mostly the same. Do you think you can address that?
I haven't looked much into code yet but from what I saw, it's well documented and seems much more understandable than the old one. Overall, a huge achievement, thanks a lot!
Also PS output of text is broken: Save as EPS a file with text, without converting to paths; all letters become huge.
And you forgot to add the new files to libnrtype/Makefile_insert. That broke Linux compilation. I fixed it.
This is re: compilation, running it is a topic for another message :)
If this is about compilation... it won't build on Win32 at all (just updated my CVS 5 mins ago). I did a make clean, and it still didn't help. Here is what I get that is out of the ordinary from the console.
In file included from sp-text.h:28, from sp-tspan.h:70, from desktop-style.cpp:21: libnrtype/Layout-TNG.h:1267: error: declaration of `operator()' as non-function libnrtype/Layout-TNG.h:1267: error: expected `;' before '(' token libnrtype/Layout-TNG.h:1271: error: expected `;' before '}' token libnrtype/Layout-TNG.h: In member function `unsigned int Inkscape::Text::Layout: :_lineToSpan(unsigned int) const': libnrtype/Layout-TNG.h:1287: error: `PredicateLineToSpan' undeclared (first use this function) libnrtype/Layout-TNG.h:1287: error: (Each undeclared identifier is reported only once for each function it appears in.) libnrtype/Layout-TNG.h: In member function `unsigned int Inkscape::Text::Layout: :_lineToCharacter(unsigned int) const': libnrtype/Layout-TNG.h:1291: error: `PredicateLineToCharacter' undeclared (first use this function) libnrtype/Layout-TNG.h: In member function `unsigned int Inkscape::Text::Layout: :_spanToCharacter(unsigned int) const': libnrtype/Layout-TNG.h:1295: error: `PredicateSpanToCharacter' undeclared (first use this function) libnrtype/Layout-TNG.h: In member function `unsigned int Inkscape::Text::Layout: :_sourceToCharacter(unsigned int) const': libnrtype/Layout-TNG.h:1299: error: `PredicateSourceToCharacter' undeclared (fir st use this function) make[1]: *** [desktop-style.o] Error 1 make[1]: Leaving directory `C:/cvs/inkscape/inkscape/src' make: *** [dist] Error 2
-Josh
participants (3)
-
bulia byak
-
Joshua A. Andler
-
Richard Hughes