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

Stop using System.Drawing #29

Open
opcon opened this issue Jan 30, 2017 · 1 comment
Open

Stop using System.Drawing #29

opcon opened this issue Jan 30, 2017 · 1 comment

Comments

@opcon
Copy link
Owner

opcon commented Jan 30, 2017

The System.Drawing namespace always causes problems with Mono, and while QuickFont works okay now, it is a good idea to move away from System.Drawing altogether.

The following is a list of ways System.Drawing is used in the current codebase, and a replacement:

Use Alternative
Bitmap manipulation ImageSharp, a cross-platform image manipulation library. Still in early alpha, but probably usable enough.
Size/Rectangle/Point structs Can just implement these as standalone structs - see OpenTK
Text Rendering hints for bitmaps Not sure if this is needed or will make a difference
Converting SharpFont FTBitmaps to GDIBitmaps Can replace this conversion mechanism with one using ImageSharp
Loading fonts in the GDIFont class No alternative, this method of loading uses System.Drawing specifically for loading the fonts and so will be removed along with System.Drawing
Color class/list OpenTK has Color4, could use that instead. What does ImageSharp use?
Font Style Can create a simple enumeration for this
Brushes Can probably use ImageSharp
@opcon
Copy link
Owner Author

opcon commented Jan 30, 2017

ImageSharp contains the Size, Rectangle(F), Point structures, as well as an equivalent of the System.Drawing.Color struct. There is also some form of brush support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant