This function tells D-Type Rasterizer which filling rule to respects when rasterizing vectorial shapes: the Nonzero Winding Number rule or the Odd-Even rule. When the Odd-Even rule is selected, the direction of contours used to build vectorial shapes is ignored. When the Nonzero Winding Number rule is selected, the direction of contours is respected. Depending on the construction of the vectorial shape (i.e. whether it has any overlapping contours), these two rules may yield different rasterization results.
The default filling rule is the Nonzero Winding Number rule. This filling rule is more versatile than the Odd-Even rule and, consequently, very suitable for fonts and user defined shapes. In some cases, however, applications may want to call this function to utilize the simpler Odd-Even filling rule.
Parameter | Description |
---|---|
engine |
Handle of the previously created Standard Engine instance. |
fill_rule |
0 (DV_NZW_OFF) — Use the Odd-Even filling rule |
Note: Certain types of output primitives (e.g. glyphs) may be cached by the higher level API components (e.g. Typesetter) in their bitmap cache. This function does not have any impact on already cached output primitives. You may want to clear the respective cache when calling this function to ensure that all output primitives are affected in the same way.
If successful, the return value is 1. Otherwise, the function returns 0.
When the Odd-Even rule is selected, the direction of contours used to build vectorial shapes is ignored. Thus, this rule is only suitable when rendering fonts or vectorial shapes constructed with the Odd-Even rule in mind. Since all font formats supported by D-Type Font Engine utilize the Nonzero Winding Number rule, this is not the default filling rule. However, should you encounter a font that does not respect this rule (a non-compliant font), you may want to utilize the Odd-Even rule.
Both of these rules are documented and explained in general computer graphics literature.