Index

D-Type Power Engine Units

Document Units

All PowerDoc image coordinates and many PowerDoc properties are expressed in logical units called document units. Document units are device and resolution independent and are used to measure or specify distances in Power Engine documents. Document units have no particular physical meaning and their interpretation is entirely up to the application. However, certain limitations apply:

Because of these limitations, application developers should ensure their document units do not exceed the maximum (or minimum) value but at the same time allow for sufficient precision. For example, if a page size in a text processing application is 21.65 cm x 27.95 cm, it might be convenient to interpret a document unit as a 1/100 cm. In this case the page width would be 2165 document units while the page height would be 2795 document units.

Additionally, care should be taken when using extremely large document units. Although the DT_SLONG type is capable of storing 32-bit integers (i.e. integers in the [-231 .. +231 - 1] range), numerical overflows and unexpected rendering results may occur when pixel coordinates (obtained by scaling document units) approach or exceed the limits imposed by 24-bit integers. This is because D-Type Power Engine internally stores all pixel quantities as 24.8 signed fractional values (see the DT_SFRAC type) in order to allow D-Type Rasterizer to render text and vectorial shapes using sub-pixel precision. In other words, it is important to remember that the final output coordinates (in whole pixels) are limited to the [-223 .. +223 - 1] range.

 

Index