opcon / QuickFont

A Modern OpenGL Font Rendering Library for OpenTK
https://github.com/opcon/QuickFont
MIT License
83 stars 25 forks source link

Stop using System.Drawing #29

Open opcon opened 7 years ago

opcon commented 7 years ago

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 commented 7 years ago

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.