Delphi/꿀팁
크기에 맞춰 FontSize 자동계산 하기 - 1
간단하게 예제로 Label의 크기에 맞춰 FontSize를 조절해 보겠습니다.function CalcFontSize(nWidth, nHeight : Integer; sText : string): Integer;Const MAX_FONT_SIZE = 32; MIN_FONT_SIZE = 2; var I : Integer; begin with TLabel.Create(nil) do begin try Caption := sText; for I := MIN_FONT_SIZE to MAX_FONT_SIZE do begin Width := nWidth; WordWrap := True; AutoSize := True; Font.Size := I; if (Height < nHeight) and (Width < nWidt..