Skip to content
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

Add a concept of FontFamilies & Collections #6

Open
3 tasks
feliwir opened this issue Jan 18, 2020 · 2 comments
Open
3 tasks

Add a concept of FontFamilies & Collections #6

feliwir opened this issue Jan 18, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@feliwir
Copy link
Contributor

feliwir commented Jan 18, 2020

Hey, i wanted to give some ideas to make the library easier to use and usable without having to add font files at all:

  • Allow loading of system fonts
  • Allow loading fonts by their family name
  • Allow font substitions

It might be worth considering to switch to https://github.com/SixLabors/Fonts , since it allows loading of system fonts and has a concept of families & collections. So you can just do stuff like this:

FontFamily arial = SystemFonts.Find("Arial");
Font font = new Font(arial, 1f, FontStyle.Regular);
@drjaydenm
Copy link
Owner

I really like the idea of being able to load system fonts and the font library you linked to looks pretty good, I'll take a look over it and see how I can integrate it.

What particular features with font families would you be looking for? A thought that comes to mind is some sort of simple markdown-style language where the library can automatically convert to regular/bold/italic within a string of text if the correct font weights are present in a family. Is this the sort of stuff you have in mind?

@feliwir
Copy link
Contributor Author

feliwir commented Jan 18, 2020

@drjaydenm the thing i'd be looking for with font families is loading of fonts just by defining their description/family. E.g. font-family: Verdana, "Lucida Sans Unicode", sans-serif would try to load exactly that font. The benefit of this approach would be that a substitution could be loaded if the requested font is not available.

Regarding SixLabors.Fonts: I did a PR a while ago which exposes the Glyph data: https://github.com/SixLabors/Fonts/pull/102/files So i guess that library could be used as a replacement for Typography (also considering that library has a NuGet and is maybe a little bit more stable)

@drjaydenm drjaydenm added the enhancement New feature or request label Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants