Add some comment for pr #384

This commit is contained in:
halx99 2021-06-17 21:56:38 +08:00
parent 8b9d3ce3cd
commit 3c9a18675c
1 changed files with 5 additions and 1 deletions

View File

@ -233,8 +233,12 @@ bool FontFreeType::createFontObject(const std::string &fontName, float fontSize)
// store the face globally
_fontRef = face;
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);
// done and good
return true;
}