Struct qt_gui::q_font::HintingPreference
source · pub struct HintingPreference(/* private fields */);
Expand description
This enum describes the 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.
C++ enum: QFont::HintingPreference
.
This enum describes the 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.
Please note that this enum only describes a preference, as the full range of hinting levels are not supported on all of Qt's supported platforms. The following table details the effect of a given hinting preference on a selected set of target platforms.
PreferDefaultHinting | PreferNoHinting | PreferVerticalHinting | PreferFullHinting | |
---|---|---|---|---|
Windows Vista (w/o Platform Update) and earlier | Full hinting | Full hinting | Full hinting | Full hinting |
Windows 7 and Windows Vista (w/Platform Update) and DirectWrite enabled in Qt | Full hinting | Vertical hinting | Vertical hinting | Full hinting |
FreeType | Operating System setting | No hinting | Vertical hinting (light) | Full hinting |
Cocoa on macOS | No hinting | No hinting | No hinting | No hinting |
Note: Please be aware that altering the hinting preference on Windows is available through the DirectWrite font engine. This is available on Windows Vista after installing the platform update, and on Windows 7. In order to use this extension, configure Qt using -directwrite. The target application will then depend on the availability of DirectWrite on the target system.
This enum was introduced or modified in Qt 4.8.
Implementations§
source§impl HintingPreference
impl HintingPreference
sourcepub const PreferDefaultHinting: HintingPreference = _
pub const PreferDefaultHinting: HintingPreference = _
Use the default hinting level for the target platform. (C++ enum variant: PreferDefaultHinting = 0
)
sourcepub const PreferNoHinting: HintingPreference = _
pub const PreferNoHinting: HintingPreference = _
If possible, 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. (C++ enum variant: PreferNoHinting = 1
)
sourcepub const PreferVerticalHinting: HintingPreference = _
pub const PreferVerticalHinting: HintingPreference = _
If possible, 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. But since the horizontal metrics of the glyphs are unhinted, the text’s layout will be scalable to higher density devices (such as printers) without impacting details such as line breaks. (C++ enum variant: PreferVerticalHinting = 2
)
sourcepub const PreferFullHinting: HintingPreference = _
pub const PreferFullHinting: HintingPreference = _
If possible, render text with hinting in both horizontal and vertical directions. The text will be altered to optimize legibility on the target device, but since the metrics will depend on the target size of the text, the positions of glyphs, line breaks, and other typographical detail will not scale, meaning that a text layout may look different on devices with different pixel densities. (C++ enum variant: PreferFullHinting = 3
)
Trait Implementations§
source§impl Clone for HintingPreference
impl Clone for HintingPreference
source§fn clone(&self) -> HintingPreference
fn clone(&self) -> HintingPreference
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HintingPreference
impl Debug for HintingPreference
source§impl From<HintingPreference> for c_int
impl From<HintingPreference> for c_int
source§fn from(value: HintingPreference) -> Self
fn from(value: HintingPreference) -> Self
source§impl From<i32> for HintingPreference
impl From<i32> for HintingPreference
source§impl PartialEq for HintingPreference
impl PartialEq for HintingPreference
source§fn eq(&self, other: &HintingPreference) -> bool
fn eq(&self, other: &HintingPreference) -> bool
self
and other
values to be equal, and is used
by ==
.