PyQt5 QSpinBox – Setting Hinting Preference
In this article we will see how we can set hinting preference to the spin box, there are different levels of hinting that can be applied to glyphs to improve legibility on displays where it might be warranted by the density of pixels.
Below is the types of preference are available for spin box
PreferDefaultHinting : Use the default hinting level for the spin box
PreferNoHinting : It render text without hinting the outlines of the glyphs. The text layout will be typographically accurate and scalable, using the same metrics as are used e.g. when printing.
PreferVerticalHinting : It render text with no horizontal hinting, but align glyphs to the pixel grid in the vertical direction. The text will appear crisper on displays where the density is too low to give an accurate rendering of the glyphs.
PreferFullHinting : It render text with hinting in both horizontal and vertical directions. The text will be altered to optimize legibility on the spin box
In order to do this we usesetHintingPreference method with the QFont object of the spin box
Syntax : font.setHintingPreference(QFont.PreferFullHinting)
Argument : It takes QFont object or we can pass preference value as argument
Return : It returns None
Below is the implementation