include/rays/font.h in rays-0.1.47 vs include/rays/font.h in rays-0.1.48

- old
+ new

@@ -2,10 +2,12 @@ #pragma once #ifndef __RAYS_FONT_H__ #define __RAYS_FONT_H__ +#include <vector> +#include <map> #include <xot/pimpl.h> #include <rays/defs.h> namespace Rays @@ -15,20 +17,26 @@ class Font { public: + enum {DEFAULT_SIZE = 12}; + Font (); - Font (const char* name, coord size = 0); + Font (const char* name, coord size = DEFAULT_SIZE); ~Font (); + Font dup () const; + String name () const; - coord size () const; + void set_size (coord size); + coord size () const; + coord get_width (const char* str) const; coord get_height ( coord* ascent = NULL, coord* descent = NULL, @@ -43,10 +51,16 @@ Xot::PSharedImpl<Data> self; };// Font - const Font& default_font (); + typedef std::map<String, std::vector<String>> FontFamilyMap; + + const FontFamilyMap& get_font_families (); + + Font load_font (const char* path, coord size = Font::DEFAULT_SIZE); + + const Font& get_default_font (); }// Rays