In StyleManager.GetStyle(), the cache key is constructed using the fontWidth parameter (which is a nullable SKFontStyleWidth?) instead of the resolved rFontWidth value.
// Current code (StyleManager.cs line 164):
var key = (fontFamily, fontSize, fontWeight, fontWidth, fontItalic);
// Resolved value:
var rFontWidth = fontWidth ?? SKFontStyleWidth.Normal;
This causes styles with different font widths to collide in the cache if the input fontWidth is null (defaulting to Normal), which can lead to incorrect styles being returned from the cache.
In
StyleManager.GetStyle(), the cache key is constructed using thefontWidthparameter (which is a nullableSKFontStyleWidth?) instead of the resolvedrFontWidthvalue.This causes styles with different font widths to collide in the cache if the input
fontWidthis null (defaulting to Normal), which can lead to incorrect styles being returned from the cache.