From 2a007cfb70035c61b50aff4e00938f410b7de797 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Sat, 11 Jul 2020 18:20:31 -0500 Subject: [PATCH] BitmapFont default pixel height bug fixed. --- src/SlatedGameToolkit.Framework/Graphics/Text/BitmapFont.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SlatedGameToolkit.Framework/Graphics/Text/BitmapFont.cs b/src/SlatedGameToolkit.Framework/Graphics/Text/BitmapFont.cs index f87d3b9..7c961f4 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Text/BitmapFont.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Text/BitmapFont.cs @@ -62,7 +62,6 @@ namespace SlatedGameToolkit.Framework.Graphics.Text for (int i = 0; i < this.textures.Length; i++) { this.textures[i] = new FontTexture(info, context, glyphIndices, textureSizes); } - PixelHeight = 64; int spaceAdvance, leftSideBearing; StbTrueType.stbtt_GetCodepointHMetrics(info, ' ', &spaceAdvance, &leftSideBearing); this.spaceAdvance = spaceAdvance; @@ -76,6 +75,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Text context.GetViewport(out vX, out vY, out vWidth, out vHeight); this.PixelsPerUnitWidth = vWidth; this.PixelsPerUnitHeight = vHeight; + PixelHeight = 64; } public BitmapFont(string path, GLContext glContext = null, int cacheSize = 1024, int textures = 2, uint textureSizes = 512) : this(File.ReadAllBytes(path), glContext, cacheSize, textures, textureSizes) {