anchor.diff:     Begin
         z := active;
         Active := Active.Next;
  -      Dispose(z);
  +      ReleaseObject(Z);
      End;
  -
  -   if scanline<>@scanline_data then
  -      FreeMem(scanline);
   End;
   
   Function TTFFont.GetKerning(Current, Next: Cardinal): Integer;
  
positive.code:                // find insertion point
                 if active = nil then
                    active := z
                 else if (z^.x < active^.x) then                  // insert at front
                 begin
                    z^.next := active;
                    active := z;
                 end else begin
                    // find thing to insert AFTER
                    p := active;
                    while (p^.next<>nil) and (PStBttActiveEdge(p^.next)^.x < z^.x) do
                       p := PStBttActiveEdge(p^.next);
                    // at this point, p->next->x is NOT < z->x
                    z^.next := p^.next;
                    p^.next := z;
                 end;
              end;
              Inc(eIndex);
  
negative.code:    ReleaseObject(e);
  end;
  
  Function TTFFont.new_active(Const e: TStBttEdge; off_x: Integer; start_point: Single):TStBttActiveEdge;
  Var
    z:TStBttActiveEdge;
    dxdy: Single;
  Begin
    Z := TStBttActiveEdge.Create(); // @TODO: make a pool of these!!!
  
    dxdy := (e.x1 - e.x0) / (e.y1 - e.y0);
    //STBTT_assert(e->y0 <= start_point);
  
    // round dx down to avoid going too far
    If dxdy < 0 then
      z.dx := -Floor(FIX * -dxdy)
    Else
      z.dx := Floor(FIX * dxdy);
  
    z.x := Floor(FIX * (e.x0 + dxdy * (start_point - e.y0)));
    Dec(z.x, off_x * FIX);
    z.ey := e.y1;
    z.next := nil;
  
    If e.invert<>0 Then
      z.valid := 1
    Else
      z.valid := -1;
  
    Result := z;
  end;
  
  // note: this routine clips fills that extend off the edges... ideally this
  // wouldn't happen, but it could happen if the truetype glyph bounding boxes
  // are wrong, or if the user supplies a too-small bitmap
  procedure TTFFont.stbtt__fill_active_edges(scanline: PByteArray; len: Integer; e: TStBttActiveEdge; max_weight: Integer);
  var
     x0,x1,w: Integer;
     i,j: Integer;
  