diff --git a/3rdparty/sdf/sdf.h b/3rdparty/sdf/sdf.h index e37874f5..92f46891 100644 --- a/3rdparty/sdf/sdf.h +++ b/3rdparty/sdf/sdf.h @@ -113,7 +113,7 @@ static float sdf__clamp01(float x) return x < 0.0f ? 0.0f : (x > 1.0f ? 1.0f : x); } -void sdfCoverageToDistance(unsigned char* out, int outstride, float maxdist, +void sdfCoverageToDistance(unsigned char* out, int outstride, const unsigned char* img, int width, int height, int stride) { int x, y; diff --git a/README.md b/README.md index 18b11520..19341b13 100644 --- a/README.md +++ b/README.md @@ -482,6 +482,13 @@ NanoVG is small antialiased vector graphics rendering library. https://github.com/memononen/nanovg +### SDF (MIT) + +Sweep-and-update Euclidean distance transform of an antialised image for contour +texturing. + +https://github.com/memononen/SDF + ### stb_image, stb_truetype (Public Domain) http://nothings.org diff --git a/examples/common/font/font_manager.cpp b/examples/common/font/font_manager.cpp index c341364d..0a35ed2b 100644 --- a/examples/common/font/font_manager.cpp +++ b/examples/common/font/font_manager.cpp @@ -3,7 +3,7 @@ * License: http://www.opensource.org/licenses/BSD-2-Clause */ -#define USE_EDTAA3 1 +#define USE_EDTAA3 0 #include "../common.h" @@ -347,7 +347,7 @@ static void makeDistanceMap(const uint8_t* _img, uint8_t* _outImg, uint32_t _wid free(outside); free(inside); #else - sdfBuild(_outImg, _width, 2.0f, _img, _width, _height, _width); + sdfBuild(_outImg, _width, 8.0f, _img, _width, _height, _width); #endif // USE_EDTAA3 }