X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpdf%2FGFXOutputDev.cc;h=881c75a75e8a7067c25f75f093375d703332eb79;hb=5ba24931ec3861ca5befcaae1502dd9105639b44;hp=2596d25316c3bd60e2cf4f09cee87b6a94a6cc87;hpb=2e5b799fa6e0fe9ef61a168e9d1d107ca7f17e32;p=swftools.git diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index 2596d25..881c75a 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -1457,10 +1457,11 @@ void GFXOutputDev::drawChar(GfxState *state, double x, double y, !last_char_was_space) { double expected_x = last_char_x + current_gfxfont->glyphs[last_char].advance*m.m00; int space = this->current_fontinfo->space_char; - if(m.tx - expected_x >= m.m00*64) { - msg(" There's a %f (%f) pixel gap between char %d and char %d, I'm inserting a space here", + float width = this->current_fontinfo->average_advance; + if(m.tx - expected_x >= m.m00*width*4/10) { + msg(" There's a %f pixel gap between char %d and char %d (expected no more than %f), I'm inserting a space here", m.tx-expected_x, - (m.tx-expected_x)/m.m00, + width*m.m00*4/10, last_char, glyphid); gfxmatrix_t m2 = m; m2.tx = expected_x + (m.tx - expected_x - current_gfxfont->glyphs[space].advance*m.m00)/2;