Formatting Text

Updated for v0.48.

Text in text objects can be formatted. This section covers changing the font, style, size, justification, letter/word/line spacing, kerning, and orientation. Specifying the fill (color, pattern, etc.) of text is covered in Chapter 10, Attributes.

There are three methods to format text. The first is to use the items in the Text Tool-Tool Controls, the second is to use keyboard shortcuts, and the third is to use the Text and Font dialog (Text icon Text and Font... (Shift+Ctrl+T)). The Tool Controls received a major upgrade in v0.48 of Inkscape.

The Text Tool-Tool Controls, v0.47.
The Text Tool-Tool Controls, v0.47.
The Text Tool-Tool Controls.
The Text Tool-Tool Controls, v0.48.

When changing properties of text, if characters within a text object are selected, the changes apply only to those characters. Otherwise, the changes apply to all selected text objects (to select more than one text object, switch temporarily to the Select Tool). Changes made when no text object is selected (or a new blank text object is created) change the default style. The default style can also be set with the Set as Default button in the Text and Font dialog.

Font Family

The Font Family can be changed via the Tool Controls or the Font tab of the Text and Font dialog. The two methods behave slightly different.

Via Tool Controls The leftmost drop-down menu selects the font family. When activated, the menu shows samples of the various fonts available to Inkscape. This can be disabled in v0.48 in the Text section of the Inkscape Preferences dialog if the rendering of the samples takes too much time when starting Inkscape (which can happen if you have a large number of fonts installed on your system). The text used for the sample can be customized by editing your preferences.xml file. Use Alt+X to access the menu directly. Once accessed, Alt+Down arrow will open the drop-down list, Up arrow and Down arrow move up and down the list as does using the scroll wheel, and Enter sets the family. Typing into the font entry box will open a list of all fonts that start with the characters typed. New in v0.48: A warning icon will be displayed if the selected font is not available to Inkscape.

Text and Font dialog:  The font family can be chosen from a list of all possible font families available to Inkscape on your system. The font is previewed with the text in the bottom of the dialog. Changes are not made to the drawing until the Apply button is clicked.

Font Size

The Font Size can be changed via the Tool Controls or the Text and Font dialog. In both cases, the font size (in pixels) can be selected from a drop-down menu. To select a size that is not in the menu, simply type the number in. The change takes effect upon selection or hitting Enter in the case of the Tool Controls and upon clicking Apply in the case of the Text and Font dialog.

Font Style

SVG directly supports Bold and Italic/Oblique styles.[12] You can toggle on and off these styles (if the font family supports them) by clicking the corresponding buttons in the Tool Controls or with keyboard shortcuts:

  • icon (Ctrl+B) Toggle Bold on/off.

  • icon (Ctrl+I) Toggle Italics on/off.

A font may have other styles available (e.g. narrow, semi-bold). All possible styles (including Bold, and Italic/Oblique) can be selected in the Style section of the Text and Font dialog.

Justification

Text can be justified (aligned) by clicking on the appropriate icons in either the Tool Controls or the Text and Font dialog. The Apply button must be clicked for the change to take place in the latter case.

  • icon Align left.

  • icon Center.

  • icon Align right.

  • icon Justify (left and right justified).

Left, center, and right justified text.
Left, center, and right aligned text; left and right justified text.
[Note]Note

Only flowed text can be both left and right justified at the same time.

Superscripts and Subscripts

New in v0.48.

Superscripts and subscripts can be created by selecting text and clicking on the corresponding icons ( icon , icon ) in the Tool Controls. The selected text will be shifted up or down and reduced in size. Superscripts and subscripts can be removed by selecting and then clicking on the same icons. Inkscape implements superscripts and subscripts by setting the baseline-shift attribute to either super or sub, and by setting the font-size attribute to 65%. Inkscape will only recognize a superscript or subscript if the baseline-shift attribute is set in this manner. The font size can be changed after the superscript or subscript is created. The baseline-shift attribute is not supported by all browsers (e.g. Firefox 4). As a workaround, one can manually shift the text vertically.

Line Spacing

Line spacing (the distance between text baselines) applies to an entire text object. Note that although Inkscape uses the attribute line-spacing to store the line spacing value, it is not part of the SVG standard (it is, however, part of the CSS standard). Inkscape uses the value to position lines of text. The positions are stored in the SVG file and are used by SVG renderers to place the text.

Line spacing can be changed by the Line spacing entry boxes in both the Tool Controls ( icon ) (new in v0.48) and in the Text and Font dialog. It can also be changed by the following keyboard shortcuts (note adjustments are specified in Screen pixels and thus depend on the zoom level):

  • Ctrl+Alt+>: Make text object one Screen pixel taller.

  • Ctrl+Alt+<: Make text object one Screen pixel shorter.

  • Shift+Ctrl+Alt+>: Make text object ten Screen pixels taller.

  • Shift+Ctrl+Alt+<: Make text object ten Screen pixels shorter.

Word Spacing

New in v0.48.

Word spacing can be changed via an entry box in the Tool Controls ( icon ). Changes apply to selected text if text is selected or to the entire text block if not.

Letter Spacing

Letter spacing can be changed via an entry box in the Tool Controls ( icon ) (New in v0.48) or by keyboard shortcuts. Changes apply to selected text if text is selected or the entire text block if not. Note that the keyboard shortcuts are defined in terms of Screen pixels and thus depend on the zoom level. Also note that if some text already has letter spacing applied to it, the letter spacing of that text will not be changed if the text cursor is elsewhere.

  • Alt+>: Expand line (paragraph) or selected text by one Screen pixel.

  • Alt+<: Contract line (paragraph) or selected text by one Screen pixel.

  • Shift+Alt+>: Expand line (paragraph) or selected text by ten Screen pixels.

  • Shift+Alt+<: Contract line (paragraph) or selected text by ten Screen pixels.

Kerning, Shifting, and Rotating Characters

Individual characters in a line of regular (but not flowed) text may be shifted left or right to change their kerning, shifted up or down, or rotated. (Both regular and flowed text do utilize the internal kerning that is included with fonts.)

Text showing individual character manipulation.
Text showing individual character manipulation.

All manual kerning/shifts/rotations can be removed with the Text icon Remove Manual Kerns command.

Kerning and Shifting

Changing the kerning and shifting characters up and down are treated the same in Inkscape. If no characters are selected, all the characters following the cursor are shifted. If some characters are selected, only the selected characters are shifted. Shifts can be made through the Tool Controls ( icon , icon ) (New in v0.48) or through keyboard shortcuts. Note that shifts via the Tool Controls are in pixels while shifts via the keyboard are in Screen pixels, thus, in the latter case, the zoom level will affect the magnitude of the shift.

  • Alt+Arrows Key: Shift character(s) by one Screen pixel in arrow direction.

  • Shift+Alt+Arrows Key: Shift character(s) by ten Screen pixels in arrow direction.

Rotating

If no characters are selected, only the character following the text cursor will be rotated. If characters are selected, all the selected characters will be rotated. Rotations can be made through the Tool Controls ( icon ) (New in v0.48) or through keyboard shortcuts. Note that rotations via the Tool Controls are in degrees while some via the keyboard are in Screen pixels, thus, in the latter case, the zoom level will affect the magnitude of the rotation.

  • Alt+[, Alt+]: Rotate character(s) counterclockwise, clockwise by one Screen pixel.

  • Ctrl+[, Ctrl+]: Rotate character(s) counterclockwise, clockwise by 90 degrees.

Orientation

The orientation of the text can be chosen by clicking on one of the following icons:

  • icon Horizontal text.

  • icon Vertical text.

Horizontal, vertical, and rotated text.
Horizontal (left), vertical (center), and rotated (right) text.

The vertical choice is mostly applicable to languages written from top to bottom and from right to left, such as Chinese, Japanese, or Korean. See the above figure to see the difference between vertical text and text rotated by 90 degrees. A block of text can only have one orientation.



[12] An Oblique font is usually a regular font that has been skewed. A true Italic font has several characters (e.g., a and a) that have different designs.