Remove the getOffset method from FreeTypeGX

This commit is contained in:
Maschell 2020-08-13 13:48:26 +02:00
parent 01d4b80338
commit d932b58cc3
2 changed files with 0 additions and 48 deletions

View File

@ -114,7 +114,6 @@ class FreeTypeGX {
private:
FT_Library ftLibrary; /**< FreeType FT_Library instance. */
FT_Face ftFace; /**< FreeType reusable FT_Face typographic object. */
int16_t ftPointSize; /**< Current set size of the rendered font. */
bool ftKerningEnabled; /**< Flag indicating the availability of font kerning data. */
uint8_t vertexIndex; /**< Vertex format descriptor index. */
GX2Sampler ftSampler;
@ -156,8 +155,6 @@ public:
uint16_t getHeight(const wchar_t *text, int16_t pixelSize);
void getOffset(const wchar_t *text, int16_t pixelSize, uint16_t widthLimit = 0);
static wchar_t *charToWideChar(const char *p);
static char *wideCharToUTF8(const wchar_t *strChar);

View File

@ -462,51 +462,6 @@ uint16_t FreeTypeGX::getHeight(const wchar_t *text, int16_t pixelSize) {
return strMax + strMin;
}
/**
* Get the maximum offset above and minimum offset below the font origin line.
*
* This function calculates the maximum pixel height above the font origin line and the minimum
* pixel height below the font origin line and returns the values in an addressible structure.
*
* @param text NULL terminated string to calculate.
* @param offset returns the max and min values above and below the font origin line
*
*/
void FreeTypeGX::getOffset(const wchar_t *text, int16_t pixelSize, uint16_t widthLimit) {
if (fontData.find(pixelSize) != fontData.end()) {
return;
}
int16_t strMax = 0, strMin = 9999;
uint16_t currWidth = 0;
int32_t i = 0;
while (text[i]) {
if (widthLimit > 0 && currWidth >= widthLimit) { break; }
ftgxCharData *glyphData = cacheGlyphData(text[i], pixelSize);
if (glyphData != NULL) {
strMax = glyphData->renderOffsetMax > strMax ? glyphData->renderOffsetMax : strMax;
strMin = glyphData->renderOffsetMin < strMin ? glyphData->renderOffsetMin : strMin;
currWidth += glyphData->glyphAdvanceX;
}
++i;
}
if (ftPointSize != pixelSize) {
ftPointSize = pixelSize;
FT_Set_Pixel_Sizes(ftFace, 0, ftPointSize);
}
fontData[pixelSize].ftgxAlign.ascender = ftFace->size->metrics.ascender >> 6;
fontData[pixelSize].ftgxAlign.descender = ftFace->size->metrics.descender >> 6;
fontData[pixelSize].ftgxAlign.max = strMax;
fontData[pixelSize].ftgxAlign.min = strMin;
}
/**
* Copies the supplied texture quad to the EFB.
*