diff --git a/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs b/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs index 298599b..aa18959 100644 --- a/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs +++ b/PortfolioManager/UIUtils/TextMarkerImageGenerator.cs @@ -1,8 +1,10 @@ using System; using System.IO; +using Avalonia.Automation; using Avalonia.Media; using Avalonia.Media.Imaging; using MarketData.CNNProcessing; +using MarketData.Utils; using ScottPlot; using SkiaSharp; @@ -28,8 +30,9 @@ public static class TextMarkerImageGenerator public static Image GenerateImage(String text,int fontSize=12) { ImageHelper imageHelper = new ImageHelper(); - // SKFont font = new SKFont(SKTypeface.FromFamilyName(familyName: "Helvetica", weight: SKFontStyleWeight.Normal, width: SKFontStyleWidth.UltraCondensed, slant: SKFontStyleSlant.Italic), fontSize, .75f); - SKFont font = new SKFont(SKTypeface.FromFamilyName("Helvetica",500,5,SKFontStyleSlant.Upright), fontSize); + SKFont font = default; + if (Utility.IsOSWindows())font = new SKFont(SKTypeface.FromFamilyName("Helvetica",500,5,SKFontStyleSlant.Upright), fontSize); + else font = new SKFont(SKTypeface.FromFamilyName(familyName: "Helvetica", weight: SKFontStyleWeight.Normal, width: SKFontStyleWidth.UltraCondensed, slant: SKFontStyleSlant.Upright), fontSize, .80f); SKTextAlign align = SKTextAlign.Left; imageHelper.CreateBoundedText(text, SKColors.Black, SKColors.White, align, font); using MemoryStream memoryStream = new MemoryStream();