From f8da5b39d5c35b28ec6709be505eb835355779f9 Mon Sep 17 00:00:00 2001 From: John-Philip Johansson Date: Sat, 28 May 2016 18:15:12 +0200 Subject: [PATCH] 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. --- .travis.yml | 26 ++++++++++++++++++++++++++ README.md | 9 +++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..877be60 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/README.md b/README.md index 7019c90..07cda97 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Multi-channel signed distance field generator +[![Build Status](https://travis-ci.org/Chlumsky/msdfgen.svg?branch=master)](https://travis-ci.org/Chlumsky/msdfgen) 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. @@ -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. 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�zier control points. - 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 `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. - 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. - 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�zier curve control points inside parentheses. + For example, ``` { -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); # } ``` -is a teardrop shape formed by a single cubic Bézier curve. +is a teardrop shape formed by a single cubic B�zier curve.