Index

Positioning And Hinting

The following 16 images show the interaction of positioning and hinting when the dtTypesetterSetPositioning and dtTypesetterSetHinting functions are independently called to set the positioning and hinting mode in the Typesetter. All 16 images show the same three text lines rendered at the same location on the screen. The only difference is that each image was generated using a different combination of positioning and hinting. The images were generated by the following code:

DT_STYLE_ATTRIBS style = {{0, 0}, {0, 0, 0, 0}, 0, DV_NULL};
DT_TYPE_ATTRIBS type = {MYFONT_TIMES, 0, 0, 0, 0, {{20, 20, 0, 0, 0}}};

dtOutputSetStyleAttribs(engine, &style, 0);
dtTypesetterSetTypeAttribs(engine, &type, 0);

dtTypesetterSetHinting(engine, hinting, 0);
dtTypesetterSetPositioning(engine, positioning, 0);

dtxTextDoOutput_ANSI(engine, 20.0, 20.0, 0, DV_TEXTMODE_KERN_FRAC, DV_NULL, "sample text iiiii mmmmm sample text");
dtxTextDoOutput_ANSI(engine, 25.4, 40.4, 0, DV_TEXTMODE_KERN_FRAC, DV_NULL, "sample text iiiii mmmmm sample text");
dtxTextDoOutput_ANSI(engine, 30.8, 60.8, 0, DV_TEXTMODE_KERN_FRAC, DV_NULL, "sample text iiiii mmmmm sample text");

where hinting and positioning were independently assigned the values of 4, 5, 6 and 7, thus producing the total of 16 different image combinations.

The resulting images are magnified 3 times so that subtle sub-pixel differences can be viewed more easily.

 

Positioning = 4 (Frac X, Frac Y)

Positioning = 4 (Frac X, Frac Y), Hinting = 4 (X On, Y On)

Positioning=4, Hinting=4

Positioning: Both X and Y coordinates of origin points are placed at fractional positions. As a result, spacing between characters looks reasonably consistent in both the horizontal and vertical direction.

Hinting: Both X and Y edges are snapped to the pixel grid. As a result, both X and Y edges look reasonably sharp.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 4 (Frac X, Frac Y), Hinting = 5 (X On, Y Off)

Positioning=4, Hinting=5

Positioning: Both X and Y coordinates of origin points are placed at fractional positions. As a result, spacing between characters looks reasonably consistent in both the horizontal and vertical direction.

Hinting: Only X edges are snapped to the pixel grid. As a result, X edges look reasonably sharp, while Y edges look somewhat blurry.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 4 (Frac X, Frac Y), Hinting = 6 (X Off, Y On)

Positioning=4, Hinting=6

Positioning: Both X and Y coordinates of origin points are placed at fractional positions. As a result, spacing between characters looks reasonably consistent in both the horizontal and vertical direction.

Hinting: Only Y edges are snapped to the pixel grid. As a result, X edges look somewhat blurry, while Y edges look reasonably sharp.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 4 (Frac X, Frac Y), Hinting = 7 (X Off, Y Off)

Positioning=4, Hinting=7

Positioning: Both X and Y coordinates of origin points are placed at fractional positions. As a result, spacing between characters looks reasonably consistent in both the horizontal and vertical direction.

Hinting: Neither X nor Y edges are snapped to the pixel grid. As a result, both X and Y edges look somewhat blurry.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 5 (Frac X, Int Y)

Positioning = 5 (Frac X, Int Y), Hinting = 4 (X On, Y On)

Positioning=5, Hinting=4

Positioning: X coordinates of origin points are placed at fractional positions, while Y coordinates are snapped to the closest whole pixel positions. As a result, spacing between characters looks reasonably consistent in the horizontal direction and somewhat inconsistent in the vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Both X and Y edges are snapped to the pixel grid. As a result, both X and Y edges look reasonably sharp.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 5 (Frac X, Int Y), Hinting = 5 (X On, Y Off)

Positioning=5, Hinting=5

Positioning: X coordinates of origin points are placed at fractional positions, while Y coordinates are snapped to the closest whole pixel positions. As a result, spacing between characters looks reasonably consistent in the horizontal direction and somewhat inconsistent in the vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Only X edges are snapped to the pixel grid. As a result, X edges look reasonably sharp, while Y edges look somewhat blurry.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 5 (Frac X, Int Y), Hinting = 6 (X Off, Y On)

Positioning=5, Hinting=6

Positioning: X coordinates of origin points are placed at fractional positions, while Y coordinates are snapped to the closest whole pixel positions. As a result, spacing between characters looks reasonably consistent in the horizontal direction and somewhat inconsistent in the vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Only Y edges are snapped to the pixel grid. As a result, X edges look somewhat blurry, while Y edges look reasonably sharp.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 5 (Frac X, Int Y), Hinting = 7 (X Off, Y Off)

Positioning=5, Hinting=7

Positioning: X coordinates of origin points are placed at fractional positions, while Y coordinates are snapped to the closest whole pixel positions. As a result, spacing between characters looks reasonably consistent in the horizontal direction and somewhat inconsistent in the vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Neither X nor Y edges are snapped to the pixel grid. As a result, both X and Y edges look somewhat blurry.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 6 (Int X, Frac Y)

Positioning = 6 (Int X, Frac Y), Hinting = 4 (X On, Y On)

Positioning=6, Hinting=4

Positioning: X coordinates of origin points are snapped to the closest whole pixel positions, while Y coordinates are placed at fractional positions. As a result, spacing between characters looks somewhat inconsistent in the horizontal direction and reasonably consistent in the vertical direction.

Hinting: Both X and Y edges are snapped to the pixel grid. As a result, both X and Y edges look reasonably sharp.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 6 (Int X, Frac Y), Hinting = 5 (X On, Y Off)

Positioning=6, Hinting=5

Positioning: X coordinates of origin points are snapped to the closest whole pixel positions, while Y coordinates are placed at fractional positions. As a result, spacing between characters looks somewhat inconsistent in the horizontal direction and reasonably consistent in the vertical direction.

Hinting: Only X edges are snapped to the pixel grid. As a result, X edges look reasonably sharp, while Y edges look somewhat blurry.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 6 (Int X, Frac Y), Hinting = 6 (X Off, Y On)

Positioning=6, Hinting=6

Positioning: X coordinates of origin points are snapped to the closest whole pixel positions, while Y coordinates are placed at fractional positions. As a result, spacing between characters looks somewhat inconsistent in the horizontal direction and reasonably consistent in the vertical direction.

Hinting: Only Y edges are snapped to the pixel grid. As a result, X edges look somewhat blurry, while Y edges look reasonably sharp.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 6 (Int X, Frac Y), Hinting = 7 (X Off, Y Off)

Positioning=6, Hinting=7

Positioning: X coordinates of origin points are snapped to the closest whole pixel positions, while Y coordinates are placed at fractional positions. As a result, spacing between characters looks somewhat inconsistent in the horizontal direction and reasonably consistent in the vertical direction.

Hinting: Neither X nor Y edges are snapped to the pixel grid. As a result, both X and Y edges look somewhat blurry.

Remarks: Since fractional positioning is enabled in at least one direction, the same character may look slightly different at different fractional positions (and consequently generates multiple bitmap images in the bitmap cache).


Positioning = 7 (Int X, Int Y)

Positioning = 7 (Int X, Int Y), Hinting = 4 (X On, Y On)

Positioning=7, Hinting=4

Positioning: Both X and Y coordinates of origin points are snapped to the closest whole pixel positions. As a result, spacing between characters looks somewhat inconsistent in both the horizontal and vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Both X and Y edges are snapped to the pixel grid. As a result, both X and Y edges look reasonably sharp.

Remarks: Since fractional positioning is disabled in both directions, the same character always looks exactly the same regardless of its position (and consequently generates only one bitmap image in the bitmap cache as long as the hinting mode is constant).


Positioning = 7 (Int X, Int Y), Hinting = 5 (X On, Y Off)

Positioning=7, Hinting=5

Positioning: Both X and Y coordinates of origin points are snapped to the closest whole pixel positions. As a result, spacing between characters looks somewhat inconsistent in both the horizontal and vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Only X edges are snapped to the pixel grid. As a result, X edges look reasonably sharp, while Y edges look somewhat blurry.

Remarks: Since fractional positioning is disabled in both directions, the same character always looks exactly the same regardless of its position (and consequently generates only one bitmap image in the bitmap cache as long as the hinting mode is constant).


Positioning = 7 (Int X, Int Y), Hinting = 6 (X Off, Y On)

Positioning=7, Hinting=6

Positioning: Both X and Y coordinates of origin points are snapped to the closest whole pixel positions. As a result, spacing between characters looks somewhat inconsistent in both the horizontal and vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Only Y edges are snapped to the pixel grid. As a result, X edges look somewhat blurry, while Y edges look reasonably sharp.

Remarks: Since fractional positioning is disabled in both directions, the same character always looks exactly the same regardless of its position (and consequently generates only one bitmap image in the bitmap cache as long as the hinting mode is constant).


Positioning = 7 (Int X, Int Y), Hinting = 7 (X Off, Y Off)

Positioning=7, Hinting=7

Positioning: Both X and Y coordinates of origin points are snapped to the closest whole pixel positions. As a result, spacing between characters looks somewhat inconsistent in both the horizontal and vertical direction (inconsistent vertical positioning may be difficult to notice in this example as there are only three lines of text).

Hinting: Neither X nor Y edges are snapped to the pixel grid. As a result, both X and Y edges look somewhat blurry.

Remarks: Since fractional positioning is disabled in both directions, the same character always looks exactly the same regardless of its position (and consequently generates only one bitmap image in the bitmap cache as long as the hinting mode is constant).


 

Index