Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
diff --git a/util/font.cpp b/util/font.cpp
index bb0e553b..6466563b 100644
--- a/util/font.cpp
+++ b/util/font.cpp
@@ -1,23 +1,27 @@
#include <allegro.h>
#include "font.h"
#include "init.h"
Font::Font( FONT * f ):
my_font( f ){
}
Font::Font( const Font & f ):
my_font( f.getInternalFont() ){
}
-const int Font::textLength( const char * text ){
+const int Font::textLength( const char * text ) const{
return text_length( getInternalFont(), text );
}
const int Font::getHeight() const{
return text_height( getInternalFont() );
}
const Font getFont( int index ){
return Font( (FONT *) Global::all_fonts[ index ].dat );
}
+
+const Font getDefaultFont(){
+ return Font( font );
+}
diff --git a/util/font.h b/util/font.h
index a6994e12..59f1584c 100644
--- a/util/font.h
+++ b/util/font.h
@@ -1,25 +1,26 @@
#ifndef _paintown_font_h
#define _paintown_font_h
struct FONT;
class Font{
public:
Font( FONT * f );
Font( const Font & f );
inline FONT * getInternalFont() const{
return my_font;
}
- const int textLength( const char * text );
+ const int textLength( const char * text ) const;
const int getHeight() const;
protected:
FONT * my_font;
};
const Font getFont( int index );
+const Font getDefaultFont();
#endif

File Metadata

Mime Type
text/x-diff
Expires
Thu, Jun 11, 2:19 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
69432
Default Alt Text
(1 KB)

Event Timeline