Fixed applying text style for fallback styles

This commit is contained in:
MarcinZiabek
2023-04-19 20:25:58 +02:00
parent ef89be9710
commit 8cec0059d8
5 changed files with 108 additions and 11 deletions
+34
View File
@@ -1004,5 +1004,39 @@ namespace QuestPDF.Examples
});
});
}
[Test]
public void FontFallback_Nested()
{
RenderingTest
.Create()
.ProduceImages()
.ShowResults()
.RenderDocument(container =>
{
container.Page(page =>
{
page.Margin(50);
page.PageColor(Colors.White);
page.Size(PageSizes.A6.Landscape());
page.DefaultTextStyle(x => x
.FontSize(24)
.Bold()
.Fallback(y => y
.FontFamily("Microsoft YaHei")
.Underline()
.BackgroundColor(Colors.Red.Lighten2)));
page.Content().Text(text =>
{
text.Line("Normal 中文文本 text.");
text.Line("Background 中文文本 text.").NormalWeight().BackgroundColor(Colors.Green.Lighten2);
text.Line("Background 中文文本 text.").Strikethrough().Underline(false);
text.Line("Background 中文文本 text.").Italic();
});
});
});
}
}
}