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

Author Topic: Accessing font metrics from SFML.net  (Read 2714 times)

0 Members and 1 Guest are viewing this topic.

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
Accessing font metrics from SFML.net
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Accessing font metrics from SFML.net
« Reply #1 on: March 07, 2010, 11:44:54 am »
Are you using SFML 1.5 or 2.0?
Laurent Gomila - SFML developer

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
Accessing font metrics from SFML.net
« Reply #2 on: March 07, 2010, 11:50:56 am »
1.5 at the moment.  Is there a stable release of 2.0 for .net?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Accessing font metrics from SFML.net
« Reply #3 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?
Laurent Gomila - SFML developer

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
Accessing font metrics from SFML.net
« Reply #4 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

 

anything