From 6074ed0e7e7e4f980a9812d69ae8398e65c46d07 Mon Sep 17 00:00:00 2001 From: MarcinZiabek Date: Thu, 27 Apr 2023 17:01:50 +0200 Subject: [PATCH] Font fallback: fixed regression --- Source/QuestPDF/Infrastructure/TextStyleManager.cs | 4 +++- Source/QuestPDF/QuestPDF.csproj | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/QuestPDF/Infrastructure/TextStyleManager.cs b/Source/QuestPDF/Infrastructure/TextStyleManager.cs index 6ab5d33..b8c627c 100644 --- a/Source/QuestPDF/Infrastructure/TextStyleManager.cs +++ b/Source/QuestPDF/Infrastructure/TextStyleManager.cs @@ -256,9 +256,11 @@ namespace QuestPDF.Infrastructure { var result = style; + if (string.IsNullOrWhiteSpace(result.FontFamily) || overrideFontFamily) + result = MutateStyle(result, TextStyleProperty.FontFamily, parent.FontFamily, overrideStyle); + result = MutateStyle(result, TextStyleProperty.Color, parent.Color, overrideStyle); result = MutateStyle(result, TextStyleProperty.BackgroundColor, parent.BackgroundColor, overrideStyle); - result = MutateStyle(result, TextStyleProperty.FontFamily, parent.FontFamily, overrideStyle); result = MutateStyle(result, TextStyleProperty.Size, parent.Size, overrideStyle); result = MutateStyle(result, TextStyleProperty.LineHeight, parent.LineHeight, overrideStyle); result = MutateStyle(result, TextStyleProperty.LetterSpacing, parent.LetterSpacing, overrideStyle); diff --git a/Source/QuestPDF/QuestPDF.csproj b/Source/QuestPDF/QuestPDF.csproj index a5b5bcf..4d68a77 100644 --- a/Source/QuestPDF/QuestPDF.csproj +++ b/Source/QuestPDF/QuestPDF.csproj @@ -3,7 +3,7 @@ MarcinZiabek CodeFlint QuestPDF - 2022.12.4 + 2022.12.5 QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API. Easily generate PDF reports, invoices, exports, etc. $([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/Resources/ReleaseNotes.txt")) 9