• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. Text > Whitespace and Text

Whitespace and Text

You may change the way that SVG handles whitespace (blanks, tabs, and newline characters) within text by changing the value of the xml:space attribute. If you specify a value of default (which, coincidentally, is the default value), SVG will handle whitespace as follows:

  • Remove all newline characters

  • Change all tabs to blanks

  • Remove all leading and trailing blanks

  • Change any run of intermediate blanks to a single blank

Thus, this string, where \t represents a tab and \n represents a newline, and an underscore represents a blank, this text:

   \n\n___abc_\t\t_def_\n\n__ghi

will render as:

   abc_def_ghi

The other setting of xml:space is preserve. With this setting, SVG will simply convert all newline and tab characters to blanks, and then display the result, including leading and trailing blanks. the same text:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint