|
@@ -1,5 +1,8 @@
|
|
|
# Multi-channel signed distance field generator
|
|
# Multi-channel signed distance field generator
|
|
|
|
|
|
|
|
|
|
+[](https://github.com/sponsors/Chlumsky)
|
|
|
|
|
+[](https://buymeacoffee.com/chlumsky)
|
|
|
|
|
+
|
|
|
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.
|
|
|
Although it can also be used to generate conventional signed distance fields best known from
|
|
Although it can also be used to generate conventional signed distance fields best known from
|
|
@@ -46,7 +49,7 @@ the CMake configuration will take care of fetching all required packages from vc
|
|
|
|
|
|
|
|
The standalone program is executed as
|
|
The standalone program is executed as
|
|
|
```
|
|
```
|
|
|
-msdfgen.exe <mode> <input> <options>
|
|
|
|
|
|
|
+msdfgen <mode> <input> <options>
|
|
|
```
|
|
```
|
|
|
where only the input specification is required.
|
|
where only the input specification is required.
|
|
|
|
|
|
|
@@ -87,7 +90,7 @@ Some of the important ones are:
|
|
|
|
|
|
|
|
For example,
|
|
For example,
|
|
|
```
|
|
```
|
|
|
-msdfgen.exe msdf -font C:\Windows\Fonts\arialbd.ttf 'M' -o msdf.png -dimensions 32 32 -pxrange 4 -autoframe -testrender render.png 1024 1024
|
|
|
|
|
|
|
+msdfgen msdf -font C:\Windows\Fonts\arialbd.ttf 'M' -o msdf.png -dimensions 32 32 -pxrange 4 -autoframe -testrender render.png 1024 1024
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
will take the glyph capital M from the Arial Bold typeface, generate a 32×32 multi-channel distance field
|
|
will take the glyph capital M from the Arial Bold typeface, generate a 32×32 multi-channel distance field
|
|
@@ -218,3 +221,7 @@ 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ézier curve.
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+Created by Viktor Chlumský, © 2015 - 2026
|