mirror of
https://github.com/raysan5/raylib.git
synced 2026-10-11 04:01:54 -04:00
Compare commits
2 Commits
38dad693fe
...
987a0e54c7
| Author | SHA1 | Date | |
|---|---|---|---|
| 987a0e54c7 | |||
| ab23bd388e |
@ -92,7 +92,7 @@ int main(void)
|
||||
if (currentFps <= 0) fpsText = TextFormat("FPS: unlimited (%i)", GetFPS());
|
||||
else fpsText = TextFormat("FPS: %i (target: %i)", GetFPS(), currentFps);
|
||||
DrawText(fpsText, 10, 10, 20, DARKGRAY);
|
||||
DrawText(TextFormat("Frame time: %02.02f ms", GetFrameTime()), 10, 30, 20, DARKGRAY);
|
||||
DrawText(TextFormat("Frame time: %02.02f ms", GetFrameTime()*1000.0f), 10, 30, 20, DARKGRAY);
|
||||
DrawText("Use the scroll wheel to change the fps limit, r to reset", 10, 50, 20, DARKGRAY);
|
||||
|
||||
// Draw the text above the circles
|
||||
|
||||
@ -2943,8 +2943,10 @@ static GlyphInfo *LoadFontDataBDF(const unsigned char *fileData, int dataSize, c
|
||||
if (outGlyphPtr != NULL)
|
||||
{
|
||||
outGlyphPtr->value = charEncoding;
|
||||
outGlyphPtr->offsetX = charBBxoff0 + fontBByoff0;
|
||||
outGlyphPtr->offsetY = fontBBh - (charBBh + charBByoff0 + fontBByoff0 + fontAscent);
|
||||
// BBX offsets place the glyph bitmap relative to the pen position on the baseline,
|
||||
// raylib offsets are measured from the top of the line, fontAscent above the baseline
|
||||
outGlyphPtr->offsetX = charBBxoff0;
|
||||
outGlyphPtr->offsetY = fontAscent - (charBBh + charBByoff0);
|
||||
outGlyphPtr->advanceX = charDWidthX;
|
||||
|
||||
outGlyphPtr->image.data = RL_CALLOC(charBBw*charBBh, 1);
|
||||
@ -2987,6 +2989,7 @@ static GlyphInfo *LoadFontDataBDF(const unsigned char *fileData, int dataSize, c
|
||||
if (strstr(buffer, "FONTBOUNDINGBOX") != NULL)
|
||||
{
|
||||
readVars = sscanf(buffer, "FONTBOUNDINGBOX %i %i %i %i", &fontBBw, &fontBBh, &fontBBxoff0, &fontBByoff0);
|
||||
fontAscent = fontBBh + fontBByoff0; // Default if FONT_ASCENT property is not provided
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user