mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
add QgsFontUtils sip bindings and fix doxygen warnings
This commit is contained in:
parent
caaaa218b5
commit
e4b278d6ed
@ -87,6 +87,7 @@
|
|||||||
%Include qgsvectorlayerjoinbuffer.sip
|
%Include qgsvectorlayerjoinbuffer.sip
|
||||||
%Include qgsvectorlayerundocommand.sip
|
%Include qgsvectorlayerundocommand.sip
|
||||||
%Include qgsvectoroverlay.sip
|
%Include qgsvectoroverlay.sip
|
||||||
|
%Include qgsfontutils.sip
|
||||||
|
|
||||||
%Include composer/qgsaddremoveitemcommand.sip
|
%Include composer/qgsaddremoveitemcommand.sip
|
||||||
%Include composer/qgsaddremovemultiframecommand.sip
|
%Include composer/qgsaddremovemultiframecommand.sip
|
||||||
|
36
python/core/qgsfontutils.sip
Normal file
36
python/core/qgsfontutils.sip
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
class QgsFontUtils
|
||||||
|
{
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include <qgsfontutils.h>
|
||||||
|
%End
|
||||||
|
public:
|
||||||
|
/** Check whether exact font is on system
|
||||||
|
* @param f The font to test for match
|
||||||
|
*/
|
||||||
|
static bool fontMatchOnSystem( const QFont& f );
|
||||||
|
|
||||||
|
/** Check whether font family is on system in a quick manner, which does not compare [foundry]
|
||||||
|
* @param family The 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
|
||||||
|
*/
|
||||||
|
static bool fontFamilyOnSystem( const QString& family );
|
||||||
|
|
||||||
|
/** Check whether font family is on system
|
||||||
|
* @param family The family to test
|
||||||
|
* @param chosen The actual family (possibly from different foundry) returned by system
|
||||||
|
* @param match Whether the family [foundry] returned by system is a match
|
||||||
|
* @returns Whether family was found on system
|
||||||
|
*/
|
||||||
|
static bool fontFamilyMatchOnSystem( const QString& family, QString* chosen = 0, bool* match = 0 );
|
||||||
|
|
||||||
|
/** Updates font with named style and retain all font properties
|
||||||
|
* @param f The font to update
|
||||||
|
* @param fontstyle The style to try and switch the font to
|
||||||
|
* @param fallback If 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 )
|
||||||
|
*/
|
||||||
|
static bool updateFontViaStyle( QFont& f, const QString& fontstyle, bool fallback = false );
|
||||||
|
|
||||||
|
};
|
@ -23,7 +23,7 @@ class CORE_EXPORT QgsFontUtils
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/** Check whether exact font is on system
|
/** Check whether exact font is on system
|
||||||
* @param font The font to test for match
|
* @param f The font to test for match
|
||||||
*/
|
*/
|
||||||
static bool fontMatchOnSystem( const QFont& f );
|
static bool fontMatchOnSystem( const QFont& f );
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ class CORE_EXPORT QgsFontUtils
|
|||||||
static bool fontFamilyMatchOnSystem( const QString& family, QString* chosen = 0, bool* match = 0 );
|
static bool fontFamilyMatchOnSystem( const QString& family, QString* chosen = 0, bool* match = 0 );
|
||||||
|
|
||||||
/** Updates font with named style and retain all font properties
|
/** Updates font with named style and retain all font properties
|
||||||
* @param font The font to update
|
* @param f The font to update
|
||||||
* @param fontstyle The style to try and switch the font to
|
* @param fontstyle The style to try and switch the font to
|
||||||
* @param fallback If no matching fontstyle found for font, assign most similar or first style found to font
|
* @param fallback If 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)
|
* @returns Whether the font was updated (also returns true if the requested style matches font's current style)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user