+ for(unsigned int i = 1u; i < numberOfGlyphs; ++i)
+ {
+ const GlyphInfo& glyphInfo = *(glyphsBuffer + glyphIndex + i);
+
+ // update the initial xBearing if smaller.
+ glyphMetrics.xBearing = std::min(glyphMetrics.xBearing, glyphMetrics.advance + glyphInfo.xBearing);
+
+ // update the max width edge if bigger.
+ const float currentMaxGlyphWidthEdge = glyphMetrics.advance + glyphInfo.xBearing + glyphInfo.width;
+ maxWidthEdge = std::max(maxWidthEdge, currentMaxGlyphWidthEdge);
+
+ glyphMetrics.advance += glyphInfo.advance;
+ }
+
+ glyphMetrics.width = maxWidthEdge - glyphMetrics.xBearing;