2020-05-26 23:49:45 +02:00
|
|
|
# A simple library to render Haiku Vector Icons
|
|
|
|
|
|
|
|
:warning: **Do not use this library. It is not ready yet.**
|
|
|
|
|
|
|
|
The [Haiku](https://www.haiku-os.org) operating system uses a custom
|
|
|
|
format to represent vector icons. The Haiku Vector Icon Format
|
|
|
|
(hvif) is optimized to create tiny files that can be saved with
|
|
|
|
the file metadata. For a good technical overview of the format see
|
|
|
|
[this](http://blog.leahhanson.us/post/recursecenter2016/haiku_icons.html)
|
|
|
|
blog post by Leah Hanson. The goal of this library is to allow the
|
2020-05-29 20:40:43 +02:00
|
|
|
usage of this format independent of the Haiku ecosystem.
|
2020-05-30 21:54:53 +02:00
|
|
|
The best way to create new icons is to use the
|
|
|
|
[Icon-O-Matic](https://www.haiku-os.org/docs/userguide/en/applications/icon-o-matic.html)
|
|
|
|
tool that ships with Haiku.
|
2020-05-26 23:49:45 +02:00
|
|
|
|
2020-05-29 20:40:43 +02:00
|
|
|
The library is written in modern standard C and MIT licensed. When
|
2021-04-24 23:36:24 +02:00
|
|
|
finished it will feature a parser and and serializer for hvif files
|
|
|
|
without any dependencies beyond *libc* and multiple simple backends.
|
|
|
|
Furthermore, a toy tool to convert *hvif* files into *png* files is
|
|
|
|
included.
|
2020-05-26 23:49:45 +02:00
|
|
|
|
|
|
|
The author is not associated with the Haiku project.
|
|
|
|
|
2020-05-30 21:54:53 +02:00
|
|
|
## Current Status
|
2020-05-26 23:49:45 +02:00
|
|
|
|
2021-04-24 23:36:24 +02:00
|
|
|
The library is currently under active development. The current parser
|
2020-05-26 23:49:45 +02:00
|
|
|
should be able to parse *hvif* files created with current Haiku builds,
|
2021-04-24 23:36:24 +02:00
|
|
|
but is mostly untested. There is an experimental rasterizer based on
|
|
|
|
[cairo](https://www.cairographics.org/) is included. The purpose of this
|
|
|
|
rasterizer is testing. It is not feature complete, but renders most real
|
|
|
|
world icons reasonably well.
|
2020-05-26 23:49:45 +02:00
|
|
|
|
2020-05-30 21:54:53 +02:00
|
|
|
### Example
|
2020-05-26 23:49:45 +02:00
|
|
|
|
2020-05-30 21:54:53 +02:00
|
|
|
The `File_GoogleFS` icon from the Haiku distribution as rendered by Haiku:
|
|
|
|
|
|
|
|
![](docs/examples/File_GoogleFS_orig.png)
|
|
|
|
|
|
|
|
and as rendered with the current cairo based rasterizer:
|
|
|
|
|
|
|
|
![](docs/examples/File_GoogleFS_hviflight.png)
|
|
|
|
|
|
|
|
While not perfect, the result is quite decent.
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
|
|
|
### Release Distribution
|
|
|
|
|
|
|
|
The build system is standard auto tools. When downloading a release distribution
|
|
|
|
the usual
|
|
|
|
```bash
|
|
|
|
$ ./configure
|
|
|
|
$ make -j
|
|
|
|
```
|
|
|
|
and `make install` as root should work. Beside a recent C compiler and
|
|
|
|
`pkg-config` the *cairo* library is required for now. Since no sensible
|
|
|
|
functionality independent of *cairo* is implemented as of now, cairo is
|
|
|
|
a hard dependency.
|
|
|
|
|
|
|
|
### Development
|
|
|
|
|
|
|
|
To compile a freshly cloned repository run:
|
2020-05-26 23:49:45 +02:00
|
|
|
|
|
|
|
```bash
|
|
|
|
$ autoreconf -i
|
|
|
|
$ ./configure
|
|
|
|
$ make -j
|
|
|
|
```
|
|
|
|
|
2020-05-30 21:54:53 +02:00
|
|
|
On NixOS the included `shell.nix` script can be used to bring the
|
|
|
|
dependencies and a couple of development tools into scope.
|
|
|
|
|
|
|
|
### Documentation
|
2020-05-29 23:27:03 +02:00
|
|
|
|
2020-05-26 23:49:45 +02:00
|
|
|
HTML documentation can be generated with `make html` if Doxygen is
|
|
|
|
installed.
|
|
|
|
|
|
|
|
## Contribution
|
|
|
|
|
|
|
|
Contributions are very welcome. Please send patches or bugreports to
|
2020-05-30 22:24:44 +02:00
|
|
|
`commits at schurr dot at`. If you are unfamiliar with the Email based git
|
2020-05-26 23:49:45 +02:00
|
|
|
workflow, see [this](https://git-send-email.io/) excellent tutorial.
|