2 * @defgroup Fonts Elementary Fonts
5 * These are functions dealing with font rendering, selection and the
6 * like for Elementary applications. One might fetch which system
7 * fonts are there to use and set custom fonts for individual classes
8 * of UI items containing text (text classes).
13 typedef struct _Elm_Font_Properties
17 } Elm_Font_Properties;
20 * Translate a font (family) name string in fontconfig's font names
21 * syntax into an @c Elm_Font_Properties struct.
23 * @param font The font name and styles string
24 * @return the font properties struct
28 * @note The reverse translation can be achieved with
29 * elm_font_fontconfig_name_get(), for one style only (single font
30 * instance, not family).
32 EAPI Elm_Font_Properties *elm_font_properties_get(const char *font);
35 * Free font properties return by elm_font_properties_get().
37 * @param efp the font properties struct
41 EAPI void elm_font_properties_free(Elm_Font_Properties *efp);
44 * Translate a font name, bound to a style, into fontconfig's font names
47 * @param name The font (family) name
48 * @param style The given style (may be @c NULL)
50 * @return the font name and style string
54 * @note The reverse translation can be achieved with
55 * elm_font_properties_get(), for one style only (single font
56 * instance, not family).
58 EAPI char *elm_font_fontconfig_name_get(const char *name, const char *style);
61 * Free the font string return by elm_font_fontconfig_name_get().
63 * @param name the font properties struct
67 EAPI void elm_font_fontconfig_name_free(char *name);
70 * Create a font hash table of available system fonts.
72 * One must call it with @p list being the return value of
73 * evas_font_available_list(). The hash will be indexed by font
74 * (family) names, being its values @c Elm_Font_Properties blobs.
76 * @param list The list of available system fonts, as returned by
77 * evas_font_available_list().
78 * @return the font hash.
82 * @note The user is supposed to get it populated at least with 3
83 * default font families (Sans, Serif, Monospace), which should be
84 * present on most systems.
86 EAPI Eina_Hash *elm_font_available_hash_add(Eina_List *list);
89 * Free the hash returned by elm_font_available_hash_add().
91 * @param hash the hash to be freed.
95 EAPI void elm_font_available_hash_del(Eina_Hash *hash);