|
@@ -1,4 +1,5 @@
|
|
|
using System;
|
|
using System;
|
|
|
|
|
+using System.Linq;
|
|
|
using QuestPDF.Helpers;
|
|
using QuestPDF.Helpers;
|
|
|
using QuestPDF.Infrastructure;
|
|
using QuestPDF.Infrastructure;
|
|
|
using QuestPDF.Skia.Text;
|
|
using QuestPDF.Skia.Text;
|
|
@@ -273,7 +274,16 @@ namespace QuestPDF.Fluent
|
|
|
[Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
|
|
[Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
|
|
|
public static TextStyle Fallback(this TextStyle style, TextStyle? value = null)
|
|
public static TextStyle Fallback(this TextStyle style, TextStyle? value = null)
|
|
|
{
|
|
{
|
|
|
- return style;
|
|
|
|
|
|
|
+ var currentFontFamilies = style.FontFamilies ?? Array.Empty<string>();
|
|
|
|
|
+ var fallbackFontFamilies = value?.FontFamilies ?? Array.Empty<string>();
|
|
|
|
|
+
|
|
|
|
|
+ var targetFontFamilies = currentFontFamilies
|
|
|
|
|
+ .Concat(fallbackFontFamilies)
|
|
|
|
|
+ .Where(x => !string.IsNullOrWhiteSpace(x))
|
|
|
|
|
+ .Distinct()
|
|
|
|
|
+ .ToArray();
|
|
|
|
|
+
|
|
|
|
|
+ return style.FontFamily(targetFontFamilies);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
[Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
|
|
[Obsolete("This setting is not supported since the 2024.3 version. Please use the FontFamilyFallback method or rely on the new automated fallback mechanism.")]
|