cgv
Loading...
Searching...
No Matches
cgv::media::font Namespace Reference

namespace for font support More...

Classes

class  font
 interface class for fonts. Construct font with the find_font function More...
 
class  font_face
 interface class for different faces of a font, which can be constructed from a font More...
 
class  font_server
 provides the methods to create and search for fonts More...
 

Typedefs

typedef data::ref_ptr< font_facefont_face_ptr
 always use this ref counted pointer to store font faces
 
typedef data::ref_ptr< fontfont_ptr
 always use this ref counted pointer to store fonts
 
typedef data::ref_ptr< font_serverfont_server_ptr
 ref counted pointer to font server
 

Enumerations

enum  FontFaceAttributes { FFA_REGULAR = 0 , FFA_BOLD = 1 , FFA_ITALIC = 2 , FFA_BOLD_ITALIC = 3 }
 declaration of supported attributes of font faces More...
 

Functions

font_ptr find_font (const std::string &font_name)
 find an installed font by name
 
font_ptr find_font_by_prefix (const std::string &font_name_prefix)
 find an installed font by name prefix
 
font_ptr find_font_or_default (const std::string &font_name, bool default_font_mono_space)
 find an installed font by name
 
font_ptr default_font (bool mono_space)
 return platform dependend default font
 
void enumerate_font_names (std::vector< const char * > &font_names)
 enumerate the names of all installed fonts
 
font_server_ptrref_font_server ()
 
font_server_ptr get_font_server ()
 return the currently installed font server or 0 if no font server available
 
void register_font_server (font_server_ptr fs)
 install a font server, call this in the on_register method of the server implementation
 

Detailed Description

namespace for font support

Typedef Documentation

◆ font_face_ptr

always use this ref counted pointer to store font faces

Definition at line 52 of file font.h.

◆ font_ptr

always use this ref counted pointer to store fonts

Definition at line 71 of file font.h.

◆ font_server_ptr

ref counted pointer to font server

Definition at line 27 of file font_server.h.

Enumeration Type Documentation

◆ FontFaceAttributes

declaration of supported attributes of font faces

Definition at line 20 of file font.h.

Function Documentation

◆ default_font()

CGV_API font_ptr cgv::media::font::default_font ( bool  mono_space)

return platform dependend default font

return potentially font driver and platform-specific default font

Definition at line 57 of file font.cxx.

References get_font_server().

Referenced by cgv::plot::plot_base::ensure_font_names(), cgv::media::font::font_server::find_font_by_prefix(), find_font_or_default(), and cgv::render::gl::gl_context::get_info_font_face().

◆ enumerate_font_names()

CGV_API void cgv::media::font::enumerate_font_names ( std::vector< const char * > &  font_names)

enumerate the names of all installed fonts

Definition at line 65 of file font.cxx.

References get_font_server().

Referenced by cgv::plot::plot_base::ensure_font_names(), and vr_test::init().

◆ find_font()

CGV_API font_ptr cgv::media::font::find_font ( const std::string &  font_name)

find an installed font by name

find an installed font by name (returns a null pointer if font could not be found)

Definition at line 32 of file font.cxx.

References get_font_server().

Referenced by find_font_or_default(), vr_test::init(), cgv::plot::plot_base::on_font_selection(), and vr_test::on_set().

◆ find_font_by_prefix()

CGV_API font_ptr cgv::media::font::find_font_by_prefix ( const std::string &  font_name_prefix)

find an installed font by name prefix

find an installed font by name prefix (returns a null pointer if font could not be found)

Definition at line 40 of file font.cxx.

References get_font_server().

◆ find_font_or_default()

CGV_API font_ptr cgv::media::font::find_font_or_default ( const std::string &  font_name,
bool  default_font_mono_space 
)

find an installed font by name

find an installed font by name or return platform-specific default font if no font with that name exists

Definition at line 48 of file font.cxx.

References default_font(), and find_font().

◆ get_font_server()

CGV_API font_server_ptr cgv::media::font::get_font_server ( )

return the currently installed font server or 0 if no font server available

Definition at line 14 of file font_server.cxx.

Referenced by default_font(), enumerate_font_names(), find_font(), and find_font_by_prefix().

◆ ref_font_server()

font_server_ptr & cgv::media::font::ref_font_server ( )

Definition at line 8 of file font_server.cxx.

◆ register_font_server()

CGV_API void cgv::media::font::register_font_server ( font_server_ptr  fs)

install a font server, call this in the on_register method of the server implementation

Definition at line 58 of file font_server.cxx.