From 2ab978e9683deadb2c8e27d3baa09593ec50cecd Mon Sep 17 00:00:00 2001 From: Iain Merrick Date: Sun, 2 Jul 2017 21:42:03 -0500 Subject: [PATCH] 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. --- Source/Urho3D/UI/FontFaceFreeType.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Urho3D/UI/FontFaceFreeType.cpp b/Source/Urho3D/UI/FontFaceFreeType.cpp index 26d0f40345..10f90116a3 100644 --- a/Source/Urho3D/UI/FontFaceFreeType.cpp +++ b/Source/Urho3D/UI/FontFaceFreeType.cpp @@ -268,8 +268,8 @@ bool FontFaceFreeType::Load(const unsigned char* fontData, unsigned fontDataSize unsigned rightIndex = deserializer.ReadUShort(); 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) { unsigned value = (leftCharCode << 16) + rightCharCode;