-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Starting from version 5.0.35, there is a slowdown in SP5 when using the Plot.Font.Automatic() method (as shown in the figure).
In previous versions, the rendering speed was consistently above 500 FPS. However, after version 5.0.35, it suddenly dropped to below 10 FPS (as shown in the figure, from the Automatic Font Detection example in the cookbook).
I investigated the issue and found that it seems to be related to the SetBestFont() method.
In the method, FontName = Fonts.Detect(Text); returns an empty FontName when Text is an empty string, causing an abnormal slowdown.
I added a condition that returns Fonts.Default when Text is empty, and the slowdown disappeared.
public void SetBestFont()
{
Typeface = null;
// FontName = Fonts.Detect(Text);
FontName = Text == "" ? Fonts.Default : Fonts.Detect(Text);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels