It's not possible to pass a text selection to the extension system ( i.e: text that you have highlighted using the mouse ). Just the parent text object.
I checked in chat.
You can of course wrap any text you like in a <tspan> then style the tspan.
I don't have much experience with svg text. So I can't really advise on kerning etc.
Don't forget that you can always use xpath to examine text elements and tspans etc.
I’m generating flow text,
on a single line, is a style around an arbitrary text selection possible?
can I change letter_spacing on a single phrase in a line?
It's not possible to pass a text selection to the extension system ( i.e: text that you have highlighted using the mouse ). Just the parent text object.
I checked in chat.
You can of course wrap any text you like in a <tspan> then style the tspan.
I don't have much experience with svg text. So I can't really advise on kerning etc.
Don't forget that you can always use xpath to examine text elements and tspans etc.
I didn’t know about <tspan>, I will dig into that. Thanks for those tips.
I didn’t know about <tspan>, I will dig into that. Thanks for those tips.
When I get stuck I sometimes have the .svg file open in Geany, or Notepad++.
Change something then save. Then look at the changes in the .svg.
I think flowed text makes extensive use of <tspan>.
I also wrote an extension - which I did not post on inkscape.org, because I didn't like it - https://gitlab.com/inklinea/textractor
Code sample to get you started:
Thanks for that code example -- very helpful for hacking.
Is there a newline command?
I've been working with Flowtext, but it's overkill for what I need.
I'm a little confused about how I'm even successfully doing newlines there.
Not as such. Instead, you pass coordinates to
inkex.Tspan
as follows:That is, you append
Tspan
s to aText
object for both style changes and line breaks.Ok! Thank you for that clarification.