Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Classes  ·  Annotées  ·  Hiérarchie  ·  Fonctions  ·  Structure  · 

QFontDatabase Class Reference


Provides information about available fonts. More...

#include <qfontdatabase.h>

List of all member functions.

Public Members

  • QFontDatabase () 
  • QStringList families ( bool onlyForLocale = TRUE ) const
  • QValueList<int> pointSizes ( const QString & family, const QString & style = QString::null, const QString & charSet = QString::null ) 
  • QStringList styles ( const QString & family, const QString & charSet = QString::null ) const
  • QStringList charSets ( const QString & familyName, bool onlyForLocale = TRUE ) const
  • QFont font ( const QString familyName, const QString & style, int pointSize, const QString charSetName = QString::null ) 
  • bool isBitmapScalable ( const QString & family, const QString & style = QString::null, const QString & charSet = QString::null ) const
  • bool isSmoothlyScalable ( const QString & family, const QString & style = QString::null, const QString & charSet = QString::null ) const
  • bool isScalable ( const QString & family, const QString & style = QString::null, const QString & charSet = QString::null ) const
  • bool isFixedPitch ( const QString & family, const QString & style = QString::null, const QString & charset = QString::null ) const
  • QValueList<int> smoothSizes ( const QString & family, const QString & style, const QString & charSet = QString::null ) 
  • bool italic ( const QString & family, const QString & style, const QString & charSet = QString::null ) const
  • bool bold ( const QString & family, const QString & style, const QString & charSet = QString::null ) const
  • int weight ( const QString & family, const QString & style, const QString & charSet = QString::null ) const
  • QString styleString ( const QFont & ) 

Static Public Members


Detailed Description

Provides information about available fonts.

QFontDatabase provides information about the 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(), styles() and charSets().


Member Function Documentation

QFontDatabase::QFontDatabase ()

Creates a font database object.

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

Returns if the font which matches the settings family, style and charSet is bold or not.

See also italic() and weight().

QString QFontDatabase::charSetSample ( const QString & charSetName ) [static]

Returns some sample characters which are in the charset charSetName.

QStringList QFontDatabase::charSets ( const QString & family, bool onlyForLocale = TRUE ) const

Returns a list of all char sets in which the font family is available in the current locale if onlyForLocale is TRUE, otherwise all charsets of family independent of the locale are returned.

QStringList QFontDatabase::families ( bool onlyForLocale = TRUE ) const

Returns a list of names of all available font families in the current locale if onlyForLocale is TRUE, otherwise really all available font families independent of the current locale are returned.

If a family exists in several foundries, the returned name will be "foundry-family".

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

Returns a QFont object which matches the settings of family, style, pointSize and charSet. 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 QString & charSet = QString::null ) const

Returns whether the font which matches family, style and charSet is a scaleable bitmap font. Scaling a bitmap font produces a bad, often hardly readable result, as 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 QString & charSet = QString::null ) const

Returns whether the font which matches family, style and charSet is fixed pitch.

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

Returns TRUE if the font which matches the settings family, style and charSet is scaleable.

See also isBitmapScalable() and isSmoothlyScalable().

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

Returns whether the font which matches family, style and charSet is a smoothly scaleable. If this function returns TRUE, it's save to scale this font to every size as the result will always look good.

See also isScalable() and isBitmapScalable().

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

Returns if the font which matches the settings family, style and charSet is italic or not.

See also weight() and bold().

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

Returns a list of all available sizes of the font family in the style style and the char set charSet.

See also smoothSizes() and standardSizes().

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

Returns the point sizes of a font which matches family, style and charSet, 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 fontsizes.

See also smoothSizes() and pointSizes().

QString QFontDatabase::styleString ( const QFont & f )

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

QStringList QFontDatabase::styles ( const QString & family, const QString & charSet = QString::null ) const

Retruns all available styles of the font family in the char set charSet.

QString QFontDatabase::verboseCharSetName ( const QString & charSetName ) [static]

Returns a string which gives a quite detailed description of the charSetName which can be used e.g. for displaying in a dialog for the user.

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

Returns the weight of the font which matches the settings family, style and charSet.

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-2005 Trolltech, all rights reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 2.3
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web