File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ TFontHelper = class(TNoConstructObject)
8080 @return Handle to cloned font. Caller is responsible for releasing the
8181 handle.
8282 }
83+ class function GetDefaultFontSize : Integer;
84+ class function GetDefaultContentFontSize : Integer;
8385 strict private
8486 const
8587 FallbackFontName = ' Arial' ; // Fallback font name
@@ -158,6 +160,32 @@ class function TFontHelper.FontExists(const FontName: string): Boolean;
158160 Result := Screen.Fonts.IndexOf(FontName) >= 0 ;
159161end ;
160162
163+ class function TFontHelper.GetDefaultContentFontSize : Integer;
164+ var
165+ Font: TFont;
166+ begin
167+ Font := TFont.Create;
168+ try
169+ SetContentFont(Font);
170+ Result := Font.Size;
171+ finally
172+ Font.Free;
173+ end ;
174+ end ;
175+
176+ class function TFontHelper.GetDefaultFontSize : Integer;
177+ var
178+ Font: TFont;
179+ begin
180+ Font := TFont.Create;
181+ try
182+ SetDefaultFont(Font);
183+ Result := Font.Size;
184+ finally
185+ Font.Free;
186+ end ;
187+ end ;
188+
161189class function TFontHelper.IsInCommonFontSizeRange (
162190 const FontSize: Integer): Boolean;
163191begin
You can’t perform that action at this time.
0 commit comments