mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Draw: Font metrics simplified
git-svn-id: svn://ultimatepp.org/upp/trunk@12211 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
512dcc29bf
commit
244e1384e8
4 changed files with 3 additions and 9 deletions
|
|
@ -155,10 +155,10 @@ public:
|
|||
|
||||
int GetAscent() const { return Fi().ascent; }
|
||||
int GetDescent() const { return Fi().descent; }
|
||||
int GetCy() const { return Fi().height; }
|
||||
int GetCy() const { return GetAscent() + GetDescent(); }
|
||||
int GetExternal() const { return Fi().external; }
|
||||
int GetInternal() const { return Fi().internal; }
|
||||
int GetLineHeight() const { return Fi().lineheight; }
|
||||
int GetLineHeight() const { return GetCy() + GetExternal(); }
|
||||
int GetOverhang() const { return Fi().overhang; }
|
||||
int GetAveWidth() const { return Fi().avewidth; }
|
||||
int GetMaxWidth() const { return Fi().maxwidth; }
|
||||
|
|
|
|||
|
|
@ -144,9 +144,7 @@ CommonFontInfo GetFontInfoSys(Font font)
|
|||
if(face) {
|
||||
fi.ascent = face->size->metrics.ascender >> 6;
|
||||
fi.descent = -(face->size->metrics.descender >> 6);
|
||||
fi.height = fi.ascent + fi.descent;
|
||||
fi.lineheight = face->size->metrics.height >> 6;
|
||||
fi.external = 0;
|
||||
fi.external = (face->size->metrics.height >> 6) - fi.ascent - fi.descent;
|
||||
fi.internal = 0;
|
||||
fi.overhang = 0;
|
||||
fi.maxwidth = face->size->metrics.max_advance >> 6;
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ struct CommonFontInfo {
|
|||
int descent;
|
||||
int external;
|
||||
int internal;
|
||||
int height;
|
||||
int lineheight;
|
||||
int overhang;
|
||||
int avewidth;
|
||||
int maxwidth;
|
||||
|
|
|
|||
|
|
@ -113,8 +113,6 @@ CommonFontInfo GetFontInfoSys(Font font)
|
|||
fi.descent = tm.tmDescent;
|
||||
fi.external = tm.tmExternalLeading;
|
||||
fi.internal = tm.tmInternalLeading;
|
||||
fi.height = fi.ascent + fi.descent;
|
||||
fi.lineheight = fi.height + fi.external;
|
||||
fi.overhang = tm.tmOverhang;
|
||||
fi.avewidth = tm.tmAveCharWidth;
|
||||
fi.maxwidth = tm.tmMaxCharWidth;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue