Add option to disable X axis font's pre-scaling

If used pre-scaling along X null the effect of the font's hinting.
This commit is contained in:
Francesco Abbate
2020-06-12 16:06:39 +02:00
parent 4d3693479d
commit 3c3662b3ba
4 changed files with 18 additions and 14 deletions
+7 -6
View File
@@ -20,8 +20,8 @@ public:
// Conventional LUT values: (1./3., 2./9., 1./9.)
// The values below are fine tuned as in the Elementary Plot library.
FR_Impl(bool hinting, bool kerning, bool subpixel, float gamma_value) :
m_renderer(hinting, kerning, subpixel),
FR_Impl(bool hinting, bool kerning, bool subpixel, bool prescale_x, float gamma_value) :
m_renderer(hinting, kerning, subpixel, prescale_x),
m_gamma_lut(double(gamma_value)),
m_lcd_lut(0.448, 0.184, 0.092),
m_subpixel(subpixel)
@@ -40,10 +40,11 @@ private:
};
FR_Renderer *FR_Renderer_New(unsigned int flags, float gamma) {
bool hinting = ((flags & FR_HINTING) != 0);
bool kerning = ((flags & FR_KERNING) != 0);
bool subpixel = ((flags & FR_SUBPIXEL) != 0);
return new FR_Impl(hinting, kerning, subpixel, gamma);
bool hinting = ((flags & FR_HINTING) != 0);
bool kerning = ((flags & FR_KERNING) != 0);
bool subpixel = ((flags & FR_SUBPIXEL) != 0);
bool prescale_x = ((flags & FR_PRESCALE_X) != 0);
return new FR_Impl(hinting, kerning, subpixel, prescale_x, gamma);
}
FR_Bitmap* FR_Bitmap_New(FR_Renderer *font_renderer, int width, int height) {