diff --git a/include/Wellspring.h b/include/Wellspring.h index 2cf60e3..0c58834 100644 --- a/include/Wellspring.h +++ b/include/Wellspring.h @@ -115,7 +115,8 @@ WELLSPRINGAPI Wellspring_Font* Wellspring_CreateFont( uint32_t fontBytesLength, const uint8_t *atlasJsonBytes, uint32_t atlasJsonBytesLength, - float *pPixelsPerEm + float *pPixelsPerEm, + float *pDistanceRange ); /* Batches are not thread-safe, recommend one batch per thread. */ diff --git a/src/Wellspring.c b/src/Wellspring.c index efffc71..b664b6b 100644 --- a/src/Wellspring.c +++ b/src/Wellspring.c @@ -155,6 +155,7 @@ typedef struct Font float descender; float lineHeight; float pixelsPerEm; + float distanceRange; float scale; float kerningScale; // kerning values from stb_tt are in a different scale @@ -351,7 +352,8 @@ Wellspring_Font* Wellspring_CreateFont( uint32_t fontBytesLength, const uint8_t *atlasJsonBytes, uint32_t atlasJsonBytesLength, - float *pPixelsPerEm + float *pPixelsPerEm, + float *pDistanceRange ) { Font *font = Wellspring_malloc(sizeof(Font)); @@ -399,6 +401,7 @@ Wellspring_Font* Wellspring_CreateFont( font->packer.width = json_object_get_uint(atlasObject, "width"); font->packer.height = json_object_get_uint(atlasObject, "height"); font->pixelsPerEm = json_object_get_double(atlasObject, "size"); + font->distanceRange = json_object_get_double(atlasObject, "distanceRange"); font->ascender = json_object_get_double(metricsObject, "ascender"); font->descender = json_object_get_double(metricsObject, "descender"); @@ -480,6 +483,8 @@ Wellspring_Font* Wellspring_CreateFont( Wellspring_free(jsonRoot); *pPixelsPerEm = font->pixelsPerEm; + *pDistanceRange = font->distanceRange; + return (Wellspring_Font*) font; }