Skip to content

Stop using System.Drawing #29

@opcon

Description

@opcon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions