freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] aligning glyphs from different fonts


From: John Hunter
Subject: Re: [Freetype] aligning glyphs from different fonts
Date: Mon, 23 Feb 2004 13:43:24 -0600
User-agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i686-pc-linux-gnu)

>>>>> "Turner" == Turner David <address@hidden> writes:

    Turner> You should basically use an algorithm like the following:

Hi David, thanks for the detailed response.  I am still having a
problem though; my concern is less about alignment between lines ans
alignment within a line.  In the algorithm you gave, I don't see any
way to adjust the baseline for a given font, since Y+max_ascender in
your algorithm is face independent.

I think a picture might better describe my problem that the previous
explanation.  In the image below, the integral and parentheses glyphs
come from one font file (cmsy10.ttf in the ftdump in my OP) and the
other symbols come from two other font files.

  http://nitace.bsd.uchicago.edu:8080/files/share/math.png

The cmsy10 glyphs are top aligned and the other glyphs are bottom
aligned.  The bottom of the rectangle shows the y value that I am
using in the code below

for c, font, glyph in glyphs:
    xmin, ymin, xmax, ymax = glyph.bbox
    font.draw_glyph_to_image(int(x+xmin/64.0), int(y-ymax/64.0), glyph) 
    x += glyph.horiAdvance/64.0

The font objects in the example above may come from the same or
different face.

which is basically lifted from example1.c in the tutorial (xmin is
glyph_bitmap->left and ymax is glyph_bitmap->top).

Is there some global face property or a glyph property that should
alert me to the problem I am having with the cmsy10 glyphs?

Any global offset like max ascender won't correct this problem AFAIK
because it appears to be face dependent.  If you last post addresses
this, apologies for not comprehending it!

Thanks again,
John Hunter



reply via email to

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