This function sets the minimum pixel size for narrow horizontal and vertical glyph features in hinted fonts. More precisely, this setting specifies the minimum thickness for narrow vertical and horizontal stems when the Typesetter scales glyphs/characters to small pixel sizes. This ensures that narrow horizontal and vertical stems remain reasonably sharp (dark) when the font is scaled to smaller pixel sizes.
When D-Type Engine is initialized, the default minimum pixel size for narrow horizontal and vertical glyph features is set to approximately 78 (0.78 pixels). This is a good value for most applications. However, applications that require very sharp (dark) output, even when the fonts are scaled to very small pixel sizes, may want to increase this value somewhat.
Parameter | Description |
---|---|
engine |
Handle of the previously created Standard Engine instance. |
min_hint_dpx |
Minimum thickness for narrow vertical glyph stems in hinted fonts, in 1/100 pixels. When scaling hinted fonts to small pixel sizes, the Typesetter will ensure that narrow vertical stems remain at least min_hint_dpx pixels thick. This value must be between 10 and 100 (0.1 and 1.0 pixels). The larger the value is, the thicker and sharper (darker) the hinted stems will appear at small pixel sizes. However, values very close to 100 (1.0 pixels) will also increase hinting distortions which, in some rare cases, may become too noticeable or result in some extra (unwanted) pixels. Therefore, values very close to 100 (1.0 pixels) should be avoided. Also, values smaller than 50 (0.5 pixels) are not recommended because hinted stems will appear too narrow (gray). The best values are in the 50 and 90 range (0.5 to 0.9 pixels). In general, the min_hint_dpx parameter has a noticeable impact only on fonts that contain glyphs with narrow vertical stems and only when scaling to small sizes (i.e. when the vertical stems become narrower than 1 pixel). Bold fonts or fonts containing vertical stems that are thicker than 1 pixel at small sizes will not be affected by this parameter. Thus, at larger pixel sizes this parameter has virtually no effect on any fonts. Please note this parameter is only respected when using hinted (auto-hinted) fonts and when font hinting is enabled. If the font is not hinted or font hinting is disabled, this parameter is completely ignored. |
min_hint_dpy |
Minimum thickness for narrow horizontal glyph stems in hinted fonts, in 1/100 pixels. When scaling hinted fonts to small pixel sizes, the Typesetter will ensure that narrow horizontal stems remain at least min_hint_dpy pixels thick. This value must be between 10 and 100 (0.1 and 1.0 pixels). The larger the value is, the thicker and sharper (darker) the hinted stems will appear at small pixel sizes. However, values very close to 100 (1.0 pixels) will also increase hinting distortions which, in some rare cases, may become too noticeable or result in some extra (unwanted) pixels. Therefore, values very close to 100 (1.0 pixels) should be avoided. Also, values smaller than 50 (0.5 pixels) are not recommended because hinted stems will appear too narrow (gray). The best values are in the 50 and 90 range (0.5 to 0.9 pixels). In general, the min_hint_dpy parameter has a noticeable impact only on fonts that contain glyphs with narrow horizontal stems and only when scaling to small sizes (i.e. when the horizontal stems become narrower than 1 pixel). Bold fonts or fonts containing horizontal stems that are thicker than 1 pixel at small sizes will not be affected by this parameter. Thus, at larger pixel sizes this parameter has virtually no effect on any fonts. Please note this parameter is only respected when using hinted (auto-hinted) fonts and when font hinting is enabled. If the font is not hinted or font hinting is disabled, this parameter is completely ignored. |
flag |
Specifies action with respect to the Typesetter's bitmap cache. Currently supported values are:
|
If successful, the return value is 1. Otherwise, the function returns 0.
The following images show a sample text paragraph rendered using the Courier font and three different min_hint_dpx (min_hint_dpy) values. Courier is a font that contains glyphs with quite narrow horizontal and vertical stems. When scaled to a relatively small pixel size, as in this example, its horizontal and vertical stems become narrower than 1 pixel. In this case, the Typesetter ensures that narrow vertical stems remain at least min_hint_dpx pixels thick and narrow horizontal stems remain at least min_hint_dpy pixels thick.
The resulting output is first shown at normal size and then magnified 3 times so that subtle sub-pixel differences between different images can be viewed more easily. Note the higher the value of min_hint_dpx (min_hint_dpy) is, the wider the stems appear at small sizes and, consequently, the sharper (darker) the overall output is.
a) min_hint_dpx and min_hint_dpy set to 50 (0.5 pixels)
b) min_hint_dpx and min_hint_dpy set to 70 (0.7 pixels)
c) min_hint_dpx and min_hint_dpy set to 90 (0.9 pixels)