diff --git a/Core/Video/Display.cpp b/Core/Video/Display.cpp index e264809..9656a0e 100644 --- a/Core/Video/Display.cpp +++ b/Core/Video/Display.cpp @@ -360,15 +360,18 @@ namespace Video { // if (this->CurrentFont->PSF2Font->GlyphBuffer == (uint16_t *)0x01) // HAS UNICODE TABLE // Char = this->CurrentFont->PSF2Font->GlyphBuffer[Char]; - int BytesPerLine = (this->CurrentFont->GetInfo().PSF2Font->Header->width + 7) / 8; - char *FontAddress = (char *)this->CurrentFont->GetInfo().StartAddress; - uint32_t FontHeaderSize = this->CurrentFont->GetInfo().PSF2Font->Header->headersize; - uint32_t FontCharSize = this->CurrentFont->GetInfo().PSF2Font->Header->charsize; - uint32_t FontLength = this->CurrentFont->GetInfo().PSF2Font->Header->length; + + FontInfo fInfo = this->CurrentFont->GetInfo(); + + int BytesPerLine = (fInfo.PSF2Font->Header->width + 7) / 8; + char *FontAddress = (char *)fInfo.StartAddress; + uint32_t FontHeaderSize = fInfo.PSF2Font->Header->headersize; + uint32_t FontCharSize = fInfo.PSF2Font->Header->charsize; + uint32_t FontLength = fInfo.PSF2Font->Header->length; char *FontPtr = FontAddress + FontHeaderSize + (Char > 0 && (uint32_t)Char < FontLength ? Char : 0) * FontCharSize; - uint32_t FontHdrWidth = this->CurrentFont->GetInfo().PSF2Font->Header->width; - uint32_t FontHdrHeight = this->CurrentFont->GetInfo().PSF2Font->Header->height; + uint32_t FontHdrWidth = fInfo.PSF2Font->Header->width; + uint32_t FontHdrHeight = fInfo.PSF2Font->Header->height; for (size_t Y = this->Buffers[Index].CursorY; Y < this->Buffers[Index].CursorY + FontHdrHeight; Y++) {