Conversation
adds support for international character sets resolves #2746
bclehmann
reviewed
Jul 14, 2023
heartacker
reviewed
Jul 14, 2023
simplifies method names and makes most logic private
helper method to identify whether a font is present on the system
Member
Author
|
After reviewing the feedback I got and thinking about this problem some more, I decided to simplify this class. The user can handle fancy things like font lookups and fallback logic. I'll merge it in like it is now, but I welcome continued feedback and am happy to change it with a new PR/issue if improvements can be made. DefaultScottPlot.Plot plt = new();
plt.Add.Signal(Generate.Sin());
plt.Add.Signal(Generate.Cos());
plt.TopAxis.Label.Text = Fonts.Default;
plt.BottomAxis.Label.Text = "Horizontal Axis";
plt.LeftAxis.Label.Text = "Vertical Axis";Changing the DefaultFonts.Default = "Comic Sans MS";
ScottPlot.Plot plt = new();
plt.Add.Signal(Generate.Sin());
plt.Add.Signal(Generate.Cos());
plt.TopAxis.Label.Text = Fonts.Default;
plt.BottomAxis.Label.Text = "Horizontal Axis";
plt.LeftAxis.Label.Text = "Vertical Axis";Best Font IdentificationFonts.Default = Fonts.Detect('频') ?? Fonts.System;
ScottPlot.Plot plt = new();
plt.Add.Signal(Generate.Sin());
plt.Add.Signal(Generate.Cos());
plt.TopAxis.Label.Text = "频率信号削减1/32";
plt.BottomAxis.Label.Text = "Horizontal Axis";
plt.LeftAxis.Label.Text = "Vertical Axis"; |
Fonts.Default and Fonts.Detect()
Contributor
|
I still believe that we should render correctly for all of user, not be beautiful firstly |
Member
Author
Thanks for being persistent about this point! I improved it by always favoring the system default font (and only using Open Sans if the default font is Segoe UI) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



adds support for international character sets