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 support to load fonts from file #2120

Closed
cwensley opened this issue Jan 22, 2022 Discussed in #2114 · 3 comments · Fixed by #2174
Closed

Add support to load fonts from file #2120

cwensley opened this issue Jan 22, 2022 Discussed in #2114 · 3 comments · Fixed by #2174
Milestone

Comments

@cwensley
Copy link
Member

Discussed in #2114

Originally posted by HaanstootZA January 14, 2022
Hi

I am busy converting some winforms to Eto, but some of my code uses a font file.
Are there any plans to allow Eto to load from font files?

var fontCollection = new PrivateFontCollection() var heighInPixels = 12; fontCollection.AddFontFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "glyphfont.ttf")); return new Font(fontCollection.Families[0], heightInPixels, GraphicsUnit.Pixel);

@cwensley cwensley added this to the 2.6.x milestone Jan 22, 2022
@morphx666
Copy link

I have been waiting for this since 2020 ;)

https://groups.google.com/g/eto-forms/c/lhW3RktLdZg

@cwensley
Copy link
Member Author

cwensley commented Feb 2, 2022

😬 sorry it has taken so long! Hopefully it'll be an easy (ish) project. Did you end up using platform-specific code for these purposes?

@morphx666
Copy link

No worries @cwensley, I appreciate all the hard work that has been put into this project.

So, answering your question: no, I didn't use any platform-specific code. I simply included the font file as part of the install script.

cwensley added a commit to cwensley/Eto that referenced this issue Mar 31, 2022
- Added FontFamily.FromFiles/FromStreams
- Added Font.FromFile/FromStream
- Added FontTypeface(string/Stream)
- Add ability to use typographic font names in WinForms by setting `FontsHandler.UseTypographicFonts = true` (off by default for now)
Fixes picoe#2120
cwensley added a commit to cwensley/Eto that referenced this issue Mar 31, 2022
- Added FontFamily.FromFiles/FromStreams
- Added Font.FromFile/FromStream
- Added FontTypeface(string/Stream)
- Add ability to use typographic font names in WinForms by setting `FontsHandler.UseTypographicFonts = true` (off by default for now)
Fixes picoe#2120
cwensley added a commit to cwensley/Eto that referenced this issue Mar 31, 2022
- Added FontFamily.FromFiles/FromStreams
- Added Font.FromFile/FromStream
- Added FontTypeface(string/Stream)
- Add ability to use typographic font names in WinForms by setting `FontsHandler.UseTypographicFonts = true` (off by default for now)
Fixes picoe#2120
cwensley added a commit to cwensley/Eto that referenced this issue Mar 31, 2022
- Added FontFamily.FromFiles/FromStreams
- Added Font.FromFile/FromStream
- Added FontTypeface(string/Stream)
- Add ability to use typographic font names in WinForms by setting `FontsHandler.UseTypographicFonts = true` (off by default for now)
Fixes picoe#2120
cwensley added a commit to cwensley/Eto that referenced this issue Mar 31, 2022
- Added FontFamily.FromFiles/FromStreams
- Added Font.FromFile/FromStream
- Added FontTypeface(string/Stream)
- Add ability to use typographic font names in WinForms by setting `FontsHandler.UseTypographicFonts = true` (off by default for now)
Fixes picoe#2120
@cwensley cwensley modified the milestones: 2.6.x, 2.6.2 Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants