summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_text_font.eo
blob: 34e5dab22a091739c2159b06fea98e00dc84209f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// src/lib/efl/interfaces/efl_text_font.eo
import efl_gfx_types;
enum Efl.Text_Font_Weight {
   [[Type of font weight]]
   normal, [[Normal font weight]]
   thin, [[Thin font weight]]
   ultralight, [[Ultralight font weight]]
   extralight, [[Extralight font weight]]
   light, [[Light font weight]]
   book, [[Book font weight]]
   medium, [[Medium font weight]]
   semibold, [[Semibold font weight]]
   bold, [[Bold font weight]]
   ultrabold, [[Ultrabold font weight]]
   extrabold, [[Extrabold font weight]]
   black, [[Black font weight]]
   extrablack, [[Extrablack font weight]]
}

enum Efl.Text_Font_Width {
   [[Type of font width]]
   normal, [[Normal font width]]
   ultracondensed, [[Ultracondensed font width]]
   extracondensed, [[Extracondensed font width]]
   condensed, [[Condensed font width]]
   semicondensed, [[Semicondensed font width]]
   semiexpanded, [[Semiexpanded font width]]
   expanded, [[Expanded font width]]
   extraexpanded, [[Extraexpanded font width]]
   ultraexpanded, [[Ultraexpanded font width]]
}

enum Efl.Text_Font_Slant {
    [[Type of font slant]]
    normal, [[Normal font slant]]
    oblique, [[Oblique font slant]]
    italic, [[Italic font slant]]
}

/* FIXME: It needs to support "normal" option for non-color bitmap font.
   For supporting "normal" option, S/W glyph drawing engine should be updated.
 */
enum Efl.Text_Font_Bitmap_Scalable {
   [[Scalable of bitmap fonts

     @since 1.21
   ]]
   none = 0,         [[Disable scalable feature for bitmap fonts.]]
   color = (1 << 0), [[Enable scalable feature for color bitmap fonts.]]
}

interface Efl.Text_Font {
   [[Font settings of the text

     @since 1.20
   ]]
   eo_prefix: efl_text;
   methods {
      @property font {
         set {
            [[Set the font family, filename and size for a given text object.

              This function allows the font name and size of a text object to
              be set. The font string has to follow fontconfig's convention for
              naming fonts, as it's the underlying library used to query system
              fonts by Evas (see the fc-list command's output, on your system,
              to get an idea). Alternatively, youe can use the full path to a font
              file.

              See also @.font.get, @.font_source.get.
            ]]
         }
         get {
            [[Retrieve the font family and size in use on a given text object.

              This function allows the font name and size of a text object to
              be queried. Remember that the font name string is still owned by
              Evas and should not have free() called on it by the caller of the
              function.

              See also @.font.set.
            ]]
         }
         values {
            font: string; [[The font family name or filename.]]
            size: Efl.Font.Size; [[The font size, in points.]]
         }
      }
      @property font_source {
         set {
            [[Set the font (source) file to be used on a given text object.

              This function allows the font file to be explicitly set for a
              given text object, overriding system lookup, which will first
              occur in the given file's contents.

              See also @.font.set.
            ]]
         }
         get {
            [[Get the font file's path which is being used on a given text
              object.

              See @.font.get for more details.
            ]]
         }
         values {
            font_source: string; [[The font file's path.]]
         }
      }

      @property font_fallbacks {
         [[Comma-separated list of font fallbacks

           Will be used in case the primary font isn't available.
         ]]
         values {
            font_fallbacks: string; [[Font name fallbacks]]
         }
      }

      @property font_weight {
         [[Type of weight of the displayed font

           Default is @Efl.Text_Font_Weight.normal\.
         ]]
         values {
            font_weight: Efl.Text_Font_Weight; [[Font weight]]
         }
      }

      @property font_slant {
         [[Type of slant of the displayed font

           Default is @Efl.Text_Font_Slant.normal\.
         ]]
         values {
            style: Efl.Text_Font_Slant; [[Font slant]]
         }
      }

      @property font_width {
         [[Type of width of the displayed font

           Default is @Efl.Text_Font_Width.normal\.
         ]]
         values {
            width: Efl.Text_Font_Width; [[Font width]]
         }
      }

      @property font_lang {
         [[Specific language of the displayed font

           This is used to lookup fonts suitable to the specified language, as
           well as helping the font shaper backend.
           The language $lang can be either a code e.g "en_US",
           "auto" to use the system locale, or "none".
         ]]
         values {
            lang: string; [[Language]]
         }
      }

      @property font_bitmap_scalable {
           [[The bitmap fonts have fixed size glyphs for several available sizes.
             Basically, it is not scalable. But, it needs to be scalable for some use cases.
             (ex. colorful emoji fonts)

             Default is @Efl.Text_Font_Bitmap_Scalable.none\.
           ]]
           values {
              scalable: Efl.Text_Font_Bitmap_Scalable; [[Scalable]]
           }
      }
   }
}