X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2FInfoOutputDev.cc;h=bd1a0b587993b3788dfbc56dcdd8c5e0f9257bed;hb=a1f5318b0789743bbc6d8e93d408379115c67534;hp=701c966fc15a3cb20857fb9a48f9a0d145dca2be;hpb=535ddce3cefe30fe78caf4e6aa3897b18cd1edef;p=swftools.git diff --git a/lib/pdf/InfoOutputDev.cc b/lib/pdf/InfoOutputDev.cc index 701c966..bd1a0b5 100644 --- a/lib/pdf/InfoOutputDev.cc +++ b/lib/pdf/InfoOutputDev.cc @@ -131,6 +131,12 @@ static int findSpace(gfxfont_t*font) static int addSpace(gfxfont_t*font) { + /* first, make sure the new space char is the only char that'll use unicode 32 */ + int t; + for(t=0;tnum_glyphs;t++) { + if(font->glyphs[t].unicode==32) + font->glyphs[t].unicode=0; + } font->num_glyphs++; font->glyphs = (gfxglyph_t*)realloc(font->glyphs, sizeof(gfxglyph_t)*font->num_glyphs); gfxglyph_t*g = &font->glyphs[font->num_glyphs-1]; @@ -170,8 +176,6 @@ static gfxfont_t* createGfxFont(FontInfo*src) gfxglyph_t*glyph = &font->glyphs[font->num_glyphs]; src->glyphs[t]->glyphid = font->num_glyphs; glyph->unicode = src->glyphs[t]->unicode; - if(glyph->unicode >= font->max_unicode) - font->max_unicode = glyph->unicode+1; gfxdrawer_t drawer; gfxdrawer_target_gfxline(&drawer); int s; @@ -221,8 +225,6 @@ static gfxfont_t* createGfxFont(FontInfo*src) } } - gfxfont_fix_unicode(font); - int kerning_size = 0; for(t=0;tnum_glyphs;t++) { dict_t* d = src->kerning[t]; @@ -284,6 +286,7 @@ gfxfont_t* FontInfo::getGfxFont() this->space_char = addSpace(this->gfxfont); msg(" Appending space char to font %s, position %d, width %f", this->gfxfont->id, this->space_char, this->gfxfont->glyphs[this->space_char].advance); } + gfxfont_fix_unicode(this->gfxfont); } return this->gfxfont; }