freetype-devel
[Top][All Lists]
Advanced

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

[Devel] Transformation of Type 1 Fonts


From: Allen Barnett
Subject: [Devel] Transformation of Type 1 Fonts
Date: Mon, 2 Jul 2001 15:30:43 -0400

Hi,

I'm using the following sequence of commands to render rotated strings:

FT_New_Face( ..., &face )
FT_Set_Char_Size
FT_Vector_Unit( vector, angle )
assign vector components to an FT_Matrix, matrix
FT_Set_Transform( face, matrix )
for each character in the string:
        FT_Get_Glyph_Index( face, character )
        FT_Load_Glyph( ..., FT_LOAD_DEFAULT )
        FT_Render_Glyph( face->glyph, ft_render_mode_mono)
        draw bitmap
        move pen by advance

This seems to work OK for TrueType fonts. However, I've noticed that the 
glyphs in Type 1 fonts seem to be rotated by 2*angle, probably because 
FT_Outline_Transform is called twice. (I put a print statement in 
FT_Outline_Transform, but it's hard to tell for sure since it seems to be 
called for each glyph when the face is first loaded, unlike TrueType where 
FT_Outline_Transform is only called for the loaded glyphs.)(I think.)

I attached a little program which I hope helps illustrate my problem.

On my RedHat 7.1/i386 system I got:

alpaca$ ./try6 90 /usr/X11R6/lib/X11/fonts/webfonts/arial.ttf A
----------------
----------**----
--------**------
------**--------
---***-*--------
-**----*--------
*------*--------
-**----*--------
---***-*--------
------**--------
--------**------
----------**----
----------------
alpaca$ ./try6 90 /usr/X11R6/lib/X11/fonts/Type1/cour.pfa A
***----***------
-*------*-------
-*-----*--------
--******--------
--*----*--------
--*---*---------
---*--*---------
---*--*---------
----**----------
----****--------

Thanks,
Allen

Attachment: try.c
Description: Text Data


reply via email to

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