From 5c56d74f2b18a904f6cfad2e30a568cbcbc98e74 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sat, 22 Sep 2012 19:58:40 +0200 Subject: [PATCH 2/3] Do not use mapUTF8() directly in CairoOutputDev --- poppler/CairoOutputDev.cc | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index d8f78d7..bab4562 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -23,7 +23,7 @@ // Copyright (C) 2008-2012 Adrian Johnson // Copyright (C) 2008 Michael Vrable // Copyright (C) 2008, 2009 Chris Wilson -// Copyright (C) 2008 Hib Eris +// Copyright (C) 2008, 2012 Hib Eris // Copyright (C) 2009, 2010 David Benjamin // Copyright (C) 2011, 2012 Thomas Freitag // Copyright (C) 2012 Patrick Pfeifer @@ -61,7 +61,7 @@ #include "CairoOutputDev.h" #include "CairoFontEngine.h" #include "CairoRescaleBox.h" -#include "UTF.h" +#include "UnicodeMap.h" //------------------------------------------------------------------------ // #define LOG_CAIRO @@ -1169,6 +1169,8 @@ void CairoOutputDev::drawChar(GfxState *state, double x, double y, glyphs[glyphCount].y = y - originY; glyphCount++; if (use_show_text_glyphs) { + GooString enc("UTF-8"); + UnicodeMap *utf8Map = globalParams->getUnicodeMap(&enc); if (utf8Max - utf8Count < uLen*6) { // utf8 encoded characters can be up to 6 bytes if (utf8Max > uLen*6) @@ -1179,7 +1181,7 @@ void CairoOutputDev::drawChar(GfxState *state, double x, double y, } clusters[clusterCount].num_bytes = 0; for (int i = 0; i < uLen; i++) { - int size = mapUTF8 (u[i], utf8 + utf8Count, utf8Max - utf8Count); + int size = utf8Map->mapUnicode(u[i], utf8 + utf8Count, utf8Max - utf8Count); utf8Count += size; clusters[clusterCount].num_bytes += size; } -- 1.7.5.4