diff --git a/Services/PdfExportService.cs b/Services/PdfExportService.cs index 6e9ddec..d3a9add 100644 --- a/Services/PdfExportService.cs +++ b/Services/PdfExportService.cs @@ -14,7 +14,6 @@ namespace ShiftScheduler.Services static PdfExportService() { QuestPDF.Settings.License = LicenseType.Community; - QuestPDF.Settings.FontDiscoveryPaths.Add("fonts"); } public byte[] GenerateMonthlySchedulePdf(List shiftsWithTransport) @@ -99,26 +98,20 @@ namespace ShiftScheduler.Services foreach (var day in Enumerable.Range(0, dayInWeek)) { var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day)); - var shift = shiftWithTransport?.Shift; - - if (shift != null && shift.IsPngIcon) + if (shiftWithTransport != null) { - // For PNG icons, embed the image - var iconPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "icons", shift.Icon); - if (File.Exists(iconPath)) + var shift = shiftWithTransport.Shift; + if (shift.IsPngIcon) { - table.Cell().Height(24).Element(CellStyleMiddle).Image(iconPath).FitArea(); + var iconPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "icons", shift.Icon); + if (File.Exists(iconPath)) + { + table.Cell().Height(24).Element(CellStyleMiddle).Image(iconPath).FitArea(); + continue; + } } - else - { - table.Cell().Element(CellStyleMiddle).Text(shift.Name); - } - } - else - { - // For text/emoji icons, render as text - var icon = shift?.Icon ?? shift?.Name; - table.Cell().Element(CellStyleMiddle).Text(icon); + + table.Cell().Element(CellStyleMiddle).Text(shift.Name); } } foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek)) @@ -130,7 +123,7 @@ namespace ShiftScheduler.Services foreach (var day in Enumerable.Range(0, dayInWeek)) { var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day)); - var morningTime = shiftWithTransport?.Shift.MorningTime.Length > 0 ? $"🌅 {shiftWithTransport?.Shift.MorningTime}" : ""; + var morningTime = shiftWithTransport?.Shift.MorningTime.Length > 0 ? $"{shiftWithTransport?.Shift.MorningTime}" : ""; table.Cell().Element(CellStyleMiddle).Text(morningTime); } foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek)) @@ -142,7 +135,7 @@ namespace ShiftScheduler.Services foreach (var day in Enumerable.Range(0, dayInWeek)) { var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day)); - var afternoonTime = shiftWithTransport?.Shift.AfternoonTime.Length > 0 ? $"🌆 {shiftWithTransport?.Shift.AfternoonTime}" : ""; + var afternoonTime = shiftWithTransport?.Shift.AfternoonTime.Length > 0 ? $"{shiftWithTransport?.Shift.AfternoonTime}" : ""; table.Cell().Element(CellStyleMiddle).Text(afternoonTime); } foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek)) @@ -155,7 +148,7 @@ namespace ShiftScheduler.Services { var shiftWithTransport = shiftsWithTransport.GetValueOrDefault(weekDates.ElementAtOrDefault(day)); var transportInfo = GetTransportSummary(shiftWithTransport); - table.Cell().Element(CellStyleLast).Text(transportInfo).FontFamily("NotoEmoji-Regular"); + table.Cell().Element(CellStyleLast).Text(transportInfo); } foreach (var day in Enumerable.Range(dayInWeek, 7 - dayInWeek)) { @@ -196,7 +189,7 @@ namespace ShiftScheduler.Services { var departure = transport.DepartureTime.ToString("HH:mm"); var arrival = transport.ArrivalTime.ToString("HH:mm"); - return $"🚂 {departure}→{arrival}"; + return $"{transport.Platform}: {departure}→{arrival}"; } private static void RenderEmptyCell(TableDescriptor table) diff --git a/Services/ShiftScheduler.Services.csproj b/Services/ShiftScheduler.Services.csproj index 7b150d0..fb248fc 100644 --- a/Services/ShiftScheduler.Services.csproj +++ b/Services/ShiftScheduler.Services.csproj @@ -16,25 +16,4 @@ - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - diff --git a/Services/fonts/NotoEmoji-Bold.ttf b/Services/fonts/NotoEmoji-Bold.ttf deleted file mode 100644 index cb12a0d..0000000 Binary files a/Services/fonts/NotoEmoji-Bold.ttf and /dev/null differ diff --git a/Services/fonts/NotoEmoji-Light.ttf b/Services/fonts/NotoEmoji-Light.ttf deleted file mode 100644 index 9dd228e..0000000 Binary files a/Services/fonts/NotoEmoji-Light.ttf and /dev/null differ diff --git a/Services/fonts/NotoEmoji-Medium.ttf b/Services/fonts/NotoEmoji-Medium.ttf deleted file mode 100644 index eef3662..0000000 Binary files a/Services/fonts/NotoEmoji-Medium.ttf and /dev/null differ diff --git a/Services/fonts/NotoEmoji-Regular.ttf b/Services/fonts/NotoEmoji-Regular.ttf deleted file mode 100644 index e93a498..0000000 Binary files a/Services/fonts/NotoEmoji-Regular.ttf and /dev/null differ diff --git a/Services/fonts/NotoEmoji-SemiBold.ttf b/Services/fonts/NotoEmoji-SemiBold.ttf deleted file mode 100644 index 8e30c57..0000000 Binary files a/Services/fonts/NotoEmoji-SemiBold.ttf and /dev/null differ diff --git a/Services/fonts/NotoEmoji-VariableFont_wght.ttf b/Services/fonts/NotoEmoji-VariableFont_wght.ttf deleted file mode 100644 index 3773d02..0000000 Binary files a/Services/fonts/NotoEmoji-VariableFont_wght.ttf and /dev/null differ