freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Rotated text


From: Frank W. Miller
Subject: Re: [ft-devel] Rotated text
Date: Sat, 05 Jul 2008 22:07:01 -0600

OK, lets try this again.

I've posted the source code for what I'm trying to do.  If you build
this application you can run it with these arguments:

rotate <font> <text>

where <font> is a TrueType font file and <text> is some string text,
e.g. "text".

This should get you the text spinning inside of a 640x480 window.  The
trouble is, as you'll see, its looks like arse.  The characters are not
aligned as they should be.  Any advice on this would be very helpful.

The source code is at:

http://sipuseragent.net/download/rotate.tgz


Thanks,
FM



On Thu, 2008-07-03 at 23:03 -0600, Frank W. Miller wrote:
> Greetings,
> 
> I've been wrestling with rotated text.  I've read all the documentation
> and have been working with the example code.  I'm having some real
> trouble understanding how the advance, width, and rows fields in the
> rendered bitmap can be used to compute a bbox.  Here's what I'm really
> hoping can be done:
> 
> 
> The following image is supposed to be the word "text" rotated up by
> about 15 degrees or so off the x axis.  Sorry, my ascii rendering is not
> what it could be.  The rendered text is supposed to be inside a bounding
> box, or at least, why I think of as a bounding box.
> 
>                                      [w,h]
>     +---------------------------------+
>     |                          *  *   |
>     |              *      *    **     |
>     |           *     *  *    * *     |
>     |  *  *   *   *      *       *   *|
>     |  **     *  *      *   *     **  |
>     | * *      *    *  *              |
>     |   *   *     *                   |
>     |    **                           |
>     +---------------------------------+
>    [0,0]
> 
> So, taking the sample code, to get [w,h], I've tried to just sum up the
> advance.x and advance.y fields after each glyph rendering.  That doesn't
> seem quite right.  When I actually render the text, it appears to go off
> to the left a little from what I feed the bitmap routine as [0,0].  I
> suppose I need to take into account the width and rows fields in the
> bitmap too but I'm not sure how to do it.
> 
> This may be completely out to lunch, but if anyone has any suggestions,
> I'd appreciate it.
> 
> Thanks,
> FM
> 
> 
> 
> 
> 
> _______________________________________________
> Freetype-devel mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/freetype-devel





reply via email to

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