Configuring the Adjustments

Build 1501 on 14/Nov/2017  This topic last edited on: 28/Oct/2016, at 11:48

The allowed adjustments are configured in an .XML file. The file lives in a Miles 33 subfolder of the Windows Application Data folder and has a hard-coded name. Example full path of the .XML file is C:\Documents and Settings\johnc\Application Data\Miles 33\Miles 33 Fitting.xml for Windows and Users:username:Library:Preferences:Miles 33:Miles 33 Fitting.xml for Macintosh.

An example .XML file:

<changes>

  <expand>

    <change name="point size" class="6915" max_percent="8" order="1" />

    <change name="space before" class="6950" para="1" max_absolute="2" order="2" />

    <change name="space after" class="6951" para="1" max_absolute="2" order="2" />

  </expand>

  <shrink>

    <change name="point size" class="6915" max_percent="8" />

    <change name="space before" class="6950" para="1" max_percent="20" order="2" />

    <change name="space after" class="6951" para="1" max_percent="20" order="2" />

  </shrink>

</changes>

The names are not used in the code, but may make the file easier to understand.

The class numbers are magic numbers from the API – see TextAttrID.h. Note that kTextAttrPrefix = 0x1B00 = 6912. These numbers allow the adjustments code to modify the text and paragraph attributes without knowing anything about typography.

The para tag allows the code to distinguish paragraph attributes from character attributes. The default for para is zero, meaning not a paragraph attribute.

The max_percent figure is the maximum allowed percentage change – in the first example here, the point size can be increased by up to 8%. The default is zero.

The max_absolute figure is the maximum allowed change in a numeric or distance attribute. If the attribute is a distance, then this is a number of points. In the example here, the space before and after each paragraph can be expanded by up to 2 points. The default is zero.

The order figure groups the adjustments into sets. All the adjustments with order equal to 1 will be made before any of the adjustments with “order” equal to 2; and so on. In this example, the point size will be expanded by up to 8% and only then will it start to expand the paragraph space. The default is 1.