From 0ce8df17fae3ec986bd9570e5552aed92c080088 Mon Sep 17 00:00:00 2001 From: David Gow Date: Mon, 18 Aug 2014 21:18:31 +0800 Subject: [PATCH] Fix kerning for the first pair of characters --- src/document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/document.cpp b/src/document.cpp index 57b8925..3f00e64 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -798,7 +798,7 @@ void Document::AddText(const string & text, Real scale, Real x, Real y) int advance_width = 0, left_side_bearing = 0, kerning = 0; stbtt_GetCodepointHMetrics(&m_font, text[i], &advance_width, &left_side_bearing); - if (i > 1) + if (i >= 1) { kerning = stbtt_GetCodepointKernAdvance(&m_font, text[i-1], text[i]); } -- 2.20.1