summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
diff options
context:
space:
mode:
authorVort <vvort@yandex.ru>2014-05-20 09:05:33 +0300
committerCaolán McNamara <caolanm@redhat.com>2014-05-20 06:55:32 -0500
commitbe7ec1384e85360179f5645d9775c5e6605d5a0f (patch)
treec0618b67a50c7188c6a96e7d883838dd6155f63f /sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
parent27fc60874795849b43903f27076e9dcafb958c76 (diff)
fdo#78689 PDF Import: get font's ascent value from different source
Change-Id: I19018d25ef53bbea225bb5a9ef806ce5c1b4adc7 Reviewed-on: https://gerrit.libreoffice.org/9410 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx')
-rw-r--r--sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx33
1 files changed, 5 insertions, 28 deletions
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
index c5096ad44912..e3a779eab957 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx
@@ -847,38 +847,13 @@ void PDFOutDev::drawChar(GfxState *state, double x, double y,
if( u == NULL )
return;
- GfxFont* font = state->getFont();
- double ascent = font->getAscent();
- GooString* fontName = font->getName();
-
- // Hackfix until incorrect ascent values are fixed in poppler (fdo#75667)
- if ((fontName->cmpN("Arial", 5) == 0) &&
- (ascent > 0.717) && (ascent < 0.719))
- {
- ascent = 0.905;
- }
- else if ((fontName->cmpN("Times New Roman", 15) == 0) &&
- (ascent > 0.682) && (ascent < 0.684))
- {
- ascent = 0.891;
- }
-
- // normalize coordinates: correct from baseline-relative to upper
- // left corner of glyphs
- double x2(0.0), y2(0.0);
- state->textTransformDelta( 0.0,
- ascent,
- &x2, &y2 );
-
- const double fFontSize(state->getFontSize());
- x += x2*fFontSize;
- y += y2*fFontSize;
+ const double fontSize = state->getFontSize();
const double aPositionX(x-originX);
const double aPositionY(y-originY);
const double* pTextMat=state->getTextMat();
- printf( "drawChar %f %f %f %f %f %f %f %f ",
+ printf( "drawChar %f %f %f %f %f %f %f %f %f ",
normalize(aPositionX),
normalize(aPositionY),
normalize(aPositionX + dx),
@@ -886,7 +861,9 @@ void PDFOutDev::drawChar(GfxState *state, double x, double y,
normalize(pTextMat[0]),
normalize(pTextMat[2]),
normalize(pTextMat[1]),
- normalize(pTextMat[3]) );
+ normalize(pTextMat[3]),
+ normalize(fontSize)
+ );
// silence spurious warning
(void)&mapUCS2;