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
Draw_Sweep
Vertical_Sweep_Init
Vertical_Sweep_Span: y=1, x1=227,x2=560  ,  e1=4,e2=8
  VSS: Changing target[0] from 0 to 15
  VSS: Changing target[1] from 0 to 128
Vertical_Sweep_Step
Vertical_Sweep_Span: y=2, x1=163,x2=496  ,  e1=3,e2=7
  VSS: Changing *target from 0 to 31
Vertical_Sweep_Step
Vertical_Sweep_Span: y=3, x1=99,x2=432  ,  e1=2,e2=6
  VSS: Changing *target from 0 to 62
Vertical_Sweep_Step
Vertical_Sweep_Span: y=4, x1=35,x2=368  ,  e1=1,e2=5
  VSS: Changing *target from 0 to 124
Vertical_Sweep_Step
Draw_Sweep
Horizontal_Sweep_Init
Horizontal_Sweep_Drop: y=0, x1=289,x2=291  ,  e1=320,e2=256
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=1, x1=225,x2=291
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=2, x1=161,x2=291
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=3, x1=97,x2=291
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=4, x1=34,x2=291
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=5, x1=6,x2=291
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=6, x1=6,x2=241
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=7, x1=6,x2=178
Horizontal_Sweep_Step
Horizontal_Sweep_Span: y=8, x1=6,x2=114
Horizontal_Sweep_Step
Horizontal_Sweep_Drop: y=9, x1=6,x2=50  ,  e1=64,e2=0
Horizontal_Sweep_Step
_______________________________________________
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to