How to underline text in Inkscape

Using Inkscape’s latest official release, I created a text element, and would like to underline its text (or part of it).

How to do that?
I don’t see any option to underline.

Answer

Update: since Inkscape 1.0.1 use Selector and CSS dialog

As stated by davidvandebunte, Inkscape 1.0.1 introduced in the the Object menu the Selectors and CSS dialog (that was previously experimental), the shortcut is ShiftCtrlQ.

Selectors and CSS dialog

The dialog allows to edit the CSS properties of the selected item, and is possible to add new properties by clicking the + button near the CSS selector definition:

+ button

A drop-down menu helps to insert the properties. In this specific case we need to add the property text-decoration with the value underline.

At the moment there is no help in the insertion of the value, so pay attention to what you write.

The result is immediately visible:
The underlined text

For previous versions of Inkscape use the XML Editor

SVG standard supports text decoration and Inkscape aims to be fully compliant with SVG standard, so I’ve tried to add this properties at xml level, and it worked:

text-decoration: underline;

It’s very simple to do: after typing your text, press the button for the XML editor (Edit → XML Editor for Inkscape 1.x):

XML editor

Your text is selected, and the corresponding XML node is selected in the editor (there is no need to find something). Now, you need to click on “style” row, add the desired CSS style at the end of the current style, (e.g. text-decoration: underline;), using a semicolon “;” as separator, and press the Set button:

Set your change

Once the attribute value is set, you see your text underlined:

Underlined text

Be aware that in order to remove the underline you need to find it in the XML attribute value and delete it manually (it’s not difficult).

Attribution
Source : Link , Question Author : Nicolas Raoul , Answer Author : Paolo Gibellini

Leave a Comment