freetype
[Top][All Lists]
Advanced

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

Re: [ft] Stray pixel from FT_Outline_Get_Bitmap()?


From: Ian Britten
Subject: Re: [ft] Stray pixel from FT_Outline_Get_Bitmap()?
Date: Thu, 05 Aug 2010 11:42:09 -0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100624 Mandriva/3.0.5-0.1mdv2009.1 (2009.1) Thunderbird/3.0.5

On 05/08/10 02:09 AM, Werner LEMBERG wrote:

Might there be a key place that does some sort of equivalent of a
"PutPixel(i, j, value)" that I could watch while debugging my
Cairo-based case?  Or does the algorithm not lend itself to that?  I
figure someone must be turning on that offending pixel, and
detecting that case might illuminate the problem.

The two central routines are Vertical_Sweep_Span and
Horizontal_Sweep_Span in combination with the drop-out control
functions Vertical_Sweep_Drop and Horizontal_Sweep_Drop.  The generic
calls to them happen in the function Draw_Sweep.  The first pass
handles the vertical sweep, the second pass (if asked for) does a
horizontal sweep which basically only checks for drop-outs.

For each scanline, the start and end points of spans are calculated,
sorted, and passed to the *_Sweep_Span routines.  They blacken all
pixels fully covered by the spans – this is trivial – and then decide
how to render the partially covered ones and what to do with gaps –
this is tricky.  I've tried to improve the drop-out handling in 2.3.10
(the documentation in the TrueType specification is very bad
unfortunately); I've probably worsened your particular case.

Ok, thanks for the overview.  I've been stepping through this stuff,
adding print statements (See attached), etc, but have a couple of
questions/comments...

- Note that I cut the "A" part out of my font, so I'm only rendering
  the accent part at the top.  It seems to be 4 scanlines, matching
  some of the attached output.
- Even though I'm getting different rasterization results between
  2.3.9 and 2.3.11, I can't seem to see anything different being done.
  The output I attached is the same for both versions, leading me to
  suspect I'm not looking at the relevant code.
- I found the spot(s) in Vertical_Sweep_Span() where some pixels
  are being set (See attached), but I can't seem to find where the
  rest of the pixels are being set.  I had expected the 'while' loop
  at the bottom to be doing it, setting 0xFF into *target, but that
  loop is never entered...
- Vertical_Sweep_Drop() is never called.
- Horizontal_Sweep_Span() is called, but doesn't do anything (The
  'if' is never entered).
- Horizontal_Sweep_Drop() doesn't do anything when called (Bails
  early due to leftmost/rightmost stub tests)
- Can you clarify what you define a 'dropout' to be, so I'm not
  making any incorrect assumptions?

I know all this is kindof vague, but I've still had no luck
isolating a reproducible test case, so this is the best I can
offer at the moment...  By any chance, does the output maybe
suggest what is going on, or where I should be looking closer?

Again, many thanks for any help/suggestions!
Ian

Attachment: out.txt
Description: Text document


reply via email to

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