freetype
[Top][All Lists]
Advanced

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

Re: Initial pen position in freetype?


From: Werner LEMBERG
Subject: Re: Initial pen position in freetype?
Date: Tue, 21 Jul 2020 16:36:47 +0200 (CEST)

> After drawing a glyph with freetype the pen is advanced as follows:
>
> pen.x += face->glyph->advance.x;
> pen.y += face->glyph->advance.y;
>
> (possibly plus a kerning delta)
>
> But my question is, how do you set the initial pen position of the
> first character, relative to the upper left bound of the drawing
> surface?

Please have a look into the example programs, for example

  https://www.freetype.org/freetype2/docs/tutorial/example1.c

If this doesn't answer your question please go into more detail.

> Setting it to {0,0} isn't correct, as it would draw the first line
> mostly above the top of the drawing surface, and too close to the
> left bound.

Correct.

If you have suggestions how to improve the documentation (API
reference or tutorial) please send a patch :-)


    Werner



reply via email to

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