Text formatting

This page was automatically translated. Stay tuned for a human translation…​

<Textblock> and <Text> contain one or more paragraphs (command <Paragraph>). The actual texts are encapsulated there within <Value>. There are numerous possibilities to influence the formatting of the texts. The switches for the font styles were introduced in Include Fonts. With a similar functionality there are the following commands:

<Sub> and <Sup>

Subscript and superscript text.

<Fontface>

Temporarily switches to a different font.

<Color>

Outputs the enclosed text in a different color.

<A>

Creates a hyperlink.

<HSpace>

Inserts an expandable blank space (with or without dots).

<U>

Underline.

<PlaceObject>
  <Textblock width="11">
    <Paragraph>
      <Value>Text</Value>
      <Sub><Value>sub</Value></Sub>
      <Value> </Value>
      <Sup><Value>sup</Value></Sup>
      <Value> </Value>
      <U><Value>underline</Value></U>
      <Value> </Value>
      <Color name="green"><Value>green</Value></Color>
      <Value> </Value>
      <A href="https://www.speedata.de">
        <Value>link to the homepage</Value>
      </A>
      <HSpace leader=" . "/>
      <Value>right margin.</Value>
    </Paragraph>
  </Textblock>
</PlaceObject>
textauszeichnungen
Various text markups

Enumeration lists

Instead of a paragraph, an enumeration list can also appear. This is specified with <Ol> or <Ul> for an ordered list and an unordered list. The individual points must be marked with <Li>.

<PlaceObject>
  <Textblock>
    <Ol>
      <Li><Value>One</Value></Li>
      <Li><Value>Two</Value></Li>
    </Ol>
    <Ul>
      <Li><Value>One</Value></Li>
      <Li><Value>Two</Value></Li>
    </Ul>
  </Textblock>
</PlaceObject>
olul
This feature is not really robust yet. The lists cannot (currently) be nested. It is recommended to check if the lists are output correctly.

Prevent text wrapping

Some headings and proper names should not be broken. There is a command <NoBreak> for this purpose, which suppresses wrapping in various ways. A somewhat exaggerated example is:

<PlaceObject>
  <Textblock width="10cm">
    <Paragraph>
      <Value>A wonderful serenity has taken possession </Value>
      <NoBreak><Value>of my entire soul, like these sweet mornings...</Value></NoBreak>
    </Paragraph>
  </Textblock>
</PlaceObject>
nobreak1
The default setting for NoBreak is that the part must be connected.

Alternatively, you can reduce the font size by specifying the maximum width or shorten the text with omission points.

<Textblock width="10cm">
  <Paragraph>
    <NoBreak maxwidth="10" reduce="cut" text="...">
      <Value>A wonderful serenity has taken possession of my entire soul, like these sweet mornings...</Value>
    </NoBreak>
  </Paragraph>
</Textblock>
nobreak2
Here the text is cut off and filled with the specified text.

Break URLs

The command <URL> is used to make it easier to break URLs. You may wrap mainly at slashes (/), in addition no hyphens are inserted. No hyperlink is created, the command <A> is responsible for this.

<Layout
  xmlns="urn:speedata.de:2009/publisher/en"
  xmlns:sd="urn:speedata:2009/publisher/functions/en">

  <SetGrid nx="40" ny="10"/>
  <Trace grid="yes"/>
  <Pageformat width="90mm" height="5cm"/>
  <Record element="data">
    <PlaceObject>
      <Textblock width="35">
        <Paragraph>
          <URL><Value>https://github.com/speedata/publisher/issues</Value></URL>
        </Paragraph>
      </Textblock>
    </PlaceObject>
  </Record>
</Layout>

results in

url

(See also https://github.com/speedata/publisher/issues/173)