-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor FontMetrics #1485
Comments
a couple of pretty unrelated observations:
The way I usually handle defaults in Smoosic, and I think it might work well for font defaults: export enum FONT_FAMILY_DEFAULTS {
SANS_DEFAULT: 'Arial, , sans-serif ', SERIF_DEFAULT: 'Times New Roman, serif'
};
export interface FontInfo {
family?: string;
size?: number | string;
weight?: string | number;
style?: string;
static get defaults() {
return { family: FONT_FAMILY_DEFAULTS.SANS_DEFAULT, size: 10, weight: FONT_WEIGHT.NORMAL, style: FONT_STYLE.NORMAL };
}
} I think having a Font.SIZE is a little misleading since it's just a default for the size of a 'FontInfo'. And music fonts have a different default size. I realize this is a lot of trivial changes, but 90% of the time we want FontInfo.defaults whenever a text font is needed for a modifier. We might also want to have a defaultSans and defaultSerif (default) font, with FontInfo.defaults returning FontInfo.defaultSans.
When we add 'FontKerning', that would apply only to text fonts. If we decide to read music fonts directly from font files, I don't think any of this will change. |
@AaronDavidNewman I have created a new issue with your comment. I agree that the mix today is not clear. |
FontMetrics has two issues that I would like to resolve:
any
I will submit a PR including all the changes and smaller PRs (part of the previous one to facilitate the review)
The text was updated successfully, but these errors were encountered: