Index

CDTEngineV8

TypesetterSetPositioning

This function sets the positioning mode in the Typesetter. The positioning mode tells the Typesetter whether to place glyphs at fractional pixel positions or snap their output X and/or Y coordinates to the closest whole pixel positions before the glyphs are actually rasterized by the Rasterizer.

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

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

When the glyph positioning mode is set to fractional (in either direction), you can use the TypesetterSetSubpixels function to set the number of possible subpixel positions, and consequently, control the utilization/efficiency of the bitmap cache.

Parameters

ParameterDescription

positioning

Sets one of the positioning modes. The positioning mode tells the Typesetter how to position glyphs. At present, the following values are supported:

positioning = 0 (DV_POSITIONING_ENGINE_DEFAULT_A) — Engine Default A (same as 8)

positioning = 1 (DV_POSITIONING_ENGINE_DEFAULT_B) — Engine Default B (same as 9)

positioning = 2 (DV_POSITIONING_USER_DEFAULT_A) — User Default A (same as 4)

positioning = 3 (DV_POSITIONING_USER_DEFAULT_B) — User Default B (same as 5)

positioning = 4 (DV_POSITIONING_FRACX_FRACY) — Frac X, Frac Y
Both X and Y coordinates of glyph origin points are placed at fractional positions. As a result, spacing between characters looks reasonably consistent in both the horizontal and vertical direction.

positioning = 5 (DV_POSITIONING_FRACX_INTY) — Frac X, Int Y
X coordinates of glyph 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.

positioning = 6 (DV_POSITIONING_INTX_FRACY) — Int X, Frac Y
X coordinates of glyph 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.

positioning = 7 (DV_POSITIONING_INTX_INTY) — Int X, Int Y
Both X and Y coordinates of glyph 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.

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

positioning = 9 (DV_POSITIONING_AUTO_B) — Auto B
Same as 5 for standard font sizes, but disables fractional pixel positioning in the X direction for very small and very big font sizes. This is done in order to improve bitmap cache efficiency when rendering using very small and very big font sizes. This is a useful and recommended mode since fractional pixel positioning 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