anchor.diff:    for I := 0 to 255 do
     for K := 0 to 255 do
     begin
  -    chMaxX := 0;
  -    chMaxY := 0;
  +    chMaxX := -1;
  +    chMaxY := -1;
   
       //Scan all pixels of a single letter to determine its dimensions
  -    //Excluding 1/1 coords which are for grid lines (irregardless of visibility)
  -    for L := 1 to cellY - 1 do
  -    for M := 1 to cellX - 1 do
  +    for L := 0 to cellY - 1 do
  +    for M := 0 to cellX - 1 do
       begin
         //Pixel coords
         cX := K * cellX + M;
         cY := I * cellY + L;
   
  -      if pngData[cY * pngWidth + cX] shr 24 > 0 then
  +      if pngData[cY * pngWidth + cX] <> BG_COLOR then
         begin
           chMaxX := Math.Max(chMaxX, M);
           chMaxY := Math.Max(chMaxY, L);
  
positive.code:   cellX, cellY, pngWidth, pngHeight: Word;
    pngData: TKMCardinalArray;
    I, K, M, L: Integer;
    chMaxX, chMaxY: Byte;
    cX, cY, dstX, dstY: Word;
    letter: Word;
    lineHeight: Byte;
  
negative.code: procedure TKMFontDataEdit.ExportGridPng(const aFilename: string; aPadding: TRect);
  var
    cellX, cellY, pngWidth, pngHeight: Word;
    I, M, L: Integer;
    chWidth, chHeight: Byte;
    srcX, srcY: Word;
    dstPixel, srcPixel: Cardinal;
    data: TKMCardinalArray;
  begin
    cellX := MaxLetterWidth + aPadding.Left + aPadding.Right;
    cellY := MaxLetterHeight + aPadding.Top + aPadding.Bottom;
    pngWidth := 256 * cellX;
    pngHeight := 256 * cellY;
  
    SetLength(data, pngWidth * pngHeight);
  
    //fill everything so we later cut the letters from it
    for I := 0 to pngWidth * pngHeight - 1 do
      data[I] := BG_COLOR;
  
    //Draw letters
    for I := 0 to fCharCount - 1 do
  