i will reuse a lot of it for flowtext stuff, that's a given. the purpose of the SPTypeset object, though, was to be a testbed for flowtext stuff, and an object to which you would give marked-up text like LaTeX source or RTF and get a nice layout of it. this last part is a huge amount of work... i advise for a removal for simplification of the codebase, and to avoid confusions with SVG flowtext.
OK, that makes sense.
that is also a big amount of work, unless some parts of it can be lifted from a preexisting text editor. i feel sorry for the guy who will have to do it.
It's not really that bad, imho. I thought about how to do it, and I'm definitely willing to give it a try when I have more free time. Just a child of text-context holding the start and end character positions of the selection in the text object, and a list of canvas items, each being an inversion rectangle overlaying one character. The tricky part is how to make it so that when you choose a color (by whatever means) it gets applied to the text selection instead of the entire selected text object, but there is now a solution for that: desktop issues _style_signal for any style change, and the text selection would intercept that signal and apply the style to the text selection (creating tspan(s) as needed); and when the signal is intercepted, the style is not applied to the selected objects (see sp_desktop_set_style in desktop.cpp). So it's doable.
wrt mathematical markup, i was more thinking to stuff like indices/exponents: dx/dy give you the possibility to do either exponent or indices, not both. Not to mention the cases where you want the text to be stacked below some other piece of text. this is where latex shines. the simplest solution is probably to do some sort of "Equation Service" (http://www.esm.psu.edu/mac-tex/EquationService/) with the scripting possibilities of inkscape, and insert the complex stuff as images in the flowtext.
Yes, it would be cool. Just build a robust chain of tools to do TeX -> PS -> SVG conversion, and automatically run it and import into a <g> with an inkscape: attribute storing the source TeX code, with a command to edit it. Worth an RFE, and would not be very difficult to implement. Except that such "embedded TeX" will not be able to be part of an SVG text object, but only an independent object.
the problem on osx is having several trees with unix software cohabitating with each other. since i have a fink tree with all my gnome stuff, installing gtkmm2.4 and friends requires me to either package it myself (no thanks) or to mess with the install and header search paths (my previous attempts were complete failures). in any case it's simpler and safer to just wait for fink to get up to date.
I really hope they will get up to date soon. We need you :)
regarding my flowtext work, here is a patch made against the 0.39 release.
Thanks, I will apply it ASAP.
flowtref, flowlinebreak and flowimage are missing, but it's already able to eat styled text and handle bidirectionality. it would be good for me if someone could put it in the CVS tree and give it some exercise, so that bugs get apparent. since flowtext has the same text/tspan structure, parts of this patch can also have some use for the current text implementation.
Great, I will test it and report what I find.
Errors when compiling your patch:
sp-flowdiv.cpp: In member function `void SPFlowdiv::CollectFlow(flow_src*)': sp-flowdiv.cpp:589: error: invalid conversion from `const char*' to `gchar*' sp-flowdiv.cpp:608: error: invalid conversion from `const char*' to `gchar*' sp-flowdiv.cpp: In member function `void SPFlowtspan::CollectFlow(flow_src*)': sp-flowdiv.cpp:663: error: invalid conversion from `const char*' to `gchar*' sp-flowdiv.cpp:682: error: invalid conversion from `const char*' to `gchar*' sp-flowdiv.cpp: In member function `void SPFlowpara::CollectFlow(flow_src*)': sp-flowdiv.cpp:735: error: invalid conversion from `const char*' to `gchar*' sp-flowdiv.cpp:754: error: invalid conversion from `const char*' to `gchar*'
(fixed these by declaring kern_val as const char*, 3 times)
libnrtype/FlowUtils.cpp:89: error: return-statement with no value, in function declared with a non-void return type
(fixed by changing it to return 0)
After that it compiled. I will now try to test it. If you have any sample flowtext svgs, could you please forward?
It works :) Well, just barely at the moment, but still. It will be so exciting to have this implemented before Adobe and others :)
Attached is a sample that I tried, taken from the SVG spec (compare http://www.w3.org/TR/SVG12/#textflow-example). Problems:
- the lines overrun the right edge
- multiple spaces are not normalized (indent before "And") even though there's no xml:space="preserve"
- only lowercase tag names work; I have to change textDiv to textdiv etc, otherwise it did not work
- the textflow object has no bbox and thus no handles when selected, and behaves weirdly when dragged
- it also has no description (in the statusbar)
- there's no way to edit either the shape or text (typeset did this, although it did not reflow)
Also, what will it take to implement textPath? Your typeset code had this, so it should not be too difficult to change to standard SVG. Also it's part of SVG 1.1, so it makes more sense to implement it first before the 1.2 stuff (which may still change before the spec is finalized).
Very cool, although it's not working for me - is there something special you need to do to get it to work? Do I need a certain font?
Bryce
On Fri, 30 Jul 2004, bulia byak wrote:
It works :) Well, just barely at the moment, but still. It will be so exciting to have this implemented before Adobe and others :)
Attached is a sample that I tried, taken from the SVG spec (compare http://www.w3.org/TR/SVG12/#textflow-example). Problems:
the lines overrun the right edge
multiple spaces are not normalized (indent before "And") even though
there's no xml:space="preserve"
- only lowercase tag names work; I have to change textDiv to textdiv
etc, otherwise it did not work
- the textflow object has no bbox and thus no handles when selected,
and behaves weirdly when dragged
it also has no description (in the statusbar)
there's no way to edit either the shape or text (typeset did this,
although it did not reflow)
Also, what will it take to implement textPath? Your typeset code had this, so it should not be too difficult to change to standard SVG. Also it's part of SVG 1.1, so it makes more sense to implement it first before the 1.2 stuff (which may still change before the spec is finalized).
This SF.Net email is sponsored by OSTG. Have you noticed the changes on Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now, one more big change to announce. We are now OSTG- Open Source Technology Group. Come see the changes on the new OSTG site. www.ostg.com _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
participants (2)
-
Bryce Harrington
-
bulia byak