1 #if !defined(_BOX_FONT_HPP_) 29 Font():pimpl(
nullptr){};
41 Font(std::string_view fontname,
int ptsize);
51 PixBuf render_solid(std::string_view text,
Color color);
52 PixBuf render_solid(std::u16string_view text,
Color color);
72 PixBuf render_blended(std::string_view text,
Color color);
73 PixBuf render_blended(std::u16string_view text,
Color color);
81 int kerning_size(char16_t prev_ch,char16_t ch)
const;
89 bool has_glyph(char16_t ch)
const;
101 int ptsize()
const noexcept;
107 int refcount()
const noexcept;
113 void set_ptsize(
int new_ptsize);
120 Size size(std::string_view text);
121 Size size(std::u16string_view text);
133 void open(std::string_view fontname,
int ptsize);
140 void openfile(std::string_view filename,
int ptsize);
167 std::string family()
const;
168 std::string style_name()
const;
176 bool empty()
const noexcept{
177 return pimpl ==
nullptr;
186 static Font FromFile(std::string_view filename,
int ptsize);
201 FontSet(
void *pat,
void *objset,
void *fontset):
202 fc_pat(pat),fc_objset(objset),fc_fontset(fontset){}
205 fc_objset =
set.fc_objset;
206 fc_fontset =
set.fc_fontset;
208 set.fc_pat =
nullptr;
209 set.fc_objset =
nullptr;
210 set.fc_fontset =
nullptr;
223 std::string_view family()
const;
224 std::string_view style()
const;
225 std::string_view file()
const;
233 Iterator() =
default;
234 Iterator(
const Iterator &) =
default;
236 bool operator ==(
const Iterator &i)
const{
237 return i.font.font == font.font;
239 bool operator !=(
const Iterator &i)
const{
240 return i.font.font != font.font;
248 Iterator &operator =(
const Iterator &) =
default;
250 Iterator &operator ++();
251 Iterator &operator --();
257 static constexpr
bool Supported =
true;
266 static constexpr
bool Supported =
false;
269 typedef Iterator iterator;
279 Font operator [](
size_t index)
const;
299 friend struct Iterator;
328 return static_cast<FontStyle>(int(s1) | int(s2));
331 return static_cast<FontStyle>(int(s1) | int(s2));
334 return static_cast<FontStyle>(int(s1) & int(s2));
337 return static_cast<FontStyle>(int(s1) | int(s2));
340 return static_cast<FontStyle>(int(s1) | int(s2));
345 #endif // _BOX_FONT_HPP_ BTKAPI std::string GetFileByName(std::string_view name)
Get font file by its name.
Definition: fontutils.cpp:60
This header include many useful containers.
Definition: async.hpp:7
FontStyle
FontStyle from SDL_ttf.
Definition: font.hpp:15
Font Class.
Definition: font.hpp:26
Definition: pixels.hpp:32
Color structure.
Definition: pixels.hpp:19
Font Impl.
Definition: font.hpp:13
Size of a Widget or Window.
Definition: rect.hpp:104
BTKAPI void Quit()
Quit font utils.
Definition: fontutils.cpp:46