From fb8e7458aaf8cc4ee726ca55b28d4f5c4df584ea Mon Sep 17 00:00:00 2001 From: Sean Date: Tue, 1 Jul 2025 20:40:57 -0400 Subject: [PATCH] commit latest --- PortfolioManager/UIUtils/TextMarkerImageGenerator.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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();