mirror of https://github.com/Chlumsky/msdfgen.git
Add Travis-CI configuration file
* Use Travis, a continuous build service for Linux and OSX builds, to make sure future commits and contributions can build. * Add build badge to README.md Tests, like unit tests, can also be added but this commit only adds a simple build task by calling "make" on a Linux and OSX environment with the g++ compiler.
This commit is contained in:
parent
cc12790fa4
commit
f8da5b39d5
|
|
@ -0,0 +1,26 @@
|
||||||
|
# Run in a container, for speed
|
||||||
|
sudo: false
|
||||||
|
|
||||||
|
# Enable C++ support
|
||||||
|
language: cpp
|
||||||
|
|
||||||
|
# Use gcc and g++
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
|
||||||
|
# Test on both Linux and OSX (there's no Windows support)
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
|
|
||||||
|
# Install project dependencies
|
||||||
|
before_install:
|
||||||
|
- |-
|
||||||
|
if [ $TRAVIS_OS_NAME == osx ]; then
|
||||||
|
brew update
|
||||||
|
brew install freetype
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build steps
|
||||||
|
script:
|
||||||
|
- make
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
# Multi-channel signed distance field generator
|
# Multi-channel signed distance field generator
|
||||||
|
[](https://travis-ci.org/Chlumsky/msdfgen)
|
||||||
|
|
||||||
This is a utility for generating signed distance fields from vector shapes and font glyphs,
|
This is a utility for generating signed distance fields from vector shapes and font glyphs,
|
||||||
which serve as a texture representation that can be used in real-time graphics to efficiently reproduce said shapes.
|
which serve as a texture representation that can be used in real-time graphics to efficiently reproduce said shapes.
|
||||||
|
|
@ -86,7 +87,7 @@ in order to generate a distance field. Please note that all classes and function
|
||||||
|
|
||||||
- Acquire a `Shape` object. You can either load it via `loadGlyph` or `loadSvgShape`, or construct it manually.
|
- Acquire a `Shape` object. You can either load it via `loadGlyph` or `loadSvgShape`, or construct it manually.
|
||||||
It consists of closed contours, which in turn consist of edges. An edge is represented by a `LinearEdge`, `QuadraticEdge`,
|
It consists of closed contours, which in turn consist of edges. An edge is represented by a `LinearEdge`, `QuadraticEdge`,
|
||||||
or `CubicEdge`. You can construct them from two endpoints and 0 to 2 Bézier control points.
|
or `CubicEdge`. You can construct them from two endpoints and 0 to 2 B<EFBFBD>zier control points.
|
||||||
- Normalize the shape using its `normalize` method and assign colors to edges if you need a multi-channel SDF.
|
- Normalize the shape using its `normalize` method and assign colors to edges if you need a multi-channel SDF.
|
||||||
This can be performed automatically using the `edgeColoringSimple` heuristic, or manually by setting each edge's
|
This can be performed automatically using the `edgeColoringSimple` heuristic, or manually by setting each edge's
|
||||||
`color` member. Keep in mind that at least two color channels must be turned on in each edge, and iff two edges meet
|
`color` member. Keep in mind that at least two color channels must be turned on in each edge, and iff two edges meet
|
||||||
|
|
@ -163,8 +164,8 @@ The text shape description has the following syntax.
|
||||||
- Points in a contour are separated with semicolons.
|
- Points in a contour are separated with semicolons.
|
||||||
- The last point of each contour must be equal to the first, or the symbol `#` can be used, which represents the first point.
|
- The last point of each contour must be equal to the first, or the symbol `#` can be used, which represents the first point.
|
||||||
- There can be an edge segment specification between any two points, also separated by semicolons.
|
- There can be an edge segment specification between any two points, also separated by semicolons.
|
||||||
This can include the edge's color (`c`, `m`, `y` or `w`) and/or one or two Bézier curve control points inside parentheses.
|
This can include the edge's color (`c`, `m`, `y` or `w`) and/or one or two B<EFBFBD>zier curve control points inside parentheses.
|
||||||
|
|
||||||
For example,
|
For example,
|
||||||
```
|
```
|
||||||
{ -1, -1; m; -1, +1; y; +1, +1; m; +1, -1; y; # }
|
{ -1, -1; m; -1, +1; y; +1, +1; m; +1, -1; y; # }
|
||||||
|
|
@ -173,4 +174,4 @@ would represent a square with magenta and yellow edges,
|
||||||
```
|
```
|
||||||
{ 0, 1; (+1.6, -0.8; -1.6, -0.8); # }
|
{ 0, 1; (+1.6, -0.8; -1.6, -0.8); # }
|
||||||
```
|
```
|
||||||
is a teardrop shape formed by a single cubic Bézier curve.
|
is a teardrop shape formed by a single cubic B<EFBFBD>zier curve.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue