- cleanup of font work:

- removed uneeded code
  - set default scale font value to 0.8 to fit nicely on screen
  - added two new optional settings for ini or lng files to control scale and y centering:
  FONT_SCALE_SIZE=0.8
  FONT_SCALE_CENTERH_FACTOR=3.0
This commit is contained in:
Mark Vejvoda
2011-07-02 01:56:06 +00:00
parent 32950a168c
commit 50347b0a66
8 changed files with 107 additions and 85 deletions

View File

@@ -32,17 +32,17 @@ private:
float *widths;
float height;
float yOffsetFactor;
//float yOffsetFactor;
Text *textHandler;
public:
static float DEFAULT_Y_OFFSET_FACTOR;
//static float DEFAULT_Y_OFFSET_FACTOR;
FontMetrics(Text *textHandler=NULL);
~FontMetrics();
void setYOffsetFactor(float yOffsetFactor);
float getYOffsetFactor() const;
//void setYOffsetFactor(float yOffsetFactor);
//float getYOffsetFactor() const;
void setTextHandler(Text *textHandler);
Text * getTextHandler();
@@ -66,9 +66,9 @@ public:
static bool forceLegacyFonts;
static bool fontIsRightToLeft;
static float scaleFontValue;
static float scaleFontValueCenterHFactor;
static int baseSize;
static int faceResolution;
//static int scaleFontYOffset;
public:
enum Width {
@@ -93,15 +93,12 @@ public:
virtual void end()=0;
//get
//string getType() const {return type;}
int getWidth() const;
FontMetrics *getMetrics() {return &metrics;}
Text * getTextHandler() {return textHandler;}
float getYOffsetFactor() const;
string getType() const;
//set
void setYOffsetFactor(float yOffsetFactor);
void setType(string typeX11, string typeGeneric);
void setWidth(int width);
@@ -114,8 +111,6 @@ public:
// =====================================================
class Font2D: public Font {
protected:
//int size;
public:
Font2D(FontTextHandlerType type=ftht_2D);