SFML community forums

Bindings - other languages => DotNet => Topic started by: Wibbs on March 07, 2010, 11:02:03 am

Title: Accessing font metrics from SFML.net
Post by: Wibbs on March 07, 2010, 11:02:03 am
Hey,

I'm currently intending to use SFML.net for a game I'm writing, but am having trouble accessing information on the font that I'm using, and for individual strings that I want to display to screen.  I need to know heights/widths of strings and characters, and if possible access to such things as kerning information.

I know in the c++ implementation there is a Glyph class, but I can't find an equivalent in the .net binding.  Can anyone point me in the right direction?

Thanks,

Wibbs
Title: Accessing font metrics from SFML.net
Post by: Laurent on March 07, 2010, 11:44:54 am
Are you using SFML 1.5 or 2.0?
Title: Accessing font metrics from SFML.net
Post by: Wibbs on March 07, 2010, 11:50:56 am
1.5 at the moment.  Is there a stable release of 2.0 for .net?
Title: Accessing font metrics from SFML.net
Post by: Laurent on March 07, 2010, 11:59:14 am
Quote
Is there a stable release of 2.0 for .net?

Not yet, but it is stable enough to be used (it's just not complete yet).

In SFML 1.x the Font class doesn't provide much informations about metrics. There is indeed a Glyph class in the C++ implementation which is missing in SFML.Net, but it was intended to be used internally.
SFML 2 has a more complete public interface: you can get glyph metrics, kerning and line spacing.

By the way, why do you need all these informations about glyphs metrics?
Title: Accessing font metrics from SFML.net
Post by: Wibbs on March 09, 2010, 05:00:10 pm
Thanks for the info - I was just playing around with interesting ways of displaying text, nothing specific.

Phil