From: David Gow Date: Mon, 18 Aug 2014 13:18:31 +0000 (+0800) Subject: Fix kerning for the first pair of characters X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=commitdiff_plain;h=0ce8df17fae3ec986bd9570e5552aed92c080088 Fix kerning for the first pair of characters --- 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]); }