Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Nethanis

Pages: [1]
1
DotNet / SFML.Net 2.2 bug: Glyph.Advance too big
« on: April 10, 2015, 03:21:50 pm »
Hello!

The Glyph.Advance value is way too big, it's enormous. The values for any font loaded, any character size of any character are above 1000000000 (one billion). Except for character size of 0, then the advance is also zero, but it's not very helpful.  :P

Here's a code example.
using System;
using SFML.Graphics;

namespace SFMLGlyphAdvanceBug
{
        class Program
        {
                static void Main()
                {
                        Font Font = new Font("arial.ttf");
                        Glyph Glyph = Font.GetGlyph('F', 30u, false);
                        Console.WriteLine(Glyph.Advance);

                        // Output in SFML .Net 2.2: 1099956224
                        // Output in SFML .Net 2.1: 18
                }
        }
}

I found it when using my custom text class. Because of this bug, when drawing the text, only the first character is visible, the rest is moved outside the window.
It works just fine in SFML.Net 2.1.
The SFML text class is also drawn correctly.

I'm using 32-bit version of SFML.Net 2.2, Visual Studio 2013 with Update 4, Windows 8.1.

Pages: [1]