<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lajujula</id>
	<title>Inkscape Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lajujula"/>
	<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/Special:Contributions/Lajujula"/>
	<updated>2026-04-25T10:48:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=TextRework&amp;diff=84860</id>
		<title>TextRework</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=TextRework&amp;diff=84860"/>
		<updated>2012-05-25T12:30:56Z</updated>

		<summary type="html">&lt;p&gt;Lajujula: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Proposal for restructuring how Inkscape handles text.=&lt;br /&gt;
&lt;br /&gt;
This is a work in progress...&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
&lt;br /&gt;
Inkscape currently handles all text layout using code written for the never-adopted &amp;quot;flowed-text&amp;quot; SVG1.2 spec. There are several problems with this code:&lt;br /&gt;
&lt;br /&gt;
* The code does not handle normal SVG text well.&lt;br /&gt;
* It is extremely complex. It mixes up line-breaking with layout code.&lt;br /&gt;
* Inkscape's &amp;quot;flowed-text&amp;quot; is not recognized by any other SVG renderer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Strategy ==&lt;br /&gt;
&lt;br /&gt;
The major goal is to reorganize the code to treat all text as normal SVG text. Three special cases would be indicated by inkscape namespace tags giving a total of four types of text:&lt;br /&gt;
&lt;br /&gt;
===Normal SVG text===&lt;br /&gt;
Standard SVG text with all properties (&amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;letter-spacing, etc.).&lt;br /&gt;
&lt;br /&gt;
The only special text manipulating provided by Inkscape would be that a carriage return would create&lt;br /&gt;
a new &amp;lt;tspan&amp;gt; starting directly below the first &amp;quot;y&amp;quot; value of the &amp;lt;text&amp;gt; object and a distance of&lt;br /&gt;
&amp;quot;line-spacing&amp;quot; below the &amp;lt;text&amp;gt; or &amp;lt;tspan&amp;gt; just before the carriage return (this should work for both right-to-left text and left-to-right text).&lt;br /&gt;
&lt;br /&gt;
One problem with the current Inkscape implementation is that text in a &amp;lt;text&amp;gt; object is&lt;br /&gt;
automatically moved to a &amp;lt;tspan&amp;gt;. This can cause problems with animated SVG's.&lt;br /&gt;
&lt;br /&gt;
A block of text should be contained in one &amp;lt;text&amp;gt; element. Multiple lines should be handled in &amp;lt;tspan&amp;gt;s. This allows multi-line text selection (for example, you may want to change an attribute on a string of text that spans parts of two lines).&lt;br /&gt;
&lt;br /&gt;
===Normal Inkscape text===&lt;br /&gt;
&lt;br /&gt;
Normal SVG text with the added property that lines are handled by Inkscape,&lt;br /&gt;
allowing insertion of new lines in the middle  This is equivalent to the current Inkscape&lt;br /&gt;
manipulation of text.&lt;br /&gt;
&lt;br /&gt;
New attributes:&lt;br /&gt;
&lt;br /&gt;
* inkscape:text-property=&amp;quot;manage_lines&amp;quot; :  Indicates type&lt;br /&gt;
* inkscape:text-role=&amp;quot;line&amp;quot; : Marks start of each new line (replaces sodipodi:role=&amp;quot;line&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
One routine would be responsible for manipulation of lines, outputting normal SVG which&lt;br /&gt;
would then be rendered by the normal SVG text routines.&lt;br /&gt;
&lt;br /&gt;
===Inkscape flowed text===&lt;br /&gt;
&lt;br /&gt;
Text where line-breaking would be handled by Inkscape to fit in a rectangle box,&lt;br /&gt;
equivalent to the current Inkscape flowed:text. &amp;quot;letter-spacing&amp;quot; and &amp;quot;word-spacing&amp;quot;&lt;br /&gt;
could be used to justify the text.&lt;br /&gt;
&lt;br /&gt;
Hyphenation, indentation, etc. could be added here. Note that SVG2 may add some CSS text properties that could be useful here.&lt;br /&gt;
&lt;br /&gt;
New attributes:&lt;br /&gt;
&lt;br /&gt;
* inkscape:text-property=&amp;quot;flowed_text&amp;quot;&lt;br /&gt;
* inkscape:text-align=&amp;quot;justify&amp;quot;&lt;br /&gt;
* inkscape:text-box=href(#xxx) or &amp;lt;inkscape:flowregion&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One routine would be responsible for line-breaking, outputting normal SVG which would then&lt;br /&gt;
be rendered by the normal SVG text routines. Line spacing is controlled only by the &amp;quot;line-spacing&amp;quot;&lt;br /&gt;
property.. This routine would be responsible for verifying new lines fit in the box.&lt;br /&gt;
&lt;br /&gt;
===Inkscape flowed into shape text===&lt;br /&gt;
&lt;br /&gt;
A more generalized case of normal Inkscape flowed text.&lt;br /&gt;
&lt;br /&gt;
Switching between the four modes would be possible, preserving the rendering of the text as&lt;br /&gt;
much as possible.&lt;br /&gt;
&lt;br /&gt;
Note: SVG2 will include text flow into arbitrary shapes using [http://dev.w3.org/csswg/css3-regions/ CSS Regions] and [http://dev.w3.org/csswg/css3-exclusions/ CSS Exlusions].&lt;br /&gt;
&lt;br /&gt;
== Implementation Steps ==&lt;br /&gt;
&lt;br /&gt;
# Write new routines to handle plain SVG text. Check that it works for all imported text.&lt;br /&gt;
# Switch &amp;quot;normal&amp;quot; Inkscape text (with lines handled by Inkscape) to use the new code.&lt;br /&gt;
# Rewrite line-breaking code to output standard SVG.&lt;br /&gt;
&lt;br /&gt;
== Alignment Issues ==&lt;br /&gt;
&lt;br /&gt;
Note that inkscape is not able to vertically align some text according to a given boundary (wether the text box or an explicitly selected shape)&lt;br /&gt;
It would be usefull to get such alignment features. Apple Pages does it &amp;quot;the right way&amp;quot;&lt;/div&gt;</summary>
		<author><name>Lajujula</name></author>
	</entry>
</feed>