Struct rute::auto::font_info::FontInfo

source ·
pub struct FontInfo<'a> { /* private fields */ }
Expand description

Notice these docs are heavy WIP and not very relevent yet

The QFontInfo class provides the same access functions as QFont, e.g. family(), pointSize(), italic(), weight(), fixedPitch(), styleHint() etc. But whilst the QFont access functions return the values that were set, a QFontInfo object returns the values that apply to the font that will actually be used to draw the text.

For example, when the program asks for a 25pt Courier font on a machine that has a non-scalable 24pt Courier font, QFont will (normally) use the 24pt Courier for rendering. In this case, QFont::pointSize() returns 25 and QFontInfo::pointSize() returns 24.

There are three ways to create a QFontInfo object.

  • Calling the QFontInfo constructor with a QFont creates a font info object for a screen-compatible font, i.e. the font cannot be a printer font. If the font is changed later, the font info object is not updated. (Note: If you use a printer font the values returned may be inaccurate. Printer fonts are not always accessible so the nearest screen font is used if a printer font is supplied.)
  • QWidget::fontInfo() returns the font info for a widget’s font. This is equivalent to calling QFontInfo(widget->font()). If the widget’s font is changed later, the font info object is not updated.
  • QPainter::fontInfo() returns the font info for a painter’s current font. If the painter’s font is changed later, the font info object is not updated.

See also: QFont QFontMetrics QFontDatabase

Licence

The documentation is an adoption of the original Qt Documentation and provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.

Implementations

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

Returns the family name of the matched window system font.

See also: QFont::family()

Returns the style name of the matched window system font on systems that support it.

See also: QFont::styleName()

Returns the pixel size of the matched window system font.

See also: QFont::pointSize()

Returns the point size of the matched window system font.

See also: pointSizeF() QFont::pointSize()

Returns the point size of the matched window system font.

See also: QFont::pointSizeF()

Returns the point size of the matched window system font.

See also: QFont::pointSizeF()

Returns the italic value of the matched window system font.

See also: QFont::italic()

Returns the style name of the matched window system font on systems that support it.

See also: QFont::styleName()

Returns the style value of the matched window system font.

See also: QFont::style()

Returns the style of the matched window system font.

Currently only returns the style hint set in QFont.

See also: QFont::styleHint() QFont::StyleHint

Returns the weight of the matched window system font.

See also: QFont::weight() bold()

Returns true if weight() would return a value greater than QFont::Normal; otherwise returns false.

See also: weight() QFont::bold()

Returns the fixed pitch value of the matched window system font.

See also: QFont::fixedPitch()

Returns the style of the matched window system font.

Currently only returns the style hint set in QFont.

See also: QFont::styleHint() QFont::StyleHint

Returns true if the font is a raw mode font; otherwise returns false.

If it is a raw mode font, all other functions in QFontInfo will return the same values set in the QFont, regardless of the font actually used.

See also: QFont::rawMode()

Returns true if the matched window system font is exactly the same as the one specified by the font; otherwise returns false.

See also: QFont::exactMatch()

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.