src/font.cpp in rays-0.1.47 vs src/font.cpp in rays-0.1.48
- old
+ new
@@ -25,22 +25,30 @@
return rawfont;
if (pixel_density != for_pixel_density)
{
rawfont_for_pixel_density =
- RawFont(rawfont.name(), rawfont.size() * pixel_density);
+ RawFont(rawfont, rawfont.size() * pixel_density);
for_pixel_density = pixel_density;
}
return rawfont_for_pixel_density;
}
};// Font::Data
+ Font
+ load_font (const char* path, coord size)
+ {
+ Font font;
+ font.self->rawfont = RawFont_load(path, size);
+ return font;
+ }
+
const Font&
- default_font ()
+ get_default_font ()
{
static const Font FONT(NULL);
return FONT;
}
@@ -77,13 +85,27 @@
Font::~Font ()
{
}
+ Font
+ Font::dup () const
+ {
+ Font f;
+ f.self->rawfont = RawFont(self->rawfont, self->rawfont.size());
+ return f;
+ }
+
String
Font::name () const
{
return self->rawfont.name();
+ }
+
+ void
+ Font::set_size (coord size)
+ {
+ self->rawfont = RawFont(self->rawfont, size);
}
coord
Font::size () const
{