GLK: Move font method stubs from Screen to Fonts

This commit is contained in:
Paul Gilbert
2018-12-08 19:05:59 -08:00
committed by Paul Gilbert
parent 998cf547ed
commit 9d72d6007e
4 changed files with 36 additions and 39 deletions
+20 -1
View File
@@ -50,7 +50,7 @@ const double gli_conf_monosize = 12.5; ///< good size for LiberationMono
const double gli_conf_propsize = 15.5; ///< good size for Libertine
#endif
Fonts::Fonts() {
Fonts::Fonts(Graphics::ManagedSurface *surface) : _surface(surface) {
double monoAspect = g_conf->_monoAspect;
double propAspect = g_conf->_propAspect;
double monoSize = g_conf->_monoSize;
@@ -103,5 +103,24 @@ Graphics::Font *Fonts::loadFont(FACES face, double size, double aspect, int styl
return Graphics::loadTTFFont(f, size, Graphics::kTTFSizeModeCharacter);
}
int Fonts::drawString(int x, int y, int fidx, const byte *rgb, const char *s, int n, int spw) {
// TODO
return 0;
}
int Fonts::drawStringUni(int x, int y, int fidx, const byte *rgb, const uint32 *s, int n, int spw) {
// TODO
return 0;
}
int Fonts::stringWidth(int fidx, const char *s, int n, int spw) {
// TODO
return 0;
}
int Fonts::stringWidthUni(int fidx, const uint32 *s, int n, int spw) {
// TODO
return 0;
}
} // End of namespace Gargoyle
+10 -9
View File
@@ -35,16 +35,9 @@ enum FACES { MONOR, MONOB, MONOI, MONOZ, PROPR, PROPB, PROPI, PROPZ };
enum TYPES { MONOF, PROPF };
enum STYLES { FONTR, FONTB, FONTI, FONTZ };
/*
class Font {
public:
Font(const char *name, double size, double aspect, STYLES style);
};
*/
class Fonts {
private:
Graphics::ManagedSurface *_surface;
Graphics::Font *_fontTable[FONTS_TOTAL];
private:
Graphics::Font *loadFont(FACES face, double size, double aspect, int style);
@@ -57,12 +50,20 @@ public:
/**
* Constructor
*/
Fonts();
Fonts(Graphics::ManagedSurface *surface);
/**
* Destructor
*/
virtual ~Fonts();
int drawString(int x, int y, int fidx, const byte *rgb, const char *s, int n, int spw);
int drawStringUni(int x, int y, int fidx, const byte *rgb, const uint32 *s, int n, int spw);
int stringWidth(int fidx, const char *s, int n, int spw);
int stringWidthUni(int fidx, const uint32 *s, int n, int spw);
};
} // End of namespace Gargoyle
-20
View File
@@ -34,26 +34,6 @@ void Screen::fillRect(uint x, uint y, uint w, uint h, const byte *rgb) {
Graphics::Screen::fillRect(Common::Rect(x, y, x + w, y + h), color);
}
int Screen::drawString(int x, int y, int fidx, const byte *rgb, const char *s, int n, int spw) {
// TODO
return 0;
}
int Screen::drawStringUni(int x, int y, int fidx, const byte *rgb, const uint32 *s, int n, int spw) {
// TODO
return 0;
}
int Screen::stringWidth(int fidx, const char *s, int n, int spw) {
// TODO
return 0;
}
int Screen::stringWidthUni(int fidx, const uint32 *s, int n, int spw) {
// TODO
return 0;
}
void Screen::drawCaret(const Common::Point &pos) {
// TODO
}
+6 -9
View File
@@ -28,8 +28,13 @@
namespace Gargoyle {
class Screen : public Graphics::Screen, Fonts {
class Screen : public Graphics::Screen, public Fonts {
public:
/**
* Constructor
*/
Screen() : Graphics::Screen(), Fonts(this) {}
/**
* Fills the screen with a given rgb color
*/
@@ -40,14 +45,6 @@ public:
*/
void fillRect(uint x, uint y, uint w, uint h, const byte *rgb);
int drawString(int x, int y, int fidx, const byte *rgb, const char *s, int n, int spw);
int drawStringUni(int x, int y, int fidx, const byte *rgb, const uint32 *s, int n, int spw);
int stringWidth(int fidx, const char *s, int n, int spw);
int stringWidthUni(int fidx, const uint32 *s, int n, int spw);
void drawCaret(const Common::Point &pos);
};