Initialize Tizen 2.3
[framework/uifw/elementary.git] / wearable / src / lib / elm_font.h
1 /**
2  * @defgroup Fonts Elementary Fonts
3  * @ingroup Elementary
4  *
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).
9  *
10  * @{
11  */
12
13 typedef struct _Elm_Font_Properties
14 {
15    const char *name;
16    Eina_List  *styles;
17 } Elm_Font_Properties;
18
19 /**
20  * Translate a font (family) name string in fontconfig's font names
21  * syntax into an @c Elm_Font_Properties struct.
22  *
23  * @param font The font name and styles string
24  * @return the font properties struct
25  *
26  * @ingroup Fonts
27  *
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).
31  */
32 EAPI Elm_Font_Properties *elm_font_properties_get(const char *font);
33
34 /**
35  * Free font properties return by elm_font_properties_get().
36  *
37  * @param efp the font properties struct
38  *
39  * @ingroup Fonts
40  */
41 EAPI void             elm_font_properties_free(Elm_Font_Properties *efp);
42
43 /**
44  * Translate a font name, bound to a style, into fontconfig's font names
45  * syntax.
46  *
47  * @param name The font (family) name
48  * @param style The given style (may be @c NULL)
49  *
50  * @return the font name and style string
51  *
52  * @ingroup Fonts
53  *
54  * @note The reverse translation can be achieved with
55  * elm_font_properties_get(), for one style only (single font
56  * instance, not family).
57  */
58 EAPI char      *elm_font_fontconfig_name_get(const char *name, const char *style);
59
60 /**
61  * Free the font string return by elm_font_fontconfig_name_get().
62  *
63  * @param name the font properties struct
64  *
65  * @ingroup Fonts
66  */
67 EAPI void             elm_font_fontconfig_name_free(char *name);
68
69 /**
70  * Create a font hash table of available system fonts.
71  *
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.
75  *
76  * @param list The list of available system fonts, as returned by
77  * evas_font_available_list().
78  * @return the font hash.
79  *
80  * @ingroup Fonts
81  *
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.
85  */
86 EAPI Eina_Hash       *elm_font_available_hash_add(Eina_List *list);
87
88 /**
89  * Free the hash returned by elm_font_available_hash_add().
90  *
91  * @param hash the hash to be freed.
92  *
93  * @ingroup Fonts
94  */
95 EAPI void             elm_font_available_hash_del(Eina_Hash *hash);
96
97 /**
98  * @}
99  */