From 88451a074035eb82cf53e954e90c6a99bed653fa Mon Sep 17 00:00:00 2001 From: Radek Dutkiewicz Date: Thu, 21 Jan 2021 13:31:18 +0000 Subject: [PATCH] Fixed naming convention mistakes --- include/SFML/Graphics/Glyph.hpp | 4 ++-- src/SFML/Graphics/Font.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/SFML/Graphics/Glyph.hpp b/include/SFML/Graphics/Glyph.hpp index 0e62aa65..32e45bc6 100644 --- a/include/SFML/Graphics/Glyph.hpp +++ b/include/SFML/Graphics/Glyph.hpp @@ -52,8 +52,8 @@ public: // Member data //////////////////////////////////////////////////////////// float advance; //!< Offset to move horizontally to the next character - int lsb_delta; //!< Left offset after forced autohint. Internally used by getKerning() - int rsb_delta; //!< Right offset after forced autohint. Internally used by getKerning() + int lsbDelta; //!< Left offset after forced autohint. Internally used by getKerning() + int rsbDelta; //!< Right offset after forced autohint. Internally used by getKerning() FloatRect bounds; //!< Bounding rectangle of the glyph, in coordinates relative to the baseline IntRect textureRect; //!< Texture coordinates of the glyph inside the font's texture }; diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 93b6a121..a7490414 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -391,10 +391,10 @@ float Font::getKerning(Uint32 first, Uint32 second, unsigned int characterSize, FT_UInt index2 = FT_Get_Char_Index(face, second); // Retrieve position compensation deltas generated by FT_LOAD_FORCE_AUTOHINT flag - float firstRsbDelta = getGlyph(first, characterSize, bold).rsb_delta; - float secondLsbDelta = getGlyph(second, characterSize, bold).lsb_delta; + float firstRsbDelta = getGlyph(first, characterSize, bold).rsbDelta; + float secondLsbDelta = getGlyph(second, characterSize, bold).lsbDelta; - // Get the kerning vector + // Get the kerning vector if present FT_Vector kerning; kerning.x = kerning.y = 0; if (FT_HAS_KERNING(face)) @@ -410,7 +410,7 @@ float Font::getKerning(Uint32 first, Uint32 second, unsigned int characterSize, } else { - // Invalid font, or no kerning + // Invalid font return 0.f; } } @@ -632,8 +632,8 @@ Glyph Font::loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, f if (bold) glyph.advance += static_cast(weight) / static_cast(1 << 6); - glyph.lsb_delta = face->glyph->lsb_delta; - glyph.rsb_delta = face->glyph->rsb_delta; + glyph.lsbDelta = face->glyph->lsb_delta; + glyph.rsbDelta = face->glyph->rsb_delta; int width = bitmap.width; int height = bitmap.rows;