fontsize Delphi/꿀팁 넓이에 맞춰 FontSize 자동계산 하기 - 2 2019/02/14 - [ - Delphi] - 크기에 맞춰 FontSize 자동계산 하기 - 1 간단하게 예제로 Label의 넓이에 맞춰 FontSize를 조절해 보겠습니다.function CalcFontSize(obj : TLabel; nWidth, nHeight : Integer; sText : string): Integer;Const MAX_FONT_SIZE = 32; MIN_FONT_SIZE = 2; var ARect : TRect; I : Integer;begin ARect := Default(TRect); ARect.Right := nWidth; ARect.Bottom := nHeight; for I := MIN_FONT_SIZE to MAX_FONT_SIZE do begin (obj as .. 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.. 이전 1 다음