QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Static Public Member Functions | List of all members
QgsFontUtils Class Reference

#include <qgsfontutils.h>

Static Public Member Functions

static bool fontMatchOnSystem (const QFont &f)
 Check whether exact font is on system.
static bool fontFamilyOnSystem (const QString &family)
 Check whether font family is on system in a quick manner, which does not compare [foundry].
static bool fontFamilyMatchOnSystem (const QString &family, QString *chosen=0, bool *match=0)
 Check whether font family is on system.
static bool updateFontViaStyle (QFont &f, const QString &fontstyle, bool fallback=false)
 Updates font with named style and retain all font properties.

Detailed Description

Definition at line 22 of file qgsfontutils.h.

Member Function Documentation

bool QgsFontUtils::fontFamilyMatchOnSystem ( const QString &  family,
QString *  chosen = 0,
bool *  match = 0 
)
static

Check whether font family is on system.

Parameters
familyThe family to test
chosenThe actual family (possibly from different foundry) returned by system
matchWhether the family [foundry] returned by system is a match
Returns
Whether family was found on system

Definition at line 38 of file qgsfontutils.cpp.

Referenced by QgsPalLayerSettings::readFromLayer().

bool QgsFontUtils::fontFamilyOnSystem ( const QString &  family)
static

Check whether font family is on system in a quick manner, which does not compare [foundry].

Parameters
familyThe family to test
Returns
Whether family was found on system
Note
This is good for use in loops of large lists, e.g. registering many features for labeling

Definition at line 31 of file qgsfontutils.cpp.

Referenced by QgsPalLayerSettings::parseTextStyle().

bool QgsFontUtils::fontMatchOnSystem ( const QFont &  f)
static

Check whether exact font is on system.

Parameters
fThe font to test for match

Definition at line 25 of file qgsfontutils.cpp.

bool QgsFontUtils::updateFontViaStyle ( QFont &  f,
const QString &  fontstyle,
bool  fallback = false 
)
static

Updates font with named style and retain all font properties.

Parameters
fThe font to update
fontstyleThe style to try and switch the font to
fallbackIf no matching fontstyle found for font, assign most similar or first style found to font
Returns
Whether the font was updated (also returns true if the requested style matches font's current style)
Note
This is a more featured replacement for a Qt 4.8+ function: void QFont::setStyleName ( const QString & styleName )

Definition at line 91 of file qgsfontutils.cpp.

Referenced by QgsPalLayerSettings::parseTextStyle(), and QgsPalLayerSettings::readFromLayer().


The documentation for this class was generated from the following files: