void UpdateFont()
{
if (Control == null || Element == null)
- return;
+ return;
+
+ var newFont = Element.ToNSFont();
+
+ // The font needs to have the default font size to avoid clipping
+ var originalFontSize = (NSNumber)Control.Font.FontDescriptor.FontAttributes[NSFont.SizeAttribute];
+ // Recreate the font with the default size
+ newFont = NSFont.FromDescription(newFont.FontDescriptor, originalFontSize.FloatValue);
- Control.Font = Element.ToNSFont();
+ // Apply the font
+ Control.Font = newFont;
}
void UpdateMaximumDate()
Control.TextColor = textColor.ToNSColor();
}
}
-}
\ No newline at end of file
+}
if (Control == null || Element == null)
return;
- Control.Font = Element.ToNSFont();
+ var newFont = Element.ToNSFont();
+
+ // The font needs to have the default font size to avoid clipping
+ var originalFontSize = (NSNumber)Control.Font.FontDescriptor.FontAttributes[NSFont.SizeAttribute];
+ // Recreate the font with the default size
+ newFont = NSFont.FromDescription(newFont.FontDescriptor, originalFontSize.FloatValue);
+
+ // Apply the font
+ Control.Font = newFont;
}
void UpdateTime()
Control.TextColor = textColor.ToNSColor();
}
}
-}
\ No newline at end of file
+}