ezfc_font_t

ezfc_font_t — A class for managing the font properties

Synopsis

gboolean            ezfc_font_add_family                (ezfc_font_t *font,
                                                         const gchar *font_name,
                                                         GError **error);
gboolean            ezfc_font_add_feature               (ezfc_font_t *font,
                                                         const gchar *feature);
GList *             ezfc_font_canonicalize              (ezfc_font_t *font,
                                                         GError **error);
void                ezfc_font_check_existence           (ezfc_font_t *font,
                                                         gboolean flag);
gboolean            ezfc_font_find                      (ezfc_font_t *font,
                                                         const gchar *font_name);
GList *             ezfc_font_get_alias_name_from_pattern
                                                        (const FcPattern *pattern);
gboolean            ezfc_font_get_antialiasing          (ezfc_font_t *font);
gboolean            ezfc_font_get_autohinting           (ezfc_font_t *font);
GList *             ezfc_font_get_available_features    (ezfc_font_t *font);
gboolean            ezfc_font_get_embedded_bitmap       (ezfc_font_t *font);
GList *             ezfc_font_get_families              (ezfc_font_t *font);
const gchar *       ezfc_font_get_family                (ezfc_font_t *font);
GList *             ezfc_font_get_features              (ezfc_font_t *font);
gboolean            ezfc_font_get_hinting               (ezfc_font_t *font);
ezfc_font_hintstyle_t ezfc_font_get_hintstyle           (ezfc_font_t *font);
GList *             ezfc_font_get_list                  (const gchar *language,
                                                         const gchar *alias_name,
                                                         gboolean localized_font_name);
FcPattern *         ezfc_font_get_pattern               (ezfc_font_t *font);
GList *             ezfc_font_get_pattern_list          (const gchar *language,
                                                         const gchar *alias_name);
gint                ezfc_font_get_rgba                  (ezfc_font_t *font);
ezfc_font_subpixel_render_t ezfc_font_get_subpixel_rendering
                                                        (ezfc_font_t *font);
enum                ezfc_font_hintstyle_t;
gboolean            ezfc_font_is_alias_font             (const gchar *alias_name);
ezfc_font_t *       ezfc_font_new                       (void);
ezfc_font_t *       ezfc_font_ref                       (ezfc_font_t *font);
gboolean            ezfc_font_remove                    (ezfc_font_t *font,
                                                         GError **error);
gboolean            ezfc_font_remove_family             (ezfc_font_t *font,
                                                         const gchar *font_name,
                                                         GError **error);
gboolean            ezfc_font_remove_feature            (ezfc_font_t *font,
                                                         const gchar *feature);
void                ezfc_font_set_antialiasing          (ezfc_font_t *font,
                                                         gboolean flag);
void                ezfc_font_set_autohinting           (ezfc_font_t *font,
                                                         gboolean flag);
void                ezfc_font_set_embedded_bitmap       (ezfc_font_t *font,
                                                         gboolean flag);
gboolean            ezfc_font_set_family                (ezfc_font_t *font,
                                                         const gchar *font_name,
                                                         GError **error);
void                ezfc_font_set_hinting               (ezfc_font_t *font,
                                                         gboolean flag);
void                ezfc_font_set_hintstyle             (ezfc_font_t *font,
                                                         ezfc_font_hintstyle_t hintstyle);
gboolean            ezfc_font_set_pattern               (ezfc_font_t *font,
                                                         const FcPattern *pattern,
                                                         GError **error);
void                ezfc_font_set_rgba                  (ezfc_font_t *font,
                                                         gint val);
gboolean            ezfc_font_set_subpixel_rendering    (ezfc_font_t *font,
                                                         ezfc_font_subpixel_render_t mode);
enum                ezfc_font_subpixel_render_t;
                    ezfc_font_t;
void                ezfc_font_unref                     (ezfc_font_t *font);

Description

This class provides an easy access to the font properties

Details

ezfc_font_add_family ()

gboolean            ezfc_font_add_family                (ezfc_font_t *font,
                                                         const gchar *font_name,
                                                         GError **error);

Add font_name as the font family name used for the font font.

font :

a ezfc_font_t.

font_name :

a font name.

error :

a GError. [allow-none]

Returns :

TRUE if it successfully is set. otherwise FALSE.

Since 0.11


ezfc_font_add_feature ()

gboolean            ezfc_font_add_feature               (ezfc_font_t *font,
                                                         const gchar *feature);

Add feature font feature to font.

font :

a ezfc_font_t.

feature :

feature name to be added

Returns :

TRUE if it's successfully completed, otherwise FALSE.

Since 0.12


ezfc_font_canonicalize ()

GList *             ezfc_font_canonicalize              (ezfc_font_t *font,
                                                         GError **error);

Split up font to ezfc_font_t that has one family name only.

font :

a ezfc_font_t.

error :

a GError. [allow-none]

Returns :

a GList contains ezfc_font_t, otherwise NULL. [transfer full][element-type ezfc_font_t]

Since 0.11


ezfc_font_check_existence ()

void                ezfc_font_check_existence           (ezfc_font_t *font,
                                                         gboolean flag);

Set a flag whether checking the font existence when invoking ezfc_font_set_family().

font :

a ezfc_font_t.

flag :

a boolean value.

ezfc_font_find ()

gboolean            ezfc_font_find                      (ezfc_font_t *font,
                                                         const gchar *font_name);

Check if font contains font_name.

font :

a ezfc_font_t.

font_name :

a font name.

Returns :

TRUE if it contains, otherwise FALSE.

Since 0.11


ezfc_font_get_alias_name_from_pattern ()

GList *             ezfc_font_get_alias_name_from_pattern
                                                        (const FcPattern *pattern);

Analize pattern and returns a alias name string according to the result.

pattern :

a FcPattern.

Returns :

a GList containing a static string for the alias name. [transfer container][element-type utf8]

ezfc_font_get_antialiasing ()

gboolean            ezfc_font_get_antialiasing          (ezfc_font_t *font);

Obtain a boolean value about the anti-aliasing usage in font.

font :

a ezfc_font_t.

Returns :

TRUE if the antialiasing is enabled. otherwise FALSE.

ezfc_font_get_autohinting ()

gboolean            ezfc_font_get_autohinting           (ezfc_font_t *font);

Obtain a boolean value about the auto-hinting usage in font.

font :

a ezfc_font_t.

Returns :

TRUE if the auto-hinting is enabled. otherwise FALSE.

ezfc_font_get_available_features ()

GList *             ezfc_font_get_available_features    (ezfc_font_t *font);

Obtains available font features in font.

font :

a ezfc_font_t.

Returns :

a GList containing memory-allocated string of feature name that is available in font. strings in GList has to be freed when it isn't needed anymore. [transfer full][element-type utf8]

Since 0.12


ezfc_font_get_embedded_bitmap ()

gboolean            ezfc_font_get_embedded_bitmap       (ezfc_font_t *font);

Obtain a boolean value about the embedded bitmap usage in font.

font :

a ezfc_font_t.

Returns :

TRUE if the embedded bitmap is enabled, otherwise FALSE.

ezfc_font_get_families ()

GList *             ezfc_font_get_families              (ezfc_font_t *font);

Obtains font family names in font.

font :

a ezfc_font_t.

Returns :

a GList containing the static string of font family names. [transfer container][element-type utf8]

Since 0.11


ezfc_font_get_family ()

const gchar *       ezfc_font_get_family                (ezfc_font_t *font);

Obtains the font family name in first place in font.

font :

a ezfc_font_t.

Returns :

the font name.

ezfc_font_get_features ()

GList *             ezfc_font_get_features              (ezfc_font_t *font);

Obtains font features list that font has.

font :

a ezfc_font_t.

Returns :

a GList containing the static string of feature name. [transfer container][element-type utf8]

Since 0.12


ezfc_font_get_hinting ()

gboolean            ezfc_font_get_hinting               (ezfc_font_t *font);

Obtain a boolean value about the hinting usage in font.

font :

a ezfc_font_t.

Returns :

TRUE if the hinting is enabled. otherwise FALSE.

ezfc_font_get_hintstyle ()

ezfc_font_hintstyle_t ezfc_font_get_hintstyle           (ezfc_font_t *font);

Obtain the hintstyle in font.

font :

a ezfc_font_t.

Returns :

a ezfc_font_hintstyle_t.

ezfc_font_get_list ()

GList *             ezfc_font_get_list                  (const gchar *language,
                                                         const gchar *alias_name,
                                                         gboolean localized_font_name);

Obtains the fonts list being assigned to alias_name for language.

Note that localized_font_name doesn't take effect yet. this is just a reservation for future improvement.

language :

the language name fontconfig can deal with. [allow-none]

alias_name :

the alias name to obtain the fonts list for. [allow-none]

localized_font_name :

TRUE to include the localized font name if available, FALSE for English font name only.

Returns :

a GList contains the font family name. if no valid families, NULL then. [element-type utf8][transfer full]

ezfc_font_get_pattern ()

FcPattern *         ezfc_font_get_pattern               (ezfc_font_t *font);

Obtains FcPattern in ezfc_font_t.

font :

a ezfc_font_t.

Returns :

a duplicate of FcPattern in the instance. it has to be freed. NULL if font doesn't have any font pattern.

ezfc_font_get_pattern_list ()

GList *             ezfc_font_get_pattern_list          (const gchar *language,
                                                         const gchar *alias_name);

Obtains FcPattern list being assigned to alias_name for language.

language :

the language name fontconfig can deal with. [allow-none]

alias_name :

the alias name to obtain the fonts pettern list for. [allow-none]

Returns :

a GList contains FcPattern, otherwise NULL. [element-type FcPattern][transfer full]

ezfc_font_get_rgba ()

gint                ezfc_font_get_rgba                  (ezfc_font_t *font);

Obtains current sub-pixel ordering in font.

font :

a ezfc_font_t.

Returns :

the sub-pixel ordering value in the integer.

ezfc_font_get_subpixel_rendering ()

ezfc_font_subpixel_render_t ezfc_font_get_subpixel_rendering
                                                        (ezfc_font_t *font);

Obtain current status about the sub-pixel rendering in font.

font :

a ezfc_font_t.

Returns :

current mode in the sub-pixel rendering.

enum ezfc_font_hintstyle_t

typedef enum {
	EZFC_FONT_HINTSTYLE_UNKNOWN = 0,
	EZFC_FONT_HINTSTYLE_NONE,
	EZFC_FONT_HINTSTYLE_SLIGHT,
	EZFC_FONT_HINTSTYLE_MEDIUM,
	EZFC_FONT_HINTSTYLE_FULL,
	EZFC_FONT_HINTSTYLE_END
} ezfc_font_hintstyle_t;

The hintstyle option to be used for ezfc_font_set_hintstyle().

EZFC_FONT_HINTSTYLE_UNKNOWN

unknown state in the hintstyle.

EZFC_FONT_HINTSTYLE_NONE

No use of autohinting

EZFC_FONT_HINTSTYLE_SLIGHT

Use slight autohinting

EZFC_FONT_HINTSTYLE_MEDIUM

Use medium autohinting

EZFC_FONT_HINTSTYLE_FULL

Use full autohinting

EZFC_FONT_HINTSTYLE_END

No real value, but just a terminator.

ezfc_font_is_alias_font ()

gboolean            ezfc_font_is_alias_font             (const gchar *alias_name);

Checks if alias_name is one of sans-serif, serif, monospace, cursive or fantasy.

alias_name :

the alias font name

Returns :

TRUE if alias_name is an alias font name, otherwise FALSE.

ezfc_font_new ()

ezfc_font_t *       ezfc_font_new                       (void);

Create an instance of ezfc_font_t.

Returns :

a ezfc_font_t.

ezfc_font_ref ()

ezfc_font_t *       ezfc_font_ref                       (ezfc_font_t *font);

Increases the reference count of font.

font :

a ezfc_font_t.

Returns :

the same font object. [transfer none]

ezfc_font_remove ()

gboolean            ezfc_font_remove                    (ezfc_font_t *font,
                                                         GError **error);

Removes all of families in font.

font :

a ezfc_font_t.

error :

a GError. [allow-none]

Returns :

TRUE if it's successfully completed, otherwise FALSE.

Since 0.11


ezfc_font_remove_family ()

gboolean            ezfc_font_remove_family             (ezfc_font_t *font,
                                                         const gchar *font_name,
                                                         GError **error);

Removes font_name from font.

font :

a ezfc_font_t.

font_name :

a font name to be removed.

error :

a GError. [allow-none]

Returns :

TRUE if it's successfully completed, otherwise FALSE.

Since 0.11


ezfc_font_remove_feature ()

gboolean            ezfc_font_remove_feature            (ezfc_font_t *font,
                                                         const gchar *feature);

Remove feature from font if available.

font :

a ezfc_font_t.

feature :

feature name to be removed

Returns :

TRUE if it's successfully completed, otherwise FALSE.

Since 0.12


ezfc_font_set_antialiasing ()

void                ezfc_font_set_antialiasing          (ezfc_font_t *font,
                                                         gboolean flag);

Set a flag whether the font use the antialiasing.

font :

a ezfc_font_t.

flag :

a boolean value.

ezfc_font_set_autohinting ()

void                ezfc_font_set_autohinting           (ezfc_font_t *font,
                                                         gboolean flag);

Set a flag whether the font use the auto-hinting for rendering

font :

a ezfc_font_t.

flag :

a boolean value.

ezfc_font_set_embedded_bitmap ()

void                ezfc_font_set_embedded_bitmap       (ezfc_font_t *font,
                                                         gboolean flag);

Set a flag whether the font use the embedded bitmap. Note that Enabling the embedded bitmap may causes disabling the antialias.

font :

a ezfc_font_t.

flag :

a boolean value.

ezfc_font_set_family ()

gboolean            ezfc_font_set_family                (ezfc_font_t *font,
                                                         const gchar *font_name,
                                                         GError **error);

Warning

ezfc_font_set_family is deprecated and should not be used in newly-written code. 0.11. Use ezfc_font_add_family().

Set font_name as the font family name used for the font font.

font :

a ezfc_font_t.

font_name :

a font name.

error :

a GError. [allow-none]

Returns :

TRUE if it successfully is set. otherwise FALSE.

ezfc_font_set_hinting ()

void                ezfc_font_set_hinting               (ezfc_font_t *font,
                                                         gboolean flag);

Set a flag whether the font use the own hints for rendering

font :

a ezfc_font_t.

flag :

a boolean value.

ezfc_font_set_hintstyle ()

void                ezfc_font_set_hintstyle             (ezfc_font_t *font,
                                                         ezfc_font_hintstyle_t hintstyle);

Set a hintstyle for font.

font :

a ezfc_font_t.

hintstyle :

a ezfc_font_hintstyle_t.

ezfc_font_set_pattern ()

gboolean            ezfc_font_set_pattern               (ezfc_font_t *font,
                                                         const FcPattern *pattern,
                                                         GError **error);

Set pattern as the font pattern. font keeps a duplicate instance of pattern.

font :

a ezfc_font_t.

pattern :

a FcPattern.

error :

a GError. [allow-none]

Returns :

TRUE if it successfully is set. otherwise FALSE.

ezfc_font_set_rgba ()

void                ezfc_font_set_rgba                  (ezfc_font_t *font,
                                                         gint val);

Set val as the sub-pixel ordering

font :

a ezfc_font_t.

val :

an integer value corresponding to FC_RGBA_*.

ezfc_font_set_subpixel_rendering ()

gboolean            ezfc_font_set_subpixel_rendering    (ezfc_font_t *font,
                                                         ezfc_font_subpixel_render_t mode);

This is just convenient to change the several configuration for subpixel rendering.

font :

a ezfc_font_t.

mode :

a ezfc_font_subpixel_render_t.

Returns :

TRUE if the sub-pixel rendering is enabled. otherwise FALSE.

enum ezfc_font_subpixel_render_t

typedef enum {
	EZFC_FONT_ANTIALIAS_UNKNOWN = 0,
	EZFC_FONT_ANTIALIAS_NONE,
	EZFC_FONT_ANTIALIAS_GRAY,
	EZFC_FONT_ANTIALIAS_RGB,
	EZFC_FONT_ANTIALIAS_BGR,
	EZFC_FONT_ANTIALIAS_VRGB,
	EZFC_FONT_ANTIALIAS_VBGR,
	EZFC_FONT_ANTIALIAS_END
} ezfc_font_subpixel_render_t;

The sub-pixel rendering option to be used in ezfc_font_set_subpixel_rendering().

EZFC_FONT_ANTIALIAS_UNKNOWN

unknown state on using the sub-pixel rendering.

EZFC_FONT_ANTIALIAS_NONE

no use of the sub-pixel rendering

EZFC_FONT_ANTIALIAS_GRAY

Use the gray-scaled sub-pixel rendering

EZFC_FONT_ANTIALIAS_RGB

Use the sub-pixel rendering with the sub-pixel geometry RGB.

EZFC_FONT_ANTIALIAS_BGR

Use the sub-pixel rendering with the sub-pixel geometry BGR.

EZFC_FONT_ANTIALIAS_VRGB

Use the sub-pixel rendering with the sub-pixel geometry VRGB.

EZFC_FONT_ANTIALIAS_VBGR

Use the sub-pixel rendering with the sub-pixel geometry VBGR.

EZFC_FONT_ANTIALIAS_END

No real value, but just a terminator.

ezfc_font_t

typedef struct _ezfc_font_t ezfc_font_t;

All the fields in the ezfc_font_t structure are private to the ezfc_font_t implementation.


ezfc_font_unref ()

void                ezfc_font_unref                     (ezfc_font_t *font);

Decreases the reference count of font. when its reference count drops to 0, the object is finalized (i.e. its memory is freed).

font :

a ezfc_font_t.