Skip to content
Permalink
Browse files

[Fonts] Do not alter fontSize

  • Loading branch information
xen2 committed Oct 23, 2019
1 parent d307637 commit 1a9bfd6e775e3cf4d721cbe060299a8dba84a35c
Showing with 4 additions and 3 deletions.
  1. +4 −3 sources/engine/Xenko.Graphics/Font/RuntimeRasterizedSpriteFont.cs
@@ -100,11 +100,12 @@ public override bool IsCharPresent(char c)
protected override Glyph GetGlyph(CommandList commandList, char character, ref Vector2 fontSize, bool uploadGpuResources, out Vector2 fixScaling)
{
// Add a safe guard to prevent the system to generate characters too big for the dynamic font cache texture
fontSize.X = Math.Min(fontSize.X, 256);
fontSize.Y = Math.Min(fontSize.Y, 256);
var realFontSize = fontSize;
realFontSize.X = Math.Min(realFontSize.X, 256);
realFontSize.Y = Math.Min(realFontSize.Y, 256);

// get the character data associated to the provided character and size
var characterData = GetOrCreateCharacterData(fontSize, character);
var characterData = GetOrCreateCharacterData(realFontSize, character);

// generate the bitmap if it does not exist
if (characterData.Bitmap == null)

0 comments on commit 1a9bfd6

Please sign in to comment.
You can’t perform that action at this time.