Classes - Annotated - Tree - Functions - Home - Structure

QFontDatabase Class Reference

The QFontDatabase class provides information about available fonts of the underlying window system. More...

#include <qfontdatabase.h>

List of all member functions.

Public Members

Static Public Members


Detailed Description

The QFontDatabase class provides information about available fonts of the underlying window system.

Most often you will simply want to query the database for all font families(), and their respective pointSizes() and styles().


Member Function Documentation

QFontDatabase::QFontDatabase ()

Creates a font database object.

bool QFontDatabase::bold ( const QString & family, const QString & style ) const

Returns whether the font that matches the settings family and style is bold or not.

See also italic() and weight().

QStringList QFontDatabase::families () const

Returns a list of names of all available font families.

If a family exists in several foundries, the returned name for that font is "foundry-family".

QFont QFontDatabase::font ( const QString & family, const QString & style, int pointSize )

Returns a QFont object that matches the settings of family, style and pointSize. If no matching font could be created, an empty QFont object is returned.

bool QFontDatabase::isBitmapScalable ( const QString & family, const QString & style = QString::null ) const

Returns whether the font that matches family and style is a scalable bitmap font. Scaling a bitmap font produces a bad, often hardly readable, result because the pixels of the font are scaled. It's better to scale such a font only to the available fixed sizes (which you can get with smoothSizes()).

See also isScalable() and isSmoothlyScalable().

bool QFontDatabase::isFixedPitch ( const QString & family, const QString & style = QString::null ) const

Returns TRUE if the font that matches family and style is fixed pitch.

bool QFontDatabase::isScalable ( const QString & family, const QString & style = QString::null ) const

Returns TRUE if the font that matches the settings family and style is scalable.

See also isBitmapScalable() and isSmoothlyScalable().

bool QFontDatabase::isSmoothlyScalable ( const QString & family, const QString & style = QString::null ) const

Returns whether the font that matches family and style is smoothly scalable. If this function returns TRUE, it's safe to scale this font to every size. The result will always look decent.

See also isScalable() and isBitmapScalable().

bool QFontDatabase::italic ( const QString & family, const QString & style ) const

Returns if the font that matches the settings family and style is italic or not.

See also weight() and bold().

QValueList<int> QFontDatabase::pointSizes ( const QString & family, const QString & style = QString::null )

Returns a list of all available sizes of the font family in the style style.

See also smoothSizes() and standardSizes().

QString QFontDatabase::scriptName ( QFont::Script script ) [static]

Returns a string that gives a default description of the script (e.g. for display in a dialog for the user). The name matches the name of the script as indicated by Unicode 3.0.

QString QFontDatabase::scriptSample ( QFont::Script script ) [static]

Returns a string with sample characters from script.

QValueList<int> QFontDatabase::smoothSizes ( const QString & family, const QString & style )

Returns the point sizes of a font that matches family and style that is guaranteed to look good. For non-scalable fonts and smoothly scalable fonts, this function is equivalent to pointSizes().

See also pointSizes() and standardSizes().

QValueList<int> QFontDatabase::standardSizes () [static]

Returns a list of standard font sizes.

See also smoothSizes() and pointSizes().

QString QFontDatabase::styleString ( const QFont & f )

Returns a string that describes the style of the font f. This is something like "Bold Italic".

QStringList QFontDatabase::styles ( const QString & family ) const

Returns all available styles of the font family.

int QFontDatabase::weight ( const QString & family, const QString & style ) const

Returns the weight of the font that matches the settings family and style.

See also italic() 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 TrolltechTrademarks
Qt version main-beta1