1. basicer
  2. love-less-deps

Commits

Bart van Strien  committed d5eacd6

Correctly set the spacing for the last character in an ImageFont as well

  • Participants
  • Parent commits 3ffa5e0
  • Branches default

Comments (0)

Files changed (1)

File src/modules/font/ImageRasterizer.cpp

View file
 		widths[c] = (end - start);
 	}
 
+	// Find spacing of last glyph
+	if (length > 0)
+	{
+		start = end;
+		while (start < imgw && equal(pixels[start], spacer))
+			++start;
+
+		spacing[glyphs[length - 1]] = (start > end) ? (start - end) : 0;
+	}
+
 	// Replace spacer color with an empty pixel
 	for (unsigned int i = 0; i < imgs; ++i)
 	{