GfFont

GfFont — GfFont Object API

Synopsis




            GfFont;
enum        GfFontMask;
enum        GfFontStretch;
enum        GfFontStyle;
enum        GfFontVariant;
enum        GfFontWeight;
GfFont*     gf_font_new                     ();
GfFont*     gf_font_copy                    (const GfFont *font);
void        gf_font_free                    (GfFont *font);
void        gf_font_set_family              (GfFont *font,
                                             const gchar *family);
const gchar* gf_font_get_family             (const GfFont *font);
void        gf_font_set_style               (GfFont *font,
                                             GfFontStyle style);
GfFontStyle gf_font_get_style               (const GfFont *font);
void        gf_font_set_variant             (GfFont *font,
                                             GfFontVariant variant);
GfFontVariant gf_font_get_variant           (const GfFont *font);
void        gf_font_set_weight              (GfFont *font,
                                             GfFontWeight weight);
GfFontWeight gf_font_get_weight             (const GfFont *font);
void        gf_font_set_stretch             (GfFont *font,
                                             GfFontStretch stretch);
GfFontStretch gf_font_get_stretch           (const GfFont *font);
void        gf_font_set_size                (GfFont *font,
                                             gint size);
gint        gf_font_get_size                (const GfFont *font);
void        gf_font_set_absolute_size       (GfFont *font,
                                             double size);
gboolean    gf_font_get_size_is_absolute    (const GfFont *font);
void        gf_font_set_mask                (GfFont *font,
                                             GfFontMask mask);
GfFontMask  gf_font_get_mask                (const GfFont *font);
gboolean    gf_font_equal                   (const GfFont *f1,
                                             const GfFont *f2);
#define     gf_font_style_from_string       (str)
#define     gf_font_style_to_string         (style, i18n)
#define     gf_font_variant_from_string     (str)
#define     gf_font_variant_to_string       (variant, i18n)
#define     gf_font_weight_from_string      (str)
#define     gf_font_weight_to_string        (weight, i18n)
#define     gf_font_stretch_from_string     (str)
#define     gf_font_stretch_to_string       (stretch, i18n)
#define     gf_font_mask_from_string        (str)
#define     gf_font_mask_to_string          (mask, i18n)

Description

GfFont is a user interface abstracted interface for handling fonts.

Details

GfFont

typedef struct _GfFont GfFont;

GfFont is an opaque structure that should not be used directly.


enum GfFontMask

typedef enum _GfFontMask {
	GF_FONT_MASK_FAMILY		= 1 << 0,
	GF_FONT_MASK_STYLE		= 1 << 1,
	GF_FONT_MASK_VARIANT	= 1 << 2,
	GF_FONT_MASK_WEIGHT		= 1 << 3,
	GF_FONT_MASK_STRETCH	= 1 << 4,
	GF_FONT_MASK_SIZE		= 1 << 5
} GfFontMask;

Font mask values.

GF_FONT_MASK_FAMILY Family.
GF_FONT_MASK_STYLE Style.
GF_FONT_MASK_VARIANT Variant.
GF_FONT_MASK_WEIGHT Weight.
GF_FONT_MASK_STRETCH Stretch.
GF_FONT_MASK_SIZE Size.

enum GfFontStretch

typedef enum _GfFontStretch {
	GF_FONT_STRETCH_ULTRA_CONDENSED,
	GF_FONT_STRETCH_EXTRA_CONDENSED,
	GF_FONT_STRETCH_CONDENSED,
	GF_FONT_STRETCH_SEMI_CONDENSED,
	GF_FONT_STRETCH_NORMAL,
	GF_FONT_STRETCH_SEMI_EXPANDED,
	GF_FONT_STRETCH_EXPANDED,
	GF_FONT_STRETCH_EXTRA_EXPANDED,
	GF_FONT_STRETCH_ULTRA_EXPANDED
} GfFontStretch;

Font stretch values.

GF_FONT_STRETCH_ULTRA_CONDENSED Ultra-Condensed.
GF_FONT_STRETCH_EXTRA_CONDENSED Extra-Condensed.
GF_FONT_STRETCH_CONDENSED Condensed.
GF_FONT_STRETCH_SEMI_CONDENSED Semi-Condensed.
GF_FONT_STRETCH_NORMAL Normal.
GF_FONT_STRETCH_SEMI_EXPANDED Semi-Expanded.
GF_FONT_STRETCH_EXPANDED Expanded.
GF_FONT_STRETCH_EXTRA_EXPANDED Extra-Expanded.
GF_FONT_STRETCH_ULTRA_EXPANDED Ultra-Expanded.

enum GfFontStyle

typedef enum _GfFontStyle {
	GF_FONT_STYLE_NORMAL,
	GF_FONT_STYLE_OBLIQUE,
	GF_FONT_STYLE_ITALIC
} GfFontStyle;

Font styles.

GF_FONT_STYLE_NORMAL Normal
GF_FONT_STYLE_OBLIQUE Oblique
GF_FONT_STYLE_ITALIC Italic

enum GfFontVariant

typedef enum _GfFontVariant{
	GF_FONT_VARIANT_NORMAL,
	GF_FONT_VARIANT_SMALL_CAPS
} GfFontVariant;

Font variants.

GF_FONT_VARIANT_NORMAL Normal.
GF_FONT_VARIANT_SMALL_CAPS Small caps.

enum GfFontWeight

typedef enum _GfFontWeight {
	GF_FONT_WEIGHT_ULTRA_LIGHT = 200,
	GF_FONT_WEIGHT_LIGHT = 300,
	GF_FONT_WEIGHT_NORMAL = 400,
	GF_FONT_WEIGHT_SEMIBOLD = 600,
	GF_FONT_WEIGHT_BOLD = 700,
	GF_FONT_WEIGHT_ULTRABOLD = 800,
	GF_FONT_WEIGHT_HEAVY = 900
} GfFontWeight;

Font weights.

GF_FONT_WEIGHT_ULTRA_LIGHT Ultra-Light
GF_FONT_WEIGHT_LIGHT Light
GF_FONT_WEIGHT_NORMAL Normal
GF_FONT_WEIGHT_SEMIBOLD Semi-Bold
GF_FONT_WEIGHT_BOLD Bold
GF_FONT_WEIGHT_ULTRABOLD Ultra-Bold
GF_FONT_WEIGHT_HEAVY Heavy

gf_font_new ()

GfFont*     gf_font_new                     ();

Creates a new GfFont instance.

Returns : The new GfFont instance.

gf_font_copy ()

GfFont*     gf_font_copy                    (const GfFont *font);

Creates a copy of font.

font : The GfFont instance to copy.
Returns : A copy of font.

gf_font_free ()

void        gf_font_free                    (GfFont *font);

Frees font.

font : The GfFont instance to free.

gf_font_set_family ()

void        gf_font_set_family              (GfFont *font,
                                             const gchar *family);

Sets the family of font to family.

font : The GfFont instance.
family : The new family.

gf_font_get_family ()

const gchar* gf_font_get_family             (const GfFont *font);

Gets the family of font.

font : The GfFont instance.
Returns : The family of font.

gf_font_set_style ()

void        gf_font_set_style               (GfFont *font,
                                             GfFontStyle style);

Sets the style of font to style.

font : The GfFont instance.
style : The new style.

gf_font_get_style ()

GfFontStyle gf_font_get_style               (const GfFont *font);

Gets the style of font.

font : The GfFont instance.
Returns : The style of font.

gf_font_set_variant ()

void        gf_font_set_variant             (GfFont *font,
                                             GfFontVariant variant);

Sets the variant of font to variant.

font : The GfFont instance.
variant : The new variant.

gf_font_get_variant ()

GfFontVariant gf_font_get_variant           (const GfFont *font);

Gets the variant of font.

font : The GfFont instance.
Returns : The variant of font.

gf_font_set_weight ()

void        gf_font_set_weight              (GfFont *font,
                                             GfFontWeight weight);

Sets the weight of font to weight.

font : The GfFont instance.
weight : The new weight.

gf_font_get_weight ()

GfFontWeight gf_font_get_weight             (const GfFont *font);

Gets the weight of font.

font : The GfFont instance.
Returns : The weight of font.

gf_font_set_stretch ()

void        gf_font_set_stretch             (GfFont *font,
                                             GfFontStretch stretch);

Sets the stretch of font to stretch.

font : The GfFont instance.
stretch : The new stretch.

gf_font_get_stretch ()

GfFontStretch gf_font_get_stretch           (const GfFont *font);

Gets the stretch of font.

font : The GfFont instance.
Returns : The stretch of font.

gf_font_set_size ()

void        gf_font_set_size                (GfFont *font,
                                             gint size);

Sets the size of font to size.

font : The GfFont instance.
size : The new size.

gf_font_get_size ()

gint        gf_font_get_size                (const GfFont *font);

Gets the size of font.

font : The GfFont instance.
Returns : The size of font.

gf_font_set_absolute_size ()

void        gf_font_set_absolute_size       (GfFont *font,
                                             double size);

Sets the absolute size of font to size.

font : The GfFont instance.
size : THe new absolute size.

gf_font_get_size_is_absolute ()

gboolean    gf_font_get_size_is_absolute    (const GfFont *font);

Gets whether or not font has an absolute size.

font : The GfFont instance.
Returns : TRUE if font has an absolute size.

gf_font_set_mask ()

void        gf_font_set_mask                (GfFont *font,
                                             GfFontMask mask);

Sets the GfFontMask for font to mask.

font : The GfFont instance.
mask : The new mask.

gf_font_get_mask ()

GfFontMask  gf_font_get_mask                (const GfFont *font);

Gets the GfFontMask for font.

font : The GfFont instance.
Returns : The GfFontMask of font.

gf_font_equal ()

gboolean    gf_font_equal                   (const GfFont *f1,
                                             const GfFont *f2);

Checks whether two GfFont's are equal.

f1 : The first GfFont instance.
f2 : The second GfFont instance.
Returns : TRUE if f1 is equal to f2.

gf_font_style_from_string()

#define     gf_font_style_from_string(str)

Gets a GfFontStyle from a string.

Note: str MUST be the untranslated string!

str : The string.
Returns : The GfFontStyle.

gf_font_style_to_string()

#define     gf_font_style_to_string(style, i18n)

Gets a string from a GfFontStyle

style : The GfFontStyle.
i18n : TRUE to get the translated string.
Returns : style as a string.

gf_font_variant_from_string()

#define     gf_font_variant_from_string(str)

Gets a GfFontVariant from a string.

Note: str MUST be the untranslated string!

str : The string.
Returns : The GfFontVariant.

gf_font_variant_to_string()

#define     gf_font_variant_to_string(variant, i18n)

Gets a string from a GfFontVariant.

variant : The GfFontVariant.
i18n : TRUE for the translated string.
Returns : variant as a string.

gf_font_weight_from_string()

#define     gf_font_weight_from_string(str)

Gets a GfFontWeight from a string.

Note: str MUST be the untranslated string!

str : The string.
Returns : The GfFontWeight.

gf_font_weight_to_string()

#define     gf_font_weight_to_string(weight, i18n)

Gets a string from a GfFontWeight.

weight : The GfFontWeight.
i18n : TRUE for the translated version.
Returns : weight as a string.

gf_font_stretch_from_string()

#define     gf_font_stretch_from_string(str)

Gets a GfFontStretch from a string.

Note: str MUST be the untranslated string!

str : The string.
Returns : The GfFontStretch.

gf_font_stretch_to_string()

#define     gf_font_stretch_to_string(stretch, i18n)

Gets a string from a GfFontStretch.

stretch : The GfFontStretch.
i18n : TRUE for the translated version.
Returns : stretch as a string.

gf_font_mask_from_string()

#define     gf_font_mask_from_string(str)

Gets a GfFontMask from a string.

Note: str MUST be the untranslated string!

str : The string.
Returns : The GfFontMask.

gf_font_mask_to_string()

#define     gf_font_mask_to_string(mask, i18n)

Gets a string from a GfFontMask.

mask : The GfFontMask.
i18n : TRUE for the translated version.
Returns : mask as a string.