Thursday, January 26, 2006

Justification Codes for Text and Symbols

The GTViewer data format supports justified display for both Text and Symbol elements. This functionality is sometime confusing because of the number of codes used to specify the justification instructions. This posting will help clarify these different codes.

  • 0 – Default (Bottom Left)
  • 1 to 99 – Ignored, same as default (Bottom Left)
  • 100 – Bottom/Left
  • 101 – Center/Left
  • 102 – Top/Left
  • 103 – Bottom/Center
  • 104 – Center/Center
  • 105 – Top/Center
  • 106 – Bottom/Right
  • 107 – Center/Right
  • 108 – Top/Right
  • 163 – Bottom/Left
  • 165 – Bottom/Center
  • 167 – Bottom/Right
  • 171 – Base/Left
  • 173 – Base/Center
  • 175 – Base/Right
  • 181 – Center/Left
  • 183 – Center/Center
  • 185 – Center/Right
  • 201 – Top/Center
  • 203 - Top/Center
  • 205 – Top/Right
The following diagram will show how codes 100 through 108 will affect a text element. The Red Circle is the Origin for the text element when draw for each of the justification codes:

The codes 163 through 205 are similar to the 100 through 108 series. The difference is that these value correspond to the Smallworld justification codes (plus 150). There is also the addition of the Base Line justifications (171,172,173) that adjust the origin to 1/3 from the bottom of the text box.

For Text Elements, the justification can be specified as part of the element or as a Style Rule. For Symbol Elements, the justification is always specified with a style rule.

No comments: