mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
fontrenderer.cpp: Use additional percentage height offset.
Different font types could have different glyph heights, Therfore static values seems not really senseful. eg. chars like ÄÁÂÅÈÉÊËÌÍÎÏÑÒÓÕÖÙÛÜÝ could paint over defined height, Note: However, depending of implementations, the font image may change. Most likely this must be adapted to some parts.
This commit is contained in:
@@ -287,10 +287,14 @@ return 0;
|
|||||||
ascender=tM;
|
ascender=tM;
|
||||||
descender=tg-hg; //this is a negative value!
|
descender=tg-hg; //this is a negative value!
|
||||||
int halflinegap= -(descender>>1); // |descender/2| - we use descender as linegap, half at top, half at bottom
|
int halflinegap= -(descender>>1); // |descender/2| - we use descender as linegap, half at top, half at bottom
|
||||||
upper = halflinegap+ascender+3; // we add 3 at top
|
|
||||||
lower = -descender+halflinegap+1; // we add 1 at bottom
|
//hack: Use additional percentage height offset, font types could have different heights, static values seems not really senseful.
|
||||||
|
upper = halflinegap+ascender+hg/7; // we add 1/7 of glyph height at top
|
||||||
|
lower = -descender+halflinegap-hg/10; // we add 1/10 of glyph height at bottom
|
||||||
|
|
||||||
height=upper+lower; // this is total height == distance of lines
|
height=upper+lower; // this is total height == distance of lines
|
||||||
DigitHeight = ascender+2;
|
|
||||||
|
DigitHeight = ascender+2; //Is this static value really ok?
|
||||||
DigitOffset = -descender+halflinegap;
|
DigitOffset = -descender+halflinegap;
|
||||||
// hack end
|
// hack end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user