cgv
Loading...
Searching...
No Matches
font.cxx
1
#include <cgv/media/font/font.h>
2
#include <cgv/media/font/font_server.h>
3
4
namespace
cgv
{
5
namespace
media {
6
namespace
font
{
7
9
font_face::font_face
(
int
_ffa) : ffa(_ffa)
10
{
11
}
13
std::string
font_face::get_type_name
()
const
14
{
15
return
"font_face"
;
16
}
17
19
int
font_face::get_attributes
()
const
20
{
21
return
ffa
;
22
}
23
24
26
std::string
font::get_type_name
()
const
27
{
28
return
"font"
;
29
}
30
32
font_ptr
find_font
(
const
std::string& font_name)
33
{
34
if
(
get_font_server
())
35
return
get_font_server
()->find_font(font_name);
36
return
font_ptr
();
37
}
38
40
font_ptr
find_font_by_prefix
(
const
std::string& font_name_prefix)
41
{
42
if
(
get_font_server
())
43
return
get_font_server
()->find_font_by_prefix(font_name_prefix);
44
return
font_ptr
();
45
}
46
48
font_ptr
find_font_or_default
(
const
std::string& font_name,
bool
default_font_mono_space)
49
{
50
const
auto
font
=
find_font
(font_name);
51
if
(
font
)
52
return
font
;
53
return
default_font
(default_font_mono_space);
54
}
55
57
font_ptr
default_font
(
bool
mono_space)
58
{
59
if
(
get_font_server
())
60
return
get_font_server
()->default_font(mono_space);
61
return
font_ptr
();
62
}
63
65
void
enumerate_font_names
(std::vector<const char*>& font_names)
66
{
67
if
(
get_font_server
())
68
return
get_font_server
()->enumerate_font_names(font_names);
69
}
70
71
}
72
}
73
}
cgv::data::ref_ptr< font >
cgv::media::font::font_face::ffa
int ffa
store the actual attributes of the font face
Definition
font.h:33
cgv::media::font::font_face::font_face
font_face(int _ffa)
construct from attributes that are declared in the enum FontFaceAttributes
Definition
font.cxx:9
cgv::media::font::font_face::get_attributes
virtual int get_attributes() const
return the attributes
Definition
font.cxx:19
cgv::media::font::font_face::get_type_name
std::string get_type_name() const
returns "font_face"
Definition
font.cxx:13
cgv::media::font::font
interface class for fonts. Construct font with the find_font function
Definition
font.h:56
cgv::media::font::font::get_type_name
std::string get_type_name() const
returns "font"
Definition
font.cxx:26
cgv::media::font::find_font
font_ptr find_font(const std::string &font_name)
find an installed font by name
Definition
font.cxx:32
cgv::media::font::get_font_server
font_server_ptr get_font_server()
return the currently installed font server or 0 if no font server available
Definition
font_server.cxx:14
cgv::media::font::find_font_by_prefix
font_ptr find_font_by_prefix(const std::string &font_name_prefix)
find an installed font by name prefix
Definition
font.cxx:40
cgv::media::font::default_font
font_ptr default_font(bool mono_space)
return platform dependend default font
Definition
font.cxx:57
cgv::media::font::find_font_or_default
font_ptr find_font_or_default(const std::string &font_name, bool default_font_mono_space)
find an installed font by name
Definition
font.cxx:48
cgv::media::font::font_ptr
data::ref_ptr< font > font_ptr
always use this ref counted pointer to store fonts
Definition
font.h:71
cgv::media::font::enumerate_font_names
void enumerate_font_names(std::vector< const char * > &font_names)
enumerate the names of all installed fonts
Definition
font.cxx:65
cgv
the cgv namespace
Definition
print.h:11
cgv
media
font
font.cxx
Generated by
1.9.8