Index

CDTEngineV8

TypesetterSetHinting

This function sets the hinting mode in the Typesetter. The hinting mode tells the Typesetter how to micro-adjust glyph outlines in hinted or auto-hinted fonts with respect to the pixel grid before the glyphs are actually rasterized by the Rasterizer. The purpose of these micro-adjustments is to improve the quality and appearance of glyph images when viewed on the screen (or any other raster device). The adjustments usually include subtle outline distortions of glyph outlines such as snapping to the pixel grid, alignment, micro-compression, micro-expansion etc.

When D-Type Engine is initialized, the hinting mode is already set in the Typesetter to the recommended default value (DV_HINTING_ENGINE_DEFAULT_A).

This function can be used in conjunction with TypesetterSetPositioning. For further details and illustrations, see Appendix — Positioning And Hinting.

Please note that all the hinting adjustments described here will only have effect on fonts that are added to the Font Catalog as hinted or auto-hinted (see e.g. FontAddViaStream for details).

Parameters

ParameterDescription

hinting

Sets one of the hinting modes. The hinting mode tells the Typesetter how to interact with the pixel grid when rendering glyphs. At present, the following values are supported:

hinting = 0 (DV_HINTING_ENGINE_DEFAULT_A) — Engine Default A (same as 8)

hinting = 1 (DV_HINTING_ENGINE_DEFAULT_B) — Engine Default B (same as 9)

hinting = 2 (DV_HINTING_USER_DEFAULT_A) — User Default A (same as 4)

hinting = 3 (DV_HINTING_USER_DEFAULT_B) — User Default B (same as 6)

hinting = 4 (DV_HINTING_XON_YON) — X On, Y On
Both X and Y edges are snapped to the pixel grid. As a result, both X and Y edges look reasonably sharp.

hinting = 5 (DV_HINTING_XON_YOFF) — X On, Y Off
Only X edges are snapped to the pixel grid. As a result, X edges look reasonably sharp, while Y edges look somewhat blurry.

hinting = 6 (DV_HINTING_XOFF_YON) — X Off, Y On
Only Y edges are snapped to the pixel grid. As a result, X edges look somewhat blurry, while Y edges look reasonably sharp.

hinting = 7 (DV_HINTING_XOFF_YOFF) — X Off, Y Off
Neither X nor Y edges are snapped to the pixel grid. As a result, both X and Y edges look somewhat blurry.

hinting = 8 (DV_HINTING_AUTO_A) — Auto A
Same as 4 for standard font sizes, but disables hinting in the X and/or Y direction for very small and very big font sizes. This is done in order to improve speed when rendering using very small and very big font sizes. This is a useful and recommended mode since hinting is not really necessary at those sizes.

hinting = 9 (DV_HINTING_AUTO_B) — Auto B
Same as 6 for standard font sizes, but disables hinting in the Y direction for very small and very big font sizes. This is done in order to improve speed when rendering using very small and very big font sizes. This is a useful and recommended mode since hinting is not really necessary at those sizes.

flag

Specifies action with respect to the Typesetter's bitmap cache. Currently supported values are:

  • flag = 0 — Default behavior for this function (bitmap cache will be cleared only if deemed necessary)
  • flag = 1 — Do not clear the bitmap cache
  • flag = 2 — Force clear the bitmap cache

Return Value

If successful, the return value is 1. Otherwise, the function returns 0.

Comments

See Appendix — Positioning And Hinting


 

Index