-
I'm trying to generate plots in AWS Lambda and running into an issue whereby the textual elements of the plots do not get displayed. I suspect this might be a font issue, but I'm not positive - I also think I've set up my fonts correctly, but alas. Has anyone else ran into this problem before? I don't get this issue when rendering the plot locally (on a Windows PC). What I expect: What I get: Relevant plot setup code (identical across my local setup and Lambda): var plot = new Plot();
plot.Axes.DateTimeTicksBottom();
plot.Legend.Alignment = Alignment.LowerLeft;
plot.Legend.FontName = "Segoe UI"; // also tried "Segoe UI.ttf"
var scatter = plot.Add.Scatter(data);
scatter.LegendText = $"P95 price";
var line = plot.Add.Line(avgStartCoordinates, avgEndCoordinates);
line.LinePattern = LinePattern.Dashed;
line.LegendText = "30d average"; fonts.conf: <?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/var/task/Fonts/</dir>
<cachedir>/tmp/fonts-cache/</cachedir>
<config></config>
</fontconfig> Fonts in the Fonts folder within the project folder ( .csproj contains the relevant file copy config: <None Update="Fonts/Segoe UI.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Fonts/Segoe UI Bold.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Fonts/Segoe UI Italic.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Fonts/Segoe UI Bold Italic.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="fonts.conf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> Not sure what's missing. Or is it perhaps not related to fonts at all and instead some other issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Thanks for sharing this! I'm not sure yet what the issue is... seems related to mono/SkiaSharp#2827 |
Beta Was this translation helpful? Give feedback.
I think anything that has a
LabelStyle
has aLabelStyle.SetTypeface()
to can call to inject a custom typeface. It's a new feature from ScottPlot 5.0.33 #3722. Hopefully this is the last missing piece to help you find a solution!