Browse Source

Fix kerning pairs (#2003)

Kerning values were being associated with the wrong char codes.
This was broken in commit 39930c9a, which moved some code around
to ensure that the space character is always the first one loaded.
Iain Merrick 8 years ago
parent
commit
2ab978e968
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/Urho3D/UI/FontFaceFreeType.cpp

+ 2 - 2
Source/Urho3D/UI/FontFaceFreeType.cpp

@@ -268,8 +268,8 @@ bool FontFaceFreeType::Load(const unsigned char* fontData, unsigned fontDataSize
                         unsigned rightIndex = deserializer.ReadUShort();
                         unsigned rightIndex = deserializer.ReadUShort();
                         short amount = FixedToFloat(deserializer.ReadShort());
                         short amount = FixedToFloat(deserializer.ReadShort());
 
 
-                        unsigned leftCharCode = leftIndex < numGlyphs ? charCodes[leftIndex] : 0;
-                        unsigned rightCharCode = rightIndex < numGlyphs ? charCodes[rightIndex] : 0;
+                        unsigned leftCharCode = leftIndex < numGlyphs ? charCodes[leftIndex + 1] : 0;
+                        unsigned rightCharCode = rightIndex < numGlyphs ? charCodes[rightIndex + 1] : 0;
                         if (leftCharCode != 0 && rightCharCode != 0)
                         if (leftCharCode != 0 && rightCharCode != 0)
                         {
                         {
                             unsigned value = (leftCharCode << 16) + rightCharCode;
                             unsigned value = (leftCharCode << 16) + rightCharCode;