mirror of https://github.com/axmolengine/axmol.git
Add some comment for pr #384
This commit is contained in:
parent
ffda7422c9
commit
bafcac20c1
|
@ -233,6 +233,10 @@ bool FontFreeType::createFontObject(const std::string &fontName, float fontSize)
|
||||||
// store the face globally
|
// store the face globally
|
||||||
_fontRef = face;
|
_fontRef = face;
|
||||||
auto* ttSize = (TT_Size)(_fontRef->size);
|
auto* ttSize = (TT_Size)(_fontRef->size);
|
||||||
|
// Notes:
|
||||||
|
// a. ttSize->metrics->height: (ttSize->metrics->ascender - ttSize->metrics->descender)
|
||||||
|
// b. ftSize->metrics.height == ttSize->metrics->height
|
||||||
|
// c. the TT spec always asks for ROUND, not FLOOR or CEIL, see also freetype: ttobjs.c
|
||||||
_lineHeight = static_cast<int>((ttSize->metrics->ascender - ttSize->metrics->descender) >> 6);
|
_lineHeight = static_cast<int>((ttSize->metrics->ascender - ttSize->metrics->descender) >> 6);
|
||||||
|
|
||||||
// done and good
|
// done and good
|
||||||
|
|
Loading…
Reference in New Issue