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

Author Topic: Glyph problems  (Read 1444 times)

0 Members and 1 Guest are viewing this topic.

aferents

  • Newbie
  • *
  • Posts: 7
    • View Profile
Glyph problems
« on: August 04, 2014, 08:05:55 am »
Hello people!
I have issue with Text drawing. Main reason is that app crashes when i try to get bounds from glyph as it shows following code

Text class, method EnsureGeometry()
 // Extract the current glyph's description
                var glyph = Font.GetGlyph(curChar, CharacterSize, bold);

                var bounds = glyph.GetCBox(GlyphBBoxMode.Pixels);

                var left = bounds.Left;
                var tvop = bounds.Top;
                var right = bounds.Right;
                var bvottom = bounds.Bottom;
 

i use SharpFont.Glyp class
Font class method LoadGlyph()
 SharpFont.Glyph glyph = new SharpFont.Glyph((IntPtr)glyphRecPtr, LibraryInstance);

i noticed that in  source code of sfml using class Glyph with Bound property and method GetCBox doesn't use
 const Glyph& glyph = m_font->getGlyph(curChar, m_characterSize, bold);

        int left   = glyph.bounds.left;
        int top    = glyph.bounds.top;
        int right  = glyph.bounds.left + glyph.bounds.width;
        int bottom = glyph.bounds.top  + glyph.bounds.height;
Finally, what kind of Glyph class uses in sources? because SharpFont.Glyph doesn't have property Bounds (we can get it uses only GetCBox method that crashes app :()

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Glyph problems
« Reply #1 on: August 04, 2014, 09:55:45 am »
SFML defines its own Glyph class, which has nothing to do with SharpFont. I'm afraid you're on the wrong forum.
Laurent Gomila - SFML developer

aferents

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Glyph problems
« Reply #2 on: August 04, 2014, 10:04:32 am »
Thanks, it is that i needed