New TextStyle properties, and default text size unit problems

We just added the following properties to TextStyle:

  • VerticalAlignment
  • SizeUnit: the unit to be used for the Size property, expressed as a GraphicsUnit (World, Points, Millimeters, etc)

We changed the Alignment property to HorizontalAlignment.

There is a problem with SizeUnit. By default, we would like to use a SizeUnit that has a constant ratio with the coordinates used to express all graphics -- world coordinates. That SizeUnit is, you guessed, World. If you use World for SizeUnit, you are guaranteed that your text will have the same height in proportion to your grpahics, no matter what machine it is displayed on, and no matter how it is scaled.

But World coordinates, if not transformed, are equal to device coordiantes -- pixels. Expressing the Size of a TextStyle in terms of pixels is simply not intuitive. People are used to Points. We need to default to Points. Unfortunately, if you use Points for SizeUnit, your text may suddenly become too big or too small if you display on a screen with a different DPI. For example, this nice picture, from the Users Guide:

might suddenly look like this:

There is no such thing as a “device independent Points unit“ (though the Avalon team has no problem with a “device independent pixels“ oxymoron). The Points unit is fundamentally based on inches.

Suggestions?

No Comments