sozsoft-platform/api/src/Sozsoft.Platform.HttpApi.Host/PredefinedReports/DynamicReportFontHelper.cs
2026-06-30 23:42:46 +03:00

28 lines
879 B
C#

using System;
using DevExpress.Drawing;
namespace Sozsoft.Reports.PredefinedReports;
internal static class DynamicReportFontHelper
{
public const float HeaderFontSize = 9F;
public const float DataFontSize = 8.5F;
private const string WindowsFontFamily = "Arial";
private const string LinuxFontFamily = "Liberation Sans";
public static DXFont CreateHeaderFont(DXFontStyle style = DXFontStyle.Bold) =>
CreateValueFont(HeaderFontSize, style);
public static DXFont CreateDataFont(DXFontStyle style = DXFontStyle.Regular) =>
CreateValueFont(DataFontSize, style);
public static DXFont CreateValueFont(float size, DXFontStyle style = DXFontStyle.Regular)
{
var fontFamily = OperatingSystem.IsLinux()
? LinuxFontFamily
: WindowsFontFamily;
return new DXFont(fontFamily, size, style);
}
}