#include "textureFont.h" using namespace Graphics; TextureFont::TextureFont(const sf::Texture &texture, TextureFont::Descr description) : tex_(texture) , description_(description) { sf::Vector2u totalSize = tex_.getSize(); glyphSize_ = sf::Vector2i( totalSize.x / description_.numcols, totalSize.y / description_.numrows ); for(unsigned int i=0; isecond; } const sf::Texture * TextureFont::getTexture(...){ return &tex_; } float TextureFont::getLineSpacing(...){ // TODO make sure this is the appropiate measurement, it might be // smaller... // SFML obtains that from freetype face->metrics.height which only includes // the height from the baseline, then that's corrected in sf::Text with an // spacing ratio -> just test with a font and see what's supposed to do return glyphSize_.y; } float TextureFont::getKerning(...){ // Monospaced fonts have 0 kerning return 0; }