anchor.diff:    for I := 1 to Length(aText) do
     begin
       if aText[I] = #32 then Inc(AdvX, fFontData[aFont].WordSpacing)
  -                      else Inc(AdvX, fFontData[aFont].Letters[byte(aText[I])].Width + CharSpacing);
  +                      else Inc(AdvX, fFontData[aFont].Letters[Ord(aText[I])].Width + CharSpacing);
   
       if (AdvX > aMaxPxWidth) then
       begin
  
positive.code: 
    AdvX := 0;
    PrevX := 0;
    LastSpace := -1;
    CharSpacing := fFontData[aFont].CharSpacing; //Spacing between letters, this varies between fonts
  
    I := 1;
    while I <= Length(aText) do
    begin
      //Ignore color markups [$FFFFFF][]
      if (aText[I]='[') and (I+1 <= Length(aText)) and (aText[I+1]=']') then
        inc(I) //Skip past this markup
  
negative.code: 
      if (aText[I]=#32) or (aText[I]=#124) then
      begin
        LastWrappable := I;
        PrevX := AdvX;
        LastWrappableIsSpace := True;
      end;
  
      //This algorithm is not perfect, somehow line width is not within SizeX, but very rare
      if ((AdvX > aMaxPxWidth)and(LastWrappable<>-1))or(aText[I]=#124) then
      begin
        if (aText[I] <> #124) and aIndentAfterNL then
        begin
          Insert(INDENT, aText, LastWrappable);
          Inc(I, Length(INDENT));
          Inc(AdvX, Length(INDENT)*fFontData[aFont].WordSpacing);
        end;
        if LastWrappableIsSpace then
          aText[LastWrappable] := #124 //Replace last whitespace with EOL
        else
          Insert(#124, aText, LastWrappable+1); //Insert EOL after last wrappable char
        dec(AdvX, PrevX); //Subtract width since replaced whitespace
        LastWrappable := -1;
      end;
      //Force an EOL part way through a word
      if aForced and (AdvX > aMaxPxWidth) and (LastWrappable = -1) then
      begin
        Insert(#124, aText, I); //Insert an EOL before this character
        AdvX := 0;
        LastWrappable := -1;
        if aIndentAfterNL then
        begin
          Insert(INDENT, aText, I+1);
  