-
Notifications
You must be signed in to change notification settings - Fork 649
Description
Describe the bug
Chart titles fail to render Unicode text properly for many non-Latin texts, displaying rectangle placeholders (□□□□) instead of the actual characters. This affects Bengali, Hindi, Chinese, Japanese, Korean, Tamil, Telugu, Thai, Gujarati, Punjabi, and likely other languages / Unicode characters.
To Reproduce
- Create a chart
- Set the chart title to Bengali: বিক্রয় তথ্য চার্ট
- Render the chart
- Observe that title shows as □□□□□□□ instead of Bengali characters
Expected behavior
Chart titles should render Unicode text correctly, displaying the actual characters instead of rectangle placeholders.
Actual behavior
Non-Latin scripts render as rectangle placeholders (□□□□), indicating missing font support or text rendering issues.
Environment
OS: Windows 11
Framework: .NET 9
LiveCharts Version: 2.0.0-rc5.4
Platform: WinForms
Package: LiveChartsCore.SkiaSharpView.WinForms
Minimal Reproduction Code
csharpusing LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore.SkiaSharpView.WinForms;
var chart = new CartesianChart
{
Title = new LabelVisual
{
Text = "বিক্রয় তথ্য চার্ট", // Bengali text - will show as rectangles
TextSize = 24,
Padding = new LiveChartsCore.Drawing.Padding(15)
},
Series = new ISeries[]
{
new LineSeries<double>
{
Values = new double[] { 10, 25, 15, 30, 20 }
}
}
};
Complete test case: Unicode Text Rendering Test
Impact
This significantly limits the international usability of LiveCharts2 for applications targeting:
- South Asian markets (Hindi, Bengali, Tamil, Telugu, Gujarati, Punjabi)
- East Asian markets (Chinese, Japanese, Korean)
- Southeast Asian markets (Thai)
- Middle Eastern markets (Arabic, Hebrew, Urdu)
Additional Context
- Other .NET WinForms text rendering (Labels, TextBoxes) works correctly with these scripts
- Issue specifically affects LiveCharts2 text rendering through SkiaSharp
- Similar font/Unicode issues also affect axis labels, legends, and tooltips
Related Issues: This may be related to broader SkiaSharp Unicode text rendering limitations or font configuration in the LiveChartsCore.SkiaSharp package.
EDIT:
I found a workaround.
Add this code in your application initialization:
/// <summary>
/// Configures LiveCharts font for proper Unicode text rendering, fixing the rendering of non-Latin languages.
/// </summary>
private static void SetLiveChartTitleFont()
{
// I use "Segoe UI" for my app, but for some reason it doesn't work here. "Nirmala UI" seems to work for every language.
LiveChartsCore.LiveCharts.Configure(config => config
.AddSkiaSharp()
.AddDefaultMappers()
.HasGlobalSKTypeface(SKTypeface.FromFamilyName("Nirmala UI"))
);
}
It works for most languages, but still not all.