[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] Scaled Outline Coordinates at Scanline Intersections
From: |
Werner LEMBERG |
Subject: |
Re: [ft] Scaled Outline Coordinates at Scanline Intersections |
Date: |
Sat, 20 Nov 2010 05:23:46 +0100 (CET) |
> I am interested in being able to calculate the value, in 26.6
> coordinates, where the scanlines (at a given ppem) intersect each
> point in a given outline.
>
> For instance, as a crude example just using pixels: If I'm dealing with
> an outline of the letter "T", at 8x5 px, I'm looking for a result of
> something like:
>
> line 0 (top): 1.0 and 7.0
> line 1 : 3.0 and 5.0
> line 2 : 3.0 and 5.0
> line 3 : 3.0 and 5.0
> line 4 : 3.0 and 5.0
>
> Which visually corresponds to:
>
> |_|1|2|3|4|5|6|_|
> |_|_|_|3|4|_|_|_|
> |_|_|_|3|4|_|_|_|
> |_|_|_|3|4|_|_|_|
> |_|_|_|3|4|_|_|_|
>
> What is the easiest way to obtain these values, given an outline and a
> ppem? I've looked in ftgrays.c, where I imagine I could obtain this
> information, however I'm having a hard time comprehending what is
> happening in there.
Have you tried to run, say, ftview with
FT2_DEBUG=smooth:7 ftview ...
and look at the debugging output? This gives the covered pixels per
scanline. Of course, you have to compile FreeType with debugging
enabled; see docs/DEBUG.
Werner