Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 918cdea

Browse files
committed
Fix bug with PDF non-math text
svn path=/trunk/matplotlib/; revision=3681
1 parent 6a3cec5 commit 918cdea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ft2font.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Glyph::Glyph( const FT_Face& face, const FT_Glyph& glyph, size_t ind) :
5656
setattr("height", Py::Int( face->glyph->metrics.height) );
5757
setattr("horiBearingX", Py::Int( face->glyph->metrics.horiBearingX / HORIZ_HINTING) );
5858
setattr("horiBearingY", Py::Int( face->glyph->metrics.horiBearingY) );
59-
setattr("horiAdvance", Py::Int( face->glyph->metrics.horiAdvance / HORIZ_HINTING) );
59+
setattr("horiAdvance", Py::Int( face->glyph->metrics.horiAdvance) );
6060
setattr("linearHoriAdvance", Py::Int( face->glyph->linearHoriAdvance / HORIZ_HINTING) );
6161
setattr("vertBearingX", Py::Int( face->glyph->metrics.vertBearingX) );
6262

@@ -697,7 +697,7 @@ FT2Font::get_kerning(const Py::Tuple & args) {
697697
FT_Vector delta;
698698

699699
if (!FT_Get_Kerning( face, left, right, mode, &delta )) {
700-
return Py::Int(delta.x / HORIZ_HINTING);
700+
return Py::Int(delta.x);
701701
}
702702
else {
703703
return Py::Int(0);
@@ -775,7 +775,7 @@ FT2Font::set_text(const Py::Tuple & args, const Py::Dict & kwargs) {
775775
FT_Vector delta;
776776
FT_Get_Kerning( face, previous, glyph_index,
777777
FT_KERNING_DEFAULT, &delta );
778-
pen.x += delta.x / HORIZ_HINTING;
778+
pen.x += delta.x;
779779
}
780780
error = FT_Load_Glyph( face, glyph_index, flags );
781781
if ( error ) {

0 commit comments

Comments
 (0)