Raporların Fontları

This commit is contained in:
Sedat Öztürk 2026-06-30 23:42:46 +03:00
parent 75b459d79e
commit e8295fd449
12 changed files with 73 additions and 65 deletions

View file

@ -90,7 +90,7 @@ RUN apk add --no-cache \
fontconfig \
ttf-dejavu \
ttf-liberation \
font-noto
font-noto-emoji
# Font cache oluştur
RUN fc-cache -f -v

View file

@ -3067,7 +3067,7 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
#endregion
}
#endregion
#region AnnouncementComment
listFormName = AppCodes.Intranet.AnnouncementComment;
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName))
@ -4103,7 +4103,8 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
PivotSettingsJson = DefaultPivotSettingsJson
PivotSettingsJson = DefaultPivotSettingsJson,
EditorOptions = EncodeHtmlJson
},
new() {
ListFormCode = listForm.ListFormCode,

View file

@ -49,6 +49,7 @@ public static class ListFormSeeder_DefaultJsons
});
public static readonly string DefaultFilterJson = "\"IsDeleted\" = 'false'";
public static readonly string EncodeHtmlJson = "{ \"encodeHtml\" = false }";
public static string DefaultFilterRowJson(bool visible = true) => JsonSerializer.Serialize(new GridFilterRowDto { Visible = visible });
public static string DefaultHeaderFilterJson(bool visible = true) => JsonSerializer.Serialize(new { Visible = visible });
public static string DefaultSearchPanelJson(bool visible = true) => JsonSerializer.Serialize(new { Visible = visible });

View file

@ -129,7 +129,7 @@ public class DynamicFormReport : XtraReport
Margins = CreateReportMargins(HorizontalMargin, HorizontalMargin, 35, 35);
PaperKind = DevExpress.Drawing.Printing.DXPaperKind.A4;
Landscape = false;
Font = new DXFont("Arial", 8F);
Font = DynamicReportFontHelper.CreateDataFont();
}
#pragma warning disable CA1416
@ -178,7 +178,7 @@ public class DynamicFormReport : XtraReport
{
Text = DynamicReportImageHelper.GetLocalizedReportTitle(listForm, localizer),
BoundsF = new System.Drawing.RectangleF(0, 0, pageWidth, 30),
Font = new DXFont("Arial", 14F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateValueFont(14F, DXFontStyle.Bold),
TextAlignment = TextAlignment.MiddleLeft
});
if (!isSubReport)
@ -193,7 +193,7 @@ public class DynamicFormReport : XtraReport
{
TextFormatString = "Sayfa {0} / {1}",
BoundsF = new System.Drawing.RectangleF(pageWidth / 2, 8, pageWidth / 2, 18),
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateValueFont(8F),
TextAlignment = TextAlignment.MiddleRight
});
@ -206,7 +206,7 @@ public class DynamicFormReport : XtraReport
{
Text = DynamicReportImageHelper.Localize(localizer, group.Caption, group.Caption),
BoundsF = new System.Drawing.RectangleF(0, y, pageWidth, 22),
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateHeaderFont(),
BackColor = System.Drawing.Color.FromArgb(238, 242, 247),
Padding = new PaddingInfo(5, 5, 2, 2),
TextAlignment = TextAlignment.MiddleLeft
@ -267,7 +267,7 @@ public class DynamicFormReport : XtraReport
{
Text = DynamicReportImageHelper.GetLocalizedFieldCaption(field.Field, localizer),
BoundsF = new System.Drawing.RectangleF(x, y, width, height),
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateHeaderFont(),
BackColor = System.Drawing.Color.FromArgb(248, 250, 252),
Borders = BorderSide.All,
BorderColor = FieldBorderColor,
@ -294,7 +294,7 @@ public class DynamicFormReport : XtraReport
var label = new XRLabel
{
BoundsF = new System.Drawing.RectangleF(x, y, width, height),
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateDataFont(),
Borders = BorderSide.All,
BorderColor = FieldBorderColor,
BorderWidth = 0.25F,
@ -307,7 +307,6 @@ public class DynamicFormReport : XtraReport
if (TryGetFormattedValue(field, row, out var text))
{
label.Text = text;
label.Font = CreateValueFont(text);
}
else
{
@ -328,7 +327,7 @@ public class DynamicFormReport : XtraReport
var richText = new XRRichText
{
BoundsF = new System.Drawing.RectangleF(x, y, width, height),
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateDataFont(),
Borders = BorderSide.All,
BorderColor = FieldBorderColor,
BorderWidth = 0.25F,
@ -348,33 +347,6 @@ public class DynamicFormReport : XtraReport
return richText;
}
private static DXFont CreateValueFont(string text)
{
return ContainsEmoji(text)
? new DXFont("Segoe UI Emoji", 8F)
: new DXFont("Arial", 8F);
}
private static bool ContainsEmoji(string text)
{
if (string.IsNullOrEmpty(text))
{
return false;
}
foreach (var rune in text.EnumerateRunes())
{
if (rune.Value is >= 0x1F000 and <= 0x1FAFF or
>= 0x2600 and <= 0x27BF or
>= 0x2300 and <= 0x23FF)
{
return true;
}
}
return false;
}
private static XRPanel CreateImageValuePanel(
FormReportField field,
IDictionary<string, object> row,

View file

@ -215,7 +215,7 @@ public class DynamicGridReport : XtraReport
var requestedContentWidth = visibleFields.Sum(x => x.IsImage ? GetImageColumnWidth(x) : GetPreferredColumnWidth(x.Field));
Landscape = !isSubReport &&
(visibleFields.Count >= LandscapeColumnThreshold || requestedContentWidth > portraitContentWidth);
Font = new DXFont("Arial", 8F);
Font = DynamicReportFontHelper.CreateDataFont();
}
private static System.Drawing.Printing.Margins CreateReportMargins(
@ -326,7 +326,7 @@ public class DynamicGridReport : XtraReport
{
Text = DynamicReportImageHelper.GetLocalizedReportTitle(listForm, localizer),
BoundsF = new System.Drawing.RectangleF(0, 0, pageWidth, 30),
Font = new DXFont("Arial", 14F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateValueFont(14F, DXFontStyle.Bold),
TextAlignment = TextAlignment.MiddleLeft
});
if (!isSubReport)
@ -345,7 +345,7 @@ public class DynamicGridReport : XtraReport
{
TextFormatString = "Sayfa {0} / {1}",
BoundsF = new System.Drawing.RectangleF(pageWidth / 2, 8, pageWidth / 2, 18),
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateValueFont(8F),
TextAlignment = TextAlignment.MiddleRight
};
bottomMargin.Controls.Add(pageInfo);
@ -411,7 +411,7 @@ public class DynamicGridReport : XtraReport
{
Text = $"{caption}:",
BoundsF = new System.Drawing.RectangleF(indent, 3, captionWidth, 20),
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateHeaderFont(),
Padding = new PaddingInfo(6, 2, 0, 0),
TextAlignment = TextAlignment.MiddleLeft,
BackColor = System.Drawing.Color.FromArgb(226, 232, 240),
@ -422,7 +422,7 @@ public class DynamicGridReport : XtraReport
var valueLabel = new XRLabel
{
BoundsF = new System.Drawing.RectangleF(indent + captionWidth, 3, availableWidth - captionWidth, 20),
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateHeaderFont(),
Padding = new PaddingInfo(6, 6, 0, 0),
TextAlignment = TextAlignment.MiddleLeft,
BackColor = System.Drawing.Color.FromArgb(241, 245, 249),
@ -492,7 +492,7 @@ public class DynamicGridReport : XtraReport
Text = DynamicReportImageHelper.GetLocalizedFieldCaption(field, localizer),
WidthF = width,
Weight = width,
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateHeaderFont(),
BackColor = System.Drawing.Color.FromArgb(238, 242, 247),
Padding = new PaddingInfo(4, 4, 2, 2),
TextAlignment = TextAlignment.MiddleCenter,
@ -526,7 +526,7 @@ public class DynamicGridReport : XtraReport
{
WidthF = width,
Weight = width,
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateDataFont(),
Padding = new PaddingInfo(4, 4, 2, 2),
TextAlignment = DynamicReportImageHelper.ToTextAlignment(field.Alignment, field.SourceDbType),
Multiline = true,
@ -556,7 +556,7 @@ public class DynamicGridReport : XtraReport
var richText = new XRRichText
{
BoundsF = new System.Drawing.RectangleF(0, 0, width, height),
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateDataFont(),
Padding = new PaddingInfo(4, 4, 2, 2),
CanGrow = true
};
@ -574,7 +574,7 @@ public class DynamicGridReport : XtraReport
{
WidthF = width,
Weight = width,
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateDataFont(DXFontStyle.Bold),
Padding = new PaddingInfo(4, 4, 2, 2),
TextAlignment = DynamicReportImageHelper.ToTextAlignment(field.Alignment, field.SourceDbType)
};

View file

@ -135,7 +135,7 @@ namespace Sozsoft.Reports.PredefinedReports
this.DetailCaption1.BorderColor = System.Drawing.Color.White;
this.DetailCaption1.Borders = DevExpress.XtraPrinting.BorderSide.Left;
this.DetailCaption1.BorderWidth = 2F;
this.DetailCaption1.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F, DevExpress.Drawing.DXFontStyle.Bold);
this.DetailCaption1.Font = DynamicReportFontHelper.CreateHeaderFont();
this.DetailCaption1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(70)))), ((int)(((byte)(80)))));
this.DetailCaption1.Name = "DetailCaption1";
this.DetailCaption1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100F);
@ -146,7 +146,7 @@ namespace Sozsoft.Reports.PredefinedReports
this.DetailData1.BorderColor = System.Drawing.Color.Transparent;
this.DetailData1.Borders = DevExpress.XtraPrinting.BorderSide.Left;
this.DetailData1.BorderWidth = 2F;
this.DetailData1.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F);
this.DetailData1.Font = DynamicReportFontHelper.CreateDataFont();
this.DetailData1.ForeColor = System.Drawing.Color.Black;
this.DetailData1.Name = "DetailData1";
this.DetailData1.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100F);
@ -158,7 +158,7 @@ namespace Sozsoft.Reports.PredefinedReports
this.DetailData3_Odd.BorderColor = System.Drawing.Color.Transparent;
this.DetailData3_Odd.Borders = DevExpress.XtraPrinting.BorderSide.None;
this.DetailData3_Odd.BorderWidth = 1F;
this.DetailData3_Odd.Font = new DevExpress.Drawing.DXFont("Arial", 8.25F);
this.DetailData3_Odd.Font = DynamicReportFontHelper.CreateDataFont();
this.DetailData3_Odd.ForeColor = System.Drawing.Color.Black;
this.DetailData3_Odd.Name = "DetailData3_Odd";
this.DetailData3_Odd.Padding = new DevExpress.XtraPrinting.PaddingInfo(6, 6, 0, 0, 100F);
@ -182,7 +182,7 @@ namespace Sozsoft.Reports.PredefinedReports
this.sqlDataSource1});
this.DataMember = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ReportTemplate));
this.DataSource = this.sqlDataSource1;
this.Font = new DevExpress.Drawing.DXFont("Arial", 9.75F);
this.Font = DynamicReportFontHelper.CreateDataFont();
this.StyleSheet.AddRange(new DevExpress.XtraReports.UI.XRControlStyle[] {
this.Title,
this.DetailCaption1,

View file

@ -55,7 +55,7 @@ public partial class DynamicReport : XtraReport
HorizontalMargin,
VerticalMargin,
VerticalMargin);
Font = new DXFont("Arial", 8F);
Font = DynamicReportFontHelper.CreateDataFont();
TopMargin.HeightF = Margins.Top;
BottomMargin.HeightF = Margins.Bottom;

View file

@ -0,0 +1,28 @@
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);
}
}

View file

@ -285,7 +285,7 @@ internal static class DynamicReportImageHelper
PageInfo = PageInfo.DateTime,
TextFormatString = "{0:dd.MM.yyyy HH:mm}",
BoundsF = new System.Drawing.RectangleF(pageWidth - width, 0, width, 18),
Font = new DevExpress.Drawing.DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateHeaderFont(DevExpress.Drawing.DXFontStyle.Regular),
TextAlignment = TextAlignment.MiddleRight,
CanGrow = false
});
@ -302,7 +302,7 @@ internal static class DynamicReportImageHelper
{
Text = userName,
BoundsF = new System.Drawing.RectangleF(0, 8, pageWidth / 2, 18),
Font = new DevExpress.Drawing.DXFont("Arial", 7.5F),
Font = DynamicReportFontHelper.CreateValueFont(7.5F),
TextAlignment = TextAlignment.MiddleLeft,
CanGrow = false,
Multiline = false
@ -323,7 +323,7 @@ internal static class DynamicReportImageHelper
{
Text = criteriaText,
BoundsF = new System.Drawing.RectangleF(0, 28, pageWidth, 18),
Font = new DevExpress.Drawing.DXFont("Arial", 7.5F),
Font = DynamicReportFontHelper.CreateHeaderFont(DevExpress.Drawing.DXFontStyle.Regular),
ForeColor = System.Drawing.Color.FromArgb(100, 116, 139),
TextAlignment = TextAlignment.MiddleLeft,
CanGrow = true,

View file

@ -183,7 +183,7 @@ public class DynamicTreeReport : XtraReport
var portraitContentWidth = A4PortraitWidth - Margins.Left - Margins.Right;
var requestedContentWidth = visibleFields.Sum(x => x.IsImage ? GetImageColumnWidth(x) : GetPreferredColumnWidth(x.Field));
Landscape = visibleFields.Count >= LandscapeColumnThreshold || requestedContentWidth > portraitContentWidth;
Font = new DXFont("Arial", 8F);
Font = DynamicReportFontHelper.CreateDataFont();
}
private static System.Drawing.Printing.Margins CreateReportMargins(
@ -446,7 +446,7 @@ public class DynamicTreeReport : XtraReport
{
Text = DynamicReportImageHelper.GetLocalizedReportTitle(listForm, localizer),
BoundsF = new System.Drawing.RectangleF(0, 0, pageWidth, 30),
Font = new DXFont("Arial", 14F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateValueFont(14F, DXFontStyle.Bold),
TextAlignment = TextAlignment.MiddleLeft
});
if (!isSubReport)
@ -462,7 +462,7 @@ public class DynamicTreeReport : XtraReport
{
TextFormatString = "Sayfa {0} / {1}",
BoundsF = new System.Drawing.RectangleF(pageWidth / 2, 8, pageWidth / 2, 18),
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateValueFont(8F),
TextAlignment = TextAlignment.MiddleRight
});
@ -516,7 +516,7 @@ public class DynamicTreeReport : XtraReport
Text = DynamicReportImageHelper.GetLocalizedFieldCaption(column.Field, localizer),
WidthF = width,
Weight = width,
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateHeaderFont(),
BackColor = System.Drawing.Color.FromArgb(238, 242, 247),
Padding = new PaddingInfo(4, 4, 2, 2),
TextAlignment = TextAlignment.MiddleCenter,
@ -550,7 +550,7 @@ public class DynamicTreeReport : XtraReport
{
WidthF = width,
Weight = width,
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateDataFont(),
Padding = new PaddingInfo(4, 4, 2, 2),
TextAlignment = isTreeColumn
? TextAlignment.MiddleLeft
@ -594,7 +594,7 @@ public class DynamicTreeReport : XtraReport
var richText = new XRRichText
{
BoundsF = new System.Drawing.RectangleF(0, 0, width, height),
Font = new DXFont("Arial", 8F),
Font = DynamicReportFontHelper.CreateDataFont(),
Padding = new PaddingInfo(4, 4, 2, 2),
CanGrow = true
};
@ -611,7 +611,7 @@ public class DynamicTreeReport : XtraReport
{
WidthF = width,
Weight = width,
Font = new DXFont("Arial", 8F, DXFontStyle.Bold),
Font = DynamicReportFontHelper.CreateDataFont(DXFontStyle.Bold),
Padding = new PaddingInfo(4, 4, 2, 2),
TextAlignment = DynamicReportImageHelper.ToTextAlignment(column.Field.Alignment, column.Field.SourceDbType)
};

View file

@ -76,7 +76,7 @@ public static class DevExpressFontConfiguration
logger?.LogInformation(
"If fonts are missing, install them with: " +
"apk add fontconfig ttf-dejavu ttf-liberation font-noto && fc-cache -f -v");
"apk add fontconfig ttf-dejavu ttf-liberation font-noto-emoji && fc-cache -f -v");
}
}
catch (Exception ex)

View file

@ -842,6 +842,10 @@ const useListFormColumns = ({
column.format = column.editorOptions.format
}
if (typeof column.editorOptions.encodeHtml === 'boolean') {
column.encodeHtml = column.editorOptions.encodeHtml
}
// columnCustomizationDto
column.fixed = colData.columnCustomizationDto?.fixed
column.fixedPosition = colData.columnCustomizationDto?.fixedPosition as HorizontalEdge
@ -944,8 +948,10 @@ const useListFormColumns = ({
if (!colData.lookupDto?.dataSourceType) {
const allFormItems = gridDto.gridOptions.editingFormDto.flatMap((group) => group.items)
const imageFormItem = allFormItems.find((a) => a?.dataField === colData.fieldName)
const isImageUploadEditor = imageFormItem?.editorType2 === PlatformEditorTypes.dxImageUpload
const isImageViewerEditor = imageFormItem?.editorType2 === PlatformEditorTypes.dxImageViewer
const isImageUploadEditor =
imageFormItem?.editorType2 === PlatformEditorTypes.dxImageUpload
const isImageViewerEditor =
imageFormItem?.editorType2 === PlatformEditorTypes.dxImageViewer
if (isImageUploadEditor || isImageViewerEditor) {
// imageUploadOptions'ı önce imageFormItem.imageUploadOptions'dan al,
// yoksa editorOptions JSON içinden parse et (admin panelinde editorOptions ile yapılandırılır)