The QFontInfo class provides general information about fonts. More...
#include <qfontinfo.h>
The QFontInfo class mirrors QFont exactly, but where QFont access functions returns set values, QFontInfo returns the values that apply to the font in use.
For example, when the program asks for a 25pt Courier font on a machine that has a 24pt Courier font but not a scalable one, QFont will (normally) use the 24pt Courier for rendering. In this case, QFont::pointSize() returns 25 and QFontInfo::pointSize() 24.
The access functions in QFontInfo mirror QFont exactly, except for this difference.
There are three ways to create a QFontInfo object.
The QFontInfo constructor with a QFont creates a font info object for a screen-compatible font, i.e. the font can not be a printer font.
QWidget::fontInfo() returns the font info for a widget's font. This is equivalent to QFontInfo(widget->font()). Setting a new font for the widget later does not affect the font info object.
QPainter::fontInfo() returns the font info for a painter's current font. The font info object is automatically updated if somebody sets a new painter font, unlike the two above cases, which take a "snapshot" of a font.
See also QFont and QFontMetrics.
Constructs a font info object for font.
The font must be screen-compatible, i.e. a font you use when drawing text in widgets or pixmaps. If font is a printer font, you'll probably get wrong results.
Use the QPainter::fontInfo() to get the font info when painting. This is a little slower than using this constructor, but it always gives correct results.
Constructs a copy of fi.
Destructs the font info object.
Returns TRUE if weight() would return a greater than
QFont::Normal,
and FALSE otherwise.
See also weight() and QFont::bold().
Returns the character set of the matched window system font.
See also QFont::charSet().
Returns TRUE if the matched window system font is exactly the one specified by the font.
See also QFont::exactMatch().
Returns the family name of the matched window system font.
See also QFont::family().
Returns the fixed pitch value of the matched window system font. A fixed pitch font is a font that has constant character pixel width.
See also QFont::fixedPitch().
Returns the italic value of the matched window system font.
See also QFont::italic().
Font info assignment.
Returns the point size of the matched window system font.
See also QFont::pointSize().
Returns TRUE if the font is a raw mode font.
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 the strike out value of the matched window system font.
See also QFont::strikeOut().
Returns the style of the matched window system font.
Currently only returns the hint set in QFont.
See also QFont::styleHint().
Returns the underline value of the matched window system font.
See also QFont::underline().
Returns the weight of the matched window system font.
See also QFont::weight() and bold().
Search the documentation, FAQ, qt-interest archive and more (uses
www.trolltech.com):
This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.
Copyright İ 2000 Trolltech | Trademarks | Qt version 2.2.1
|