https://github.com/mackron/minidraw
Single file 2D graphics library written in C.
https://github.com/mackron/minidraw
Last synced: about 1 year ago
JSON representation
Single file 2D graphics library written in C.
- Host: GitHub
- URL: https://github.com/mackron/minidraw
- Owner: mackron
- License: other
- Created: 2019-07-17T11:25:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-30T07:31:20.000Z (almost 5 years ago)
- Last Synced: 2025-03-25T02:36:44.152Z (about 1 year ago)
- Language: C
- Size: 271 KB
- Stars: 81
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A single file path based 2D graphics library.
This is still work-in-progress. There's a lot of missing functionality and inconsistencies between
backends. Typography is also largely untested for scripts other than Latin.
If you think this library seems interesting, I'd love to hear some feedback on what you think could
be improved and what new features you might find useful.
Features
========
- Path-based 2D drawing.
- Unicode based text itemization, shaping and placement.
Supported Platforms
===================
- GDI + Uniscribe (Windows XP+)
- Cairo + Pango
Linux platforms are currently restricted the Cairo/Pango backend, but this will be improved later as
the API stabilizes and other backend's come online.
Future Plans
============
- Software backend
- Direct2D + DirectWrite backend
- Core Graphics + Core Text backend (Apple)
- PDF output
- SVG output
- Support for complex scripts such as Arabic
Building
========
Do the following in one source file:
```
#define MINIDRAW_IMPLEMENTATION
#include "minidraw.h"
```
Windows
-------
Just compile. There is no need to link to anything or specify any compiler flags.
Linux
-----
To enable the Cairo backend you will need to use the following compiler flags:
```
`pkg-config --cflags --libs cairo pango pangocairo` -ldl -lm
```
Examples
========
See the examples and tests folder for examples on how to use the API. It is based largely on other
path based APIs such as Cairo and GDI.