> > > > the SVG just contains two lines of text: > > > > <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> > > <svg encoding="ISO-8859-1" width="82.55mm" height="203mm" > > text-rendering="optimizeLegibility"> > > <text x="0mm" y="10mm" style="font-size: 16.0pt">Line 1</text> > > <text x="0mm" y="20mm" style="font-size: 16.0pt">Line 2</text> > > </svg> > > > > > in svg with resolutions other than 72.0 dpi text is transformed twice: > > In RenderFreetype FT_Vector_Transform and FT_Glyph_Transform > is called. > In FT_Glyph_Transform FT_Vector_Transform is called, too. > > When I remove the call of FT_Vector_Transform in > RenderFreetype the text is rendered as expected. > > > file: magick\annotate.c > function: RenderFreetype > > FT_Vector_Transform(&glyph.origin,&affine); > > (void) FT_Glyph_Transform(glyph.image,&affine,&glyph.origin); > > file: ttf\src\base\ftglyph.c: > function: FT_Glyph_Transform > > FT_Vector_Transform( &glyph->advance, matrix ); >
Hello, I have checked that with ImageMagick-6.4.8-7. The call to FT_Vector_Transform is needed at both positions (RenderFreetype in annotate.c and FT_Glyph_Transform in ftglyph.c). But the following block in RenderFreetype in annotate.c(line 1367-1380) should be removed, because the "density"-scaling is already applied to the draw_info->affine matrix > if (draw_info->density != (char *) NULL) > { > GeometryInfo > geometry_info; > > MagickStatusType > flags; > > flags=ParseGeometry(draw_info->density,&geometry_info); > resolution.x=geometry_info.rho; > resolution.y=geometry_info.sigma; > if ((flags & SigmaValue) == 0) > resolution.y=resolution.x; > } These commands, using coders/svg.c, show different (corrected) behaviour: convert -density 36 test.svg test_36.jpg convert -density 72 test.svg test_72.jpg convert -density 144 test.svg test_144.jpg These commands, using librsvg, are not affected (Tested with ImageMagick-6.4.1-0): convert -density 36 test.svg test_36.jpg convert -density 72 test.svg test_72.jpg convert -density 144 test.svg test_144.jpg These commands are not affected: convert test_36.jpg -draw "text 10,10 Annotation" test_36_anno.jpg convert test_72.jpg -draw "text 10,10 Annotation" test_72_anno.jpg convert test_144.jpg -draw "text 10,10 Annotation" test_144_anno.jpg By the way: I had to change the source before compiling: - In the function Magick::Image::map in Magick++/lib/Image.cpp(line 1253): change "RemapImage" to "MagickCore::RemapImage" - In the function MogrifyImage in wand/mogrify.c(line 1006-1025;line 1220-1236): The encipher/decipher functions must be out-IF-DEFfed #if defined(MAGICKCORE_CIPHER_SUPPORT) if (LocaleCompare("decipher",option+1) == 0) { ... } #endif #if defined(MAGICKCORE_CIPHER_SUPPORT) if (LocaleCompare("encipher",option+1) == 0) { ... } #endif - In the function FormatMagickSize in magick\string.c(line 1018): change "MagickOffsetType" to "MagickOffsetSize" Best regards Thomas Stegemann _______________________________________________ Magick-developers mailing list Magick-developers@imagemagick.org http://studio.imagemagick.org/mailman/listinfo/magick-developers