mirror of
https://github.com/wiiu-env/libgui.git
synced 2025-01-12 00:09:07 +01:00
Reimplement the method getHeight in FreeTypeGX
This commit is contained in:
parent
0e83927d4d
commit
01d4b80338
@ -442,8 +442,24 @@ uint16_t FreeTypeGX::getCharWidth(const wchar_t wChar, int16_t pixelSize, const
|
|||||||
* @return The height of the text string in pixels.
|
* @return The height of the text string in pixels.
|
||||||
*/
|
*/
|
||||||
uint16_t FreeTypeGX::getHeight(const wchar_t *text, int16_t pixelSize) {
|
uint16_t FreeTypeGX::getHeight(const wchar_t *text, int16_t pixelSize) {
|
||||||
getOffset(text, pixelSize);
|
if (text == NULL) {
|
||||||
return fontData[pixelSize].ftgxAlign.max - fontData[pixelSize].ftgxAlign.min;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int16_t strMax = 0, strMin = 0;
|
||||||
|
int32_t i = 0;
|
||||||
|
while (text[i]) {
|
||||||
|
ftgxCharData *glyphData = cacheGlyphData(text[i], pixelSize);
|
||||||
|
|
||||||
|
if (glyphData != NULL) {
|
||||||
|
strMax = glyphData->renderOffsetMax > strMax ? glyphData->renderOffsetMax : strMax;
|
||||||
|
strMin = glyphData->renderOffsetMin > strMin ? glyphData->renderOffsetMin : strMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return strMax + strMin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user