"Scott Nebor" on  wrote...
| Has anyone ever noticed how fonts scale differently for different font
| sizes?
| 
| For example, I have the following php code
| 
| $MagickWand = NewMagickWand();
| MagickNewImage($MagickWand, 800,400);
| MagickSetFormat($MagickWand,"jpg");
| $dw = NewDrawingWand();
| DrawSetFontSize($dw, 10);
| $white = NewPixelWand("white");
| $black = NewPixelWand("black");
| DrawSetFillColor ($dw, $white);
| DrawRectangle($dw,0,0, 1000,1000);
| DrawSetFontWeight($dw, 100);
| $txt = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20\n";
| $txt .= "the quick brown fox jumped over the lazy dog";
| DrawSetFillColor ($dw, $black);
| DrawSetFontSize($dw, 20);
| DrawAnnotation($dw, 2, 20, $txt);
| 
| DrawSetFontSize($dw, 15);
| DrawAnnotation($dw, 2, 100, $txt);
| 
| MagickDrawImage($MagickWand, $dw);
| MagickEchoImageBlob($MagickWand);
| 
| When the image spits out, the 'g' in dog lines up with that start of '19'
| for a font size of 20.  However, for a font size of 15, the 'g' in dog lines
| up with the end of '19'.  My understanding of true type fonts is that they
| should always appear and line up the same no matter which font size is used.
| Is this perhaps a deficiency of imagemagick?
| 
| I tried this code both with and without using a true type font and the
| results are the same.  If you do the same type of test in a word processor
| such as ms-word, the two different fonts line up the same.
| 

This is a nice example of exactly what I have mentioned in IM Examples
  http://www.cit.gu.edu.au/~anthony/graphics/imagick6/text/#pointsize

And what Glen reported..  If you have a reference to the contrary,
please mail us...


---IM Examples Quote---
The look of a font is also effected by the fonts "-pointsize" and
"-density".

If you just double the density ("-density 144"), a 12 point font will be
drawn with its dimensions doubled, should still look like the original
12 point font, just drawn at a larger scale with better smoothing of the
edges.

On the other hand doubling a points pointsize ("-pointsize 24") will
also produce a font that looks about the same size as one with doubled
density or resolution. However because a font is designed to look a
particular way, the thickness of lines in a font may not change much at
a larger point size.

Also at low resolutions the physical size limitations of the pixels may
effect the look of a font. So what looks good with one setting may not
be as good at another setting. It is all a very complex issue.

Basically changing the "-density" of a font will not generally produce
the same result as an equivelent change to a fonts "-pointsize".
Particularly with regard to line thickness and overall 'style' of the
font.
---END QUOTE---

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
        Exodendritic : to be out of your tree
                                        -- Robert Langsford
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to