freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] Questions about rotated characters at small point sizes.


From: Greg Inman
Subject: [Devel] Questions about rotated characters at small point sizes.
Date: Fri, 27 Apr 2001 17:44:05 +0100

Hello,

I am trying to integrate the FreeType 2 package into our product to run on a
Solaris machine and to display PostScript Type 1 font files in graphics
windows on the screen.  The reason for the work is to replace our use of the
Display PostScript facility which has been shipped with the operating system
in the past but will soon be dropped by the manufacturers.

My problem is that the quality of small text drawn at an angle is not as
good as that drawn by Display PostScript.  I am wondering whether this is
due to me not driving the FreeType package correctly.

I am drawing one character at a time.  The function that calls my library
gives me as real numbers a point size, an angle in radians and a location
within the window as an (x, y) pair.  The origin of the window is the top
left corner.

The calling function then specifies the position of the next character by
using the metrics in the current font's corresponding AFM file which is read
and used independently of FreeType 2.

I have based my code on the ftstring demo example found in ft2demos and the
code shown in the tutorial sections of the documentation.

After calling FT_Get_Glyph() to get the glyph image I am calling
FT_Glyph_Transform() with a rotation matrix if the angle is not 0.  I am not
giving this function any 2d translation vector.  Then I am calling
FT_Glyph_To_Bitmap() to render a monochrome bitmap and giving it a
translation vector.  This translation vector is composed only of the
fractional parts of the location vector.  For example, if the character is
to be located at (100.543, 700.672)  the translation vector I use is (0.543,
0.672).

Is it ok to use only the fractional parts in the translation vector?  I am
assuming that the rendered bitmap of a character is the same no matter where
in the window it is placed and that the important consideration is the
offsets (in 1/64ths of a pixel) in x and y within the pixel.

Should I be giving the 2d translation vector to FT_Glyph_Transform() as well
as the 2x2 rotation matrix?

Within the translation vector does the y-coordinate increase upwards?

At present I am using the 2.0.1 release.  Has there been any significant
work in 2.0.2 relating to Type 1 fonts?

The font I am using is a Helvetica Bold font in pfa format.  The first two
lines of the font file are as follows:

%!PS-AdobeFont-1.0: Helvetica-Bold 001.007
%%CreationDate: Thu Mar 15 09:42:55 1990

My Product Manager is happy with those characters drawn at the larger point
sizes and those without a rotation.  But I do need to find an improvement
with rotated characters at the small point sizes.

Any help that can be offered will be greatly appreciated.

Many thanks,
Greg Inman

============================================================
Greg Inman
Senior Software Engineer
Laser-Scan, Cambridge Science Park CB4 0FY
Telephone: 01223-420414,  Fax: 01223-420044
email:  address@hidden
"Any opinions expressed are mine and not necessarily those of Laser-Scan"
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]