Auto Scale a Memo

edited 8:27PM in FastReport 3.0
hi,

is there a way to make a fixed sized memo scale its font size to show its whole contents? tried it with setting th font size per script an checking the height but had near to no success (:
procedure TextOnBeforePrint(Sender: TfrxComponent);
var
  TargetH: Extended;
  CurrentH: Extended;
  FontSize: Integer;
begin
  TargetH := 5.90;
  FontSize := 30;
  Text.Font.Size := FontSize;
  CurrentH := Text.CalcHeight() / fr1cm;
  while ((CurrentH > TargetH) and (Text.Font.Size > 8)) do
  begin
    FontSize := FontSize - 1;
    Text.Font.Size := FontSize;
    CurrentH := Text.CalcHeight() * fr1cm;
  end;
end;

any help is appreciated

cheers
Chris

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.