2 * @defgroup Fonts Elementary Fonts
4 * These are functions dealing with font rendering, selection and the
5 * like for Elementary applications. One might fetch which system
6 * fonts are there to use and set custom fonts for individual classes
7 * of UI items containing text (text classes).
12 typedef struct _Elm_Font_Properties
16 } Elm_Font_Properties;
19 * Translate a font (family) name string in fontconfig's font names
20 * syntax into an @c Elm_Font_Properties struct.
22 * @param font The font name and styles string
23 * @return the font properties struct
27 * @note The reverse translation can be achieved with
28 * elm_font_fontconfig_name_get(), for one style only (single font
29 * instance, not family).
31 EAPI Elm_Font_Properties *elm_font_properties_get(const char *font);
34 * Free font properties return by elm_font_properties_get().
36 * @param efp the font properties struct
40 EAPI void elm_font_properties_free(Elm_Font_Properties *efp);
43 * Translate a font name, bound to a style, into fontconfig's font names
46 * @param name The font (family) name
47 * @param style The given style (may be @c NULL)
49 * @return the font name and style string
53 * @note The reverse translation can be achieved with
54 * elm_font_properties_get(), for one style only (single font
55 * instance, not family).
57 EAPI char *elm_font_fontconfig_name_get(const char *name, const char *style);
60 * Free the font string return by elm_font_fontconfig_name_get().
62 * @param name the font properties struct
66 EAPI void elm_font_fontconfig_name_free(char *name);
69 * Create a font hash table of available system fonts.
71 * One must call it with @p list being the return value of
72 * evas_font_available_list(). The hash will be indexed by font
73 * (family) names, being its values @c Elm_Font_Properties blobs.
75 * @param list The list of available system fonts, as returned by
76 * evas_font_available_list().
77 * @return the font hash.
81 * @note The user is supposed to get it populated at least with 3
82 * default font families (Sans, Serif, Monospace), which should be
83 * present on most systems.
85 EAPI Eina_Hash *elm_font_available_hash_add(Eina_List *list);
88 * Free the hash returned by elm_font_available_hash_add().
90 * @param hash the hash to be freed.
94 EAPI void elm_font_available_hash_del(Eina_Hash *hash);