Hi Jimmy,
Here’s why it behaves this way and how to fix it:
1. "Segoe UI" doesn’t exist on Android / iOS
When the requested font doesn’t exist, Skia falls back based on the first character .
In "90+" , it found NotoSansCJKsc-Regular , which handles 9 and 0 , but not + , so it showed a tofu block.
2. ConfigureFonts(...) only applies to MAUI UI controls
It does not apply to SkiaSharp (used by ThinkGeo for rendering). Skia needs a real font file, not the MAUI font alias. If the font files are under Resources/Fonts and marked as MauiFont , use something like:
string fontPath = await GetFontTempFilePathAsync("OpenSans-Regular.ttf");
var textStyle = new TextStyle(
"Name",
new GeoFont(fontPath, 12, DrawingFontStyles.Bold),
GeoBrushes.DarkRed
);
public static async Task<string> GetFontTempFilePathAsync(string fileName)
{
var cacheDir = FileSystem.CacheDirectory;
var targetPath = Path.Combine(cacheDir, fileName);
if (File.Exists(targetPath))
return targetPath;
Directory.CreateDirectory(cacheDir);
using var src = await FileSystem.OpenAppPackageFileAsync(fileName);
using var dest = File.Create(targetPath);
await src.CopyToAsync(dest);
return targetPath;
}
You raised a very valid point — the current font related API is a bit confusing and may behave differently across platforms. Let us think about it how to improve it. We will keep you posted.
Thanks,
Ben