SFML community forums

Help => Graphics => Topic started by: m00npirate on December 21, 2011, 05:32:06 am

Title: Aligning text of different sizes based on the baseline
Post by: m00npirate on December 21, 2011, 05:32:06 am
Images are drawn relative to the upper left corner. Text rendered from a font on the other hand is usually aligned based on the "baseline" of the text which cant be calculated from any available sfml font/text properties. I am currently using the .NET bindings and I would like access to the baseline of a rendered glyph in order to align text of differing sizes. Is there some way of calculating the baseline from SFML or am I better off looking into FreeType bindings for .NET?

Basically what I'm looking for is a function which takes in a string and returns how far the baseline is from the "draw position y coordinate".
Title: Aligning text of different sizes based on the baseline
Post by: Laurent on December 21, 2011, 08:06:10 am
The baseline is located at y = CharacterSize relatively to the text's position.
Title: Aligning text of different sizes based on the baseline
Post by: m00npirate on December 21, 2011, 08:11:50 am
Well now I feel silly. Works perfectly, thanks!