Struct qt_gui::QRawFont

source ·
#[repr(C)]
pub struct QRawFont { /* private fields */ }
Expand description

The QRawFont class provides access to a single physical instance of a font.

C++ class: QRawFont.

C++ documentation:

The QRawFont class provides access to a single physical instance of a font.

Note: QRawFont is a low level class. For most purposes QFont is a more appropriate class.

Most commonly, when presenting text in a user interface, the exact fonts used to render the characters is to some extent unknown. This can be the case for several reasons: For instance, the actual, physical fonts present on the target system could be unexpected to the developers, or the text could contain user selected styles, sizes or writing systems that are not supported by font chosen in the code.

Therefore, Qt's QFont class really represents a query for fonts. When text is interpreted, Qt will do its best to match the text to the query, but depending on the support, different fonts can be used behind the scenes.

For most use cases, this is both expected and necessary, as it minimizes the possibility of text in the user interface being undisplayable. In some cases, however, more direct control over the process might be useful. It is for these use cases the QRawFont class exists.

A QRawFont object represents a single, physical instance of a given font in a given pixel size. I.e. in the typical case it represents a set of TrueType or OpenType font tables and uses a user specified pixel size to convert metrics into logical pixel units. It can be used in combination with the QGlyphRun class to draw specific glyph indexes at specific positions, and also have accessors to some relevant data in the physical font.

QRawFont only provides support for the main font technologies: GDI and DirectWrite on Windows platforms, FreeType on Linux platforms and CoreText on macOS. For other font back-ends, the APIs will be disabled.

QRawFont can be constructed in a number of ways:

  • It can be constructed by calling QTextLayout::glyphs() or QTextFragment::glyphs(). The returned QGlyphs objects will contain QRawFont objects which represent the actual fonts used to render each portion of the text.
  • It can be constructed by passing a QFont object to QRawFont::fromFont(). The function will return a QRawFont object representing the font that will be selected as response to the QFont query and the selected writing system.
  • It can be constructed by passing a file name or QByteArray directly to the QRawFont constructor, or by calling loadFromFile() or loadFromData(). In this case, the font will not be registered in QFontDatabase, and it will not be available as part of regular font selection.

QRawFont is considered local to the thread in which it is constructed (either using a constructor, or by calling loadFromData() or loadFromFile()). The QRawFont cannot be moved to a different thread, but will have to be recreated in the thread in question.

Note: For the requirement of caching glyph indexes and font selections for static text to avoid reshaping and relayouting in the inner loop of an application, a better choice is the QStaticText class, since it optimizes the memory cost of the cache and also provides the possibility of paint engine specific caches for an additional speed-up.

Implementations§

source§

impl QRawFont

source

pub unsafe fn advances_for_glyph_indexes_1a( &self, glyph_indexes: impl CastInto<Ref<QVectorOfU32>> ) -> CppBox<QVectorOfQPointF>

This is an overloaded function.

Calls C++ function: QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32>& glyphIndexes) const.

C++ documentation:

This is an overloaded function.

Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The advance of each glyph is calculated separately.

See also QTextLine::horizontalAdvance() and QFontMetricsF::width().

source

pub unsafe fn advances_for_glyph_indexes_2a( &self, glyph_indexes: impl CastInto<Ref<QVectorOfU32>>, layout_flags: QFlags<LayoutFlag> ) -> CppBox<QVectorOfQPointF>

Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. How the advances are calculated is controlled by layoutFlags.

Calls C++ function: QVector<QPointF> QRawFont::advancesForGlyphIndexes(const QVector<quint32>& glyphIndexes, QFlags<QRawFont::LayoutFlag> layoutFlags) const.

C++ documentation:

Returns the QRawFont’s advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. How the advances are calculated is controlled by layoutFlags.

This function was introduced in Qt 5.1.

See also QTextLine::horizontalAdvance() and QFontMetricsF::width().

source

pub unsafe fn advances_for_glyph_indexes_3a( &self, glyph_indexes: *const u32, advances: impl CastInto<Ptr<QPointF>>, num_glyphs: c_int ) -> bool

This is an overloaded function.

Calls C++ function: bool QRawFont::advancesForGlyphIndexes(const quint32* glyphIndexes, QPointF* advances, int numGlyphs) const.

C++ documentation:

This is an overloaded function.

Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The glyph indexes are given with the array glyphIndexes while the results are returned through advances, both of them must have numGlyphs elements. The advance of each glyph is calculated separately

See also QTextLine::horizontalAdvance() and QFontMetricsF::width().

source

pub unsafe fn advances_for_glyph_indexes_4a( &self, glyph_indexes: *const u32, advances: impl CastInto<Ptr<QPointF>>, num_glyphs: c_int, layout_flags: QFlags<LayoutFlag> ) -> bool

Returns the QRawFont's advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The glyph indexes are given with the array glyphIndexes while the results are returned through advances, both of them must have numGlyphs elements. How the advances are calculated is controlled by layoutFlags.

Calls C++ function: bool QRawFont::advancesForGlyphIndexes(const quint32* glyphIndexes, QPointF* advances, int numGlyphs, QFlags<QRawFont::LayoutFlag> layoutFlags) const.

C++ documentation:

Returns the QRawFont’s advances for each of the glyphIndexes in pixel units. The advances give the distance from the position of a given glyph to where the next glyph should be drawn to make it appear as if the two glyphs are unspaced. The glyph indexes are given with the array glyphIndexes while the results are returned through advances, both of them must have numGlyphs elements. How the advances are calculated is controlled by layoutFlags.

This function was introduced in Qt 5.1.

See also QTextLine::horizontalAdvance() and QFontMetricsF::width().

source

pub unsafe fn alpha_map_for_glyph_3a( &self, glyph_index: u32, antialiasing_type: AntialiasingType, transform: impl CastInto<Ref<QTransform>> ) -> CppBox<QImage>

This function returns a rasterized image of the glyph at the given glyphIndex in the underlying font, using the transform specified. If the QRawFont is not valid, this function will return an invalid QImage.

Calls C++ function: QImage QRawFont::alphaMapForGlyph(quint32 glyphIndex, QRawFont::AntialiasingType antialiasingType = …, const QTransform& transform = …) const.

C++ documentation:

This function returns a rasterized image of the glyph at the given glyphIndex in the underlying font, using the transform specified. If the QRawFont is not valid, this function will return an invalid QImage.

If the font is a color font, then the resulting image will contain the rendered glyph at the current pixel size. In this case, the antialiasingType will be ignored.

Otherwise, if antialiasingType is set to QRawFont::SubPixelAntialiasing, then the resulting image will be in QImage::Format_RGB32 and the RGB values of each pixel will represent the subpixel opacities of the pixel in the rasterization of the glyph. Otherwise, the image will be in the format of QImage::Format_Indexed8 and each pixel will contain the opacity of the pixel in the rasterization.

See also pathForGlyph() and QPainter::drawGlyphRun().

source

pub unsafe fn alpha_map_for_glyph_2a( &self, glyph_index: u32, antialiasing_type: AntialiasingType ) -> CppBox<QImage>

This function returns a rasterized image of the glyph at the given glyphIndex in the underlying font, using the transform specified. If the QRawFont is not valid, this function will return an invalid QImage.

Calls C++ function: QImage QRawFont::alphaMapForGlyph(quint32 glyphIndex, QRawFont::AntialiasingType antialiasingType = …) const.

C++ documentation:

This function returns a rasterized image of the glyph at the given glyphIndex in the underlying font, using the transform specified. If the QRawFont is not valid, this function will return an invalid QImage.

If the font is a color font, then the resulting image will contain the rendered glyph at the current pixel size. In this case, the antialiasingType will be ignored.

Otherwise, if antialiasingType is set to QRawFont::SubPixelAntialiasing, then the resulting image will be in QImage::Format_RGB32 and the RGB values of each pixel will represent the subpixel opacities of the pixel in the rasterization of the glyph. Otherwise, the image will be in the format of QImage::Format_Indexed8 and each pixel will contain the opacity of the pixel in the rasterization.

See also pathForGlyph() and QPainter::drawGlyphRun().

source

pub unsafe fn alpha_map_for_glyph_1a(&self, glyph_index: u32) -> CppBox<QImage>

This function returns a rasterized image of the glyph at the given glyphIndex in the underlying font, using the transform specified. If the QRawFont is not valid, this function will return an invalid QImage.

Calls C++ function: QImage QRawFont::alphaMapForGlyph(quint32 glyphIndex) const.

C++ documentation:

This function returns a rasterized image of the glyph at the given glyphIndex in the underlying font, using the transform specified. If the QRawFont is not valid, this function will return an invalid QImage.

If the font is a color font, then the resulting image will contain the rendered glyph at the current pixel size. In this case, the antialiasingType will be ignored.

Otherwise, if antialiasingType is set to QRawFont::SubPixelAntialiasing, then the resulting image will be in QImage::Format_RGB32 and the RGB values of each pixel will represent the subpixel opacities of the pixel in the rasterization of the glyph. Otherwise, the image will be in the format of QImage::Format_Indexed8 and each pixel will contain the opacity of the pixel in the rasterization.

See also pathForGlyph() and QPainter::drawGlyphRun().

source

pub unsafe fn ascent(&self) -> c_double

Returns the ascent of this QRawFont in pixel units.

Calls C++ function: double QRawFont::ascent() const.

C++ documentation:

Returns the ascent of this QRawFont in pixel units.

The ascent of a font is the distance from the baseline to the highest position characters extend to. In practice, some font designers break this rule, e.g. when they put more than one accent on top of a character, or to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small.

See also QFontMetricsF::ascent().

source

pub unsafe fn average_char_width(&self) -> c_double

Returns the average character width of this QRawFont in pixel units.

Calls C++ function: double QRawFont::averageCharWidth() const.

C++ documentation:

Returns the average character width of this QRawFont in pixel units.

See also QFontMetricsF::averageCharWidth().

source

pub unsafe fn bounding_rect(&self, glyph_index: u32) -> CppBox<QRectF>

Returns the smallest rectangle containing the glyph with the given glyphIndex.

Calls C++ function: QRectF QRawFont::boundingRect(quint32 glyphIndex) const.

C++ documentation:

Returns the smallest rectangle containing the glyph with the given glyphIndex.

This function was introduced in Qt 5.0.

source

pub unsafe fn cap_height(&self) -> c_double

Returns the cap height of this QRawFont in pixel units.

Calls C++ function: double QRawFont::capHeight() const.

C++ documentation:

Returns the cap height of this QRawFont in pixel units.

The cap height of a font is the height of a capital letter above the baseline. It specifically is the height of capital letters that are flat - such as H or I - as opposed to round letters such as O, or pointed letters like A, both of which may display overshoot.

This function was introduced in Qt 5.8.

See also QFontMetricsF::capHeight().

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QRawFont>> ) -> Ref<QRawFont>

Assigns other to this QRawFont.

Calls C++ function: QRawFont& QRawFont::operator=(const QRawFont& other).

C++ documentation:

Assigns other to this QRawFont.

source

pub unsafe fn descent(&self) -> c_double

Returns the descent of this QRawFont in pixel units.

Calls C++ function: double QRawFont::descent() const.

C++ documentation:

Returns the descent of this QRawFont in pixel units.

The descent is the distance from the base line to the lowest point characters extend to. In practice, some font designers break this rule, e.g. to accommodate an unusual character in an exotic language, so it is possible (though rare) that this value will be too small.

See also QFontMetricsF::descent().

source

pub unsafe fn family_name(&self) -> CppBox<QString>

Returns the family name of this QRawFont.

Calls C++ function: QString QRawFont::familyName() const.

C++ documentation:

Returns the family name of this QRawFont.

source

pub unsafe fn font_table(&self, tag_name: *const c_char) -> CppBox<QByteArray>

Retrieves the sfnt table named tagName from the underlying physical font, or an empty byte array if no such table was found. The returned font table's byte order is Big Endian, like the sfnt format specifies. The tagName must be four characters long and should be formatted in the default endianness of the current platform.

Calls C++ function: QByteArray QRawFont::fontTable(const char* tagName) const.

C++ documentation:

Retrieves the sfnt table named tagName from the underlying physical font, or an empty byte array if no such table was found. The returned font table’s byte order is Big Endian, like the sfnt format specifies. The tagName must be four characters long and should be formatted in the default endianness of the current platform.

source

pub unsafe fn from_font_2a( font: impl CastInto<Ref<QFont>>, writing_system: WritingSystem ) -> CppBox<QRawFont>

Fetches the physical representation based on a font query. The physical font returned is the font that will be preferred by Qt in order to display text in the selected writingSystem.

Calls C++ function: static QRawFont QRawFont::fromFont(const QFont& font, QFontDatabase::WritingSystem writingSystem = …).

C++ documentation:

Fetches the physical representation based on a font query. The physical font returned is the font that will be preferred by Qt in order to display text in the selected writingSystem.

Warning: This function is potentially expensive and should not be called in performance sensitive code.

source

pub unsafe fn from_font_1a(font: impl CastInto<Ref<QFont>>) -> CppBox<QRawFont>

Fetches the physical representation based on a font query. The physical font returned is the font that will be preferred by Qt in order to display text in the selected writingSystem.

Calls C++ function: static QRawFont QRawFont::fromFont(const QFont& font).

C++ documentation:

Fetches the physical representation based on a font query. The physical font returned is the font that will be preferred by Qt in order to display text in the selected writingSystem.

Warning: This function is potentially expensive and should not be called in performance sensitive code.

source

pub unsafe fn glyph_indexes_for_chars( &self, chars: impl CastInto<Ptr<QChar>>, num_chars: c_int, glyph_indexes: *mut u32, num_glyphs: *mut c_int ) -> bool

Converts a string of unicode points to glyph indexes using the CMAP table in the underlying font. The function works like glyphIndexesForString() except it take an array (chars), the results will be returned though glyphIndexes array and number of glyphs will be set in numGlyphs. The size of glyphIndexes array must be at least numChars, if that's still not enough, this function will return false, then you can resize glyphIndexes from the size returned in numGlyphs.

Calls C++ function: bool QRawFont::glyphIndexesForChars(const QChar* chars, int numChars, quint32* glyphIndexes, int* numGlyphs) const.

C++ documentation:

Converts a string of unicode points to glyph indexes using the CMAP table in the underlying font. The function works like glyphIndexesForString() except it take an array (chars), the results will be returned though glyphIndexes array and number of glyphs will be set in numGlyphs. The size of glyphIndexes array must be at least numChars, if that’s still not enough, this function will return false, then you can resize glyphIndexes from the size returned in numGlyphs.

See also glyphIndexesForString(), advancesForGlyphIndexes(), QGlyphRun, QTextLayout::glyphRuns(), and QTextFragment::glyphRuns().

source

pub unsafe fn glyph_indexes_for_string( &self, text: impl CastInto<Ref<QString>> ) -> CppBox<QVectorOfU32>

Converts the string of unicode points given by text to glyph indexes using the CMAP table in the underlying font, and returns a vector containing the result.

Calls C++ function: QVector<quint32> QRawFont::glyphIndexesForString(const QString& text) const.

C++ documentation:

Converts the string of unicode points given by text to glyph indexes using the CMAP table in the underlying font, and returns a vector containing the result.

Note that, in cases where there are other tables in the font that affect the shaping of the text, the returned glyph indexes will not correctly represent the rendering of the text. To get the correctly shaped text, you can use QTextLayout to lay out and shape the text, then call QTextLayout::glyphs() to get the set of glyph index list and QRawFont pairs.

See also advancesForGlyphIndexes(), glyphIndexesForChars(), QGlyphRun, QTextLayout::glyphRuns(), and QTextFragment::glyphRuns().

source

pub unsafe fn hinting_preference(&self) -> HintingPreference

Returns the hinting preference used to construct this QRawFont.

Calls C++ function: QFont::HintingPreference QRawFont::hintingPreference() const.

C++ documentation:

Returns the hinting preference used to construct this QRawFont.

See also QFont::hintingPreference().

source

pub unsafe fn is_valid(&self) -> bool

Returns true if the QRawFont is valid and false otherwise.

Calls C++ function: bool QRawFont::isValid() const.

C++ documentation:

Returns true if the QRawFont is valid and false otherwise.

source

pub unsafe fn leading(&self) -> c_double

Returns the leading of this QRawFont in pixel units.

Calls C++ function: double QRawFont::leading() const.

C++ documentation:

Returns the leading of this QRawFont in pixel units.

This is the natural inter-line spacing.

See also QFontMetricsF::leading().

source

pub unsafe fn line_thickness(&self) -> c_double

Returns the thickness for drawing lines (underline, overline, etc.) along with text drawn in this font.

Calls C++ function: double QRawFont::lineThickness() const.

C++ documentation:

Returns the thickness for drawing lines (underline, overline, etc.) along with text drawn in this font.

source

pub unsafe fn load_from_data( &self, font_data: impl CastInto<Ref<QByteArray>>, pixel_size: c_double, hinting_preference: HintingPreference )

Replaces the current QRawFont with the font contained in the supplied fontData for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Calls C++ function: void QRawFont::loadFromData(const QByteArray& fontData, double pixelSize, QFont::HintingPreference hintingPreference).

C++ documentation:

Replaces the current QRawFont with the font contained in the supplied fontData for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

The fontData must contain a TrueType or OpenType font.

See also loadFromFile().

source

pub unsafe fn load_from_file( &self, file_name: impl CastInto<Ref<QString>>, pixel_size: c_double, hinting_preference: HintingPreference )

Replaces the current QRawFont with the contents of the file referenced by fileName for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Calls C++ function: void QRawFont::loadFromFile(const QString& fileName, double pixelSize, QFont::HintingPreference hintingPreference).

C++ documentation:

Replaces the current QRawFont with the contents of the file referenced by fileName for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

The file must reference a TrueType or OpenType font.

See also loadFromData().

source

pub unsafe fn max_char_width(&self) -> c_double

Returns the width of the widest character in the font.

Calls C++ function: double QRawFont::maxCharWidth() const.

C++ documentation:

Returns the width of the widest character in the font.

See also QFontMetricsF::maxWidth().

source

pub unsafe fn new() -> CppBox<QRawFont>

Constructs an invalid QRawFont.

Calls C++ function: [constructor] void QRawFont::QRawFont().

C++ documentation:

Constructs an invalid QRawFont.

source

pub unsafe fn from_q_string_double_hinting_preference( file_name: impl CastInto<Ref<QString>>, pixel_size: c_double, hinting_preference: HintingPreference ) -> CppBox<QRawFont>

Constructs a QRawFont representing the font contained in the file referenced by fileName for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Calls C++ function: [constructor] void QRawFont::QRawFont(const QString& fileName, double pixelSize, QFont::HintingPreference hintingPreference = …).

C++ documentation:

Constructs a QRawFont representing the font contained in the file referenced by fileName for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Note: The referenced file must contain a TrueType or OpenType font.

source

pub unsafe fn from_q_byte_array_double_hinting_preference( font_data: impl CastInto<Ref<QByteArray>>, pixel_size: c_double, hinting_preference: HintingPreference ) -> CppBox<QRawFont>

Constructs a QRawFont representing the font contained in the supplied fontData for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Calls C++ function: [constructor] void QRawFont::QRawFont(const QByteArray& fontData, double pixelSize, QFont::HintingPreference hintingPreference = …).

C++ documentation:

Constructs a QRawFont representing the font contained in the supplied fontData for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Note: The data must contain a TrueType or OpenType font.

source

pub unsafe fn from_q_string_double( file_name: impl CastInto<Ref<QString>>, pixel_size: c_double ) -> CppBox<QRawFont>

Constructs a QRawFont representing the font contained in the file referenced by fileName for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Calls C++ function: [constructor] void QRawFont::QRawFont(const QString& fileName, double pixelSize).

C++ documentation:

Constructs a QRawFont representing the font contained in the file referenced by fileName for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Note: The referenced file must contain a TrueType or OpenType font.

source

pub unsafe fn from_q_byte_array_double( font_data: impl CastInto<Ref<QByteArray>>, pixel_size: c_double ) -> CppBox<QRawFont>

Constructs a QRawFont representing the font contained in the supplied fontData for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Calls C++ function: [constructor] void QRawFont::QRawFont(const QByteArray& fontData, double pixelSize).

C++ documentation:

Constructs a QRawFont representing the font contained in the supplied fontData for the size (in pixels) given by pixelSize, and using the hinting preference specified by hintingPreference.

Note: The data must contain a TrueType or OpenType font.

source

pub unsafe fn new_copy(other: impl CastInto<Ref<QRawFont>>) -> CppBox<QRawFont>

Creates a QRawFont which is a copy of other.

Calls C++ function: [constructor] void QRawFont::QRawFont(const QRawFont& other).

C++ documentation:

Creates a QRawFont which is a copy of other.

source

pub unsafe fn path_for_glyph(&self, glyph_index: u32) -> CppBox<QPainterPath>

This function returns the shape of the glyph at a given glyphIndex in the underlying font if the QRawFont is valid. Otherwise, it returns an empty QPainterPath.

Calls C++ function: QPainterPath QRawFont::pathForGlyph(quint32 glyphIndex) const.

C++ documentation:

This function returns the shape of the glyph at a given glyphIndex in the underlying font if the QRawFont is valid. Otherwise, it returns an empty QPainterPath.

The returned glyph will always be unhinted.

See also alphaMapForGlyph() and QPainterPath::addText().

source

pub unsafe fn pixel_size(&self) -> c_double

Returns the pixel size set for this QRawFont. The pixel size affects how glyphs are rasterized, the size of glyphs returned by pathForGlyph(), and is used to convert internal metrics from design units to logical pixel units.

Calls C++ function: double QRawFont::pixelSize() const.

C++ documentation:

Returns the pixel size set for this QRawFont. The pixel size affects how glyphs are rasterized, the size of glyphs returned by pathForGlyph(), and is used to convert internal metrics from design units to logical pixel units.

See also setPixelSize().

source

pub unsafe fn set_pixel_size(&self, pixel_size: c_double)

Sets the pixel size with which this font should be rendered to pixelSize.

Calls C++ function: void QRawFont::setPixelSize(double pixelSize).

C++ documentation:

Sets the pixel size with which this font should be rendered to pixelSize.

See also pixelSize().

source

pub unsafe fn style(&self) -> Style

Returns the style of this QRawFont.

Calls C++ function: QFont::Style QRawFont::style() const.

C++ documentation:

Returns the style of this QRawFont.

See also QFont::style().

source

pub unsafe fn style_name(&self) -> CppBox<QString>

Returns the style name of this QRawFont.

Calls C++ function: QString QRawFont::styleName() const.

C++ documentation:

Returns the style name of this QRawFont.

See also QFont::styleName().

source

pub unsafe fn supported_writing_systems(&self) -> CppBox<QListOfWritingSystem>

Returns a list of writing systems supported by the font according to designer supplied information in the font file. Please note that this does not guarantee support for a specific unicode point in the font. You can use the supportsCharacter() to check support for a single, specific character.

Calls C++ function: QList<QFontDatabase::WritingSystem> QRawFont::supportedWritingSystems() const.

C++ documentation:

Returns a list of writing systems supported by the font according to designer supplied information in the font file. Please note that this does not guarantee support for a specific unicode point in the font. You can use the supportsCharacter() to check support for a single, specific character.

Note: The list is determined based on the unicode ranges and codepage ranges set in the font's OS/2 table and requires such a table to be present in the underlying font file.

See also supportsCharacter().

source

pub unsafe fn supports_character_uint(&self, ucs4: c_uint) -> bool

This is an overloaded function.

Calls C++ function: bool QRawFont::supportsCharacter(unsigned int ucs4) const.

C++ documentation:

This is an overloaded function.

Returns true if the font has a glyph that corresponds to the UCS-4 encoded character ucs4.

See also supportedWritingSystems().

source

pub unsafe fn supports_character_q_char( &self, character: impl CastInto<Ref<QChar>> ) -> bool

Returns true if the font has a glyph that corresponds to the given character.

Calls C++ function: bool QRawFont::supportsCharacter(QChar character) const.

C++ documentation:

Returns true if the font has a glyph that corresponds to the given character.

See also supportedWritingSystems().

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QRawFont>>)

Swaps this raw font with other. This function is very fast and never fails.

Calls C++ function: void QRawFont::swap(QRawFont& other).

C++ documentation:

Swaps this raw font with other. This function is very fast and never fails.

This function was introduced in Qt 5.0.

source

pub unsafe fn underline_position(&self) -> c_double

Returns the position from baseline for drawing underlines below the text rendered with this font.

Calls C++ function: double QRawFont::underlinePosition() const.

C++ documentation:

Returns the position from baseline for drawing underlines below the text rendered with this font.

source

pub unsafe fn units_per_em(&self) -> c_double

Returns the number of design units define the width and height of the em square for this QRawFont. This value is used together with the pixel size when converting design metrics to pixel units, as the internal metrics are specified in design units and the pixel size gives the size of 1 em in pixels.

Calls C++ function: double QRawFont::unitsPerEm() const.

C++ documentation:

Returns the number of design units define the width and height of the em square for this QRawFont. This value is used together with the pixel size when converting design metrics to pixel units, as the internal metrics are specified in design units and the pixel size gives the size of 1 em in pixels.

See also pixelSize() and setPixelSize().

source

pub unsafe fn weight(&self) -> c_int

Returns the weight of this QRawFont.

Calls C++ function: int QRawFont::weight() const.

C++ documentation:

Returns the weight of this QRawFont.

See also QFont::weight().

source

pub unsafe fn x_height(&self) -> c_double

Returns the xHeight of this QRawFont in pixel units.

Calls C++ function: double QRawFont::xHeight() const.

C++ documentation:

Returns the xHeight of this QRawFont in pixel units.

This is often but not always the same as the height of the character 'x'.

See also QFontMetricsF::xHeight().

Trait Implementations§

source§

impl CppDeletable for QRawFont

source§

unsafe fn delete(&self)

Destroys the QRawFont

Calls C++ function: [destructor] void QRawFont::~QRawFont().

C++ documentation:

Destroys the QRawFont

source§

impl PartialEq<Ref<QRawFont>> for QRawFont

source§

fn eq(&self, other: &Ref<QRawFont>) -> bool

Returns true if this QRawFont is equal to other. Otherwise, returns false.

Calls C++ function: bool QRawFont::operator==(const QRawFont& other) const.

C++ documentation:

Returns true if this QRawFont is equal to other. Otherwise, returns false.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.