9 #ifndef CMZN_FONT_HPP__
10 #define CMZN_FONT_HPP__
12 #include "zinc/font.h"
13 #include "zinc/context.hpp"
37 explicit Font(cmzn_font_id font_id) : id(font_id)
40 Font(
const Font& font) : id(cmzn_font_access(font.id))
45 cmzn_font_id temp_id = cmzn_font_access(font.id);
46 cmzn_font_destroy(&
id);
53 cmzn_font_destroy(&
id);
117 return cmzn_font_get_name(
id);
129 return cmzn_font_set_name(
id, name);
139 return cmzn_font_is_bold(
id);
150 return cmzn_font_set_bold(
id, bold);
160 return cmzn_font_get_depth(
id);
172 return cmzn_font_set_depth(
id, depth);
182 return cmzn_font_is_italic(
id);
193 return cmzn_font_set_italic(
id, italic);
203 return cmzn_font_get_point_size(
id);
214 return cmzn_font_set_point_size(
id, size);
224 return static_cast<RenderType>(cmzn_font_get_render_type(
id));
236 return cmzn_font_set_render_type(
id,
237 static_cast<cmzn_font_render_type>(renderType));
247 return static_cast<TypefaceType>(cmzn_font_get_typeface_type(
id));
259 return cmzn_font_set_typeface_type(
id, static_cast<cmzn_font_typeface_type>(typefaceType));
271 cmzn_fontmodule_id id;
279 explicit Fontmodule(cmzn_fontmodule_id in_fontmodule_id) :
284 id(cmzn_fontmodule_access(fontModule.id))
289 cmzn_fontmodule_id temp_id = cmzn_fontmodule_access(
293 cmzn_fontmodule_destroy(&
id);
303 cmzn_fontmodule_destroy(&
id);
335 return Font(cmzn_fontmodule_create_font(
id));
346 return Font(cmzn_fontmodule_find_font_by_name(
id, name));
360 return cmzn_fontmodule_begin_change(
id);
374 return cmzn_fontmodule_end_change(
id);
384 return Font(cmzn_fontmodule_get_default_font(
id));
395 return cmzn_fontmodule_set_default_font(
id, font.
getId());
401 return Fontmodule(cmzn_context_get_fontmodule(
id));
cmzn_fontmodule_id getId() const
Definition: font.hpp:322
Fontmodule getFontmodule()
Definition: font.hpp:399
bool isItalic()
Definition: font.hpp:180
Module managing all fonts.
Definition: font.hpp:268
enum RenderType getRenderType()
Definition: font.hpp:222
RenderType
Definition: font.hpp:59
TypefaceType getTypefaceType()
Definition: font.hpp:245
TypefaceType
Definition: font.hpp:80
Font getDefaultFont()
Definition: font.hpp:382
int setDefaultFont(const Font &font)
Definition: font.hpp:393
int beginChange()
Definition: font.hpp:358
char * getName()
Definition: font.hpp:115
int setName(const char *name)
Definition: font.hpp:127
int setPointSize(int size)
Definition: font.hpp:212
double getDepth()
Definition: font.hpp:158
bool isValid() const
Definition: font.hpp:312
int setDepth(double depth)
Definition: font.hpp:170
cmzn_font_id getId() const
Definition: font.hpp:103
bool isValid() const
Definition: font.hpp:93
int setRenderType(RenderType renderType)
Definition: font.hpp:234
int setBold(bool bold)
Definition: font.hpp:148
int getPointSize()
Definition: font.hpp:201
int endChange()
Definition: font.hpp:372
Font createFont()
Definition: font.hpp:333
int setTypefaceType(TypefaceType typefaceType)
Definition: font.hpp:257
bool isBold()
Definition: font.hpp:137
Font object controlling attributes of rendering text.
Definition: font.hpp:26
Font findFontByName(const char *name)
Definition: font.hpp:344
int setItalic(bool italic)
Definition: font.hpp:191