![]() |
Home · Overviews · Examples |
The QFontInfo class provides general information about fonts. More...
The QFontInfo class provides general information about fonts.
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.
(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.)
See also QFont, QFontMetrics, and QFontDatabase.
Copyright © 2008 Trolltech | Trademarks | Qt Jambi 4.3.5_01 |