export distanceRange
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
355e98bb19
commit
086e452e15
|
@ -115,7 +115,8 @@ WELLSPRINGAPI Wellspring_Font* Wellspring_CreateFont(
|
||||||
uint32_t fontBytesLength,
|
uint32_t fontBytesLength,
|
||||||
const uint8_t *atlasJsonBytes,
|
const uint8_t *atlasJsonBytes,
|
||||||
uint32_t atlasJsonBytesLength,
|
uint32_t atlasJsonBytesLength,
|
||||||
float *pPixelsPerEm
|
float *pPixelsPerEm,
|
||||||
|
float *pDistanceRange
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Batches are not thread-safe, recommend one batch per thread. */
|
/* Batches are not thread-safe, recommend one batch per thread. */
|
||||||
|
|
|
@ -155,6 +155,7 @@ typedef struct Font
|
||||||
float descender;
|
float descender;
|
||||||
float lineHeight;
|
float lineHeight;
|
||||||
float pixelsPerEm;
|
float pixelsPerEm;
|
||||||
|
float distanceRange;
|
||||||
|
|
||||||
float scale;
|
float scale;
|
||||||
float kerningScale; // kerning values from stb_tt are in a different scale
|
float kerningScale; // kerning values from stb_tt are in a different scale
|
||||||
|
@ -351,7 +352,8 @@ Wellspring_Font* Wellspring_CreateFont(
|
||||||
uint32_t fontBytesLength,
|
uint32_t fontBytesLength,
|
||||||
const uint8_t *atlasJsonBytes,
|
const uint8_t *atlasJsonBytes,
|
||||||
uint32_t atlasJsonBytesLength,
|
uint32_t atlasJsonBytesLength,
|
||||||
float *pPixelsPerEm
|
float *pPixelsPerEm,
|
||||||
|
float *pDistanceRange
|
||||||
) {
|
) {
|
||||||
Font *font = Wellspring_malloc(sizeof(Font));
|
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.width = json_object_get_uint(atlasObject, "width");
|
||||||
font->packer.height = json_object_get_uint(atlasObject, "height");
|
font->packer.height = json_object_get_uint(atlasObject, "height");
|
||||||
font->pixelsPerEm = json_object_get_double(atlasObject, "size");
|
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->ascender = json_object_get_double(metricsObject, "ascender");
|
||||||
font->descender = json_object_get_double(metricsObject, "descender");
|
font->descender = json_object_get_double(metricsObject, "descender");
|
||||||
|
@ -480,6 +483,8 @@ Wellspring_Font* Wellspring_CreateFont(
|
||||||
Wellspring_free(jsonRoot);
|
Wellspring_free(jsonRoot);
|
||||||
|
|
||||||
*pPixelsPerEm = font->pixelsPerEm;
|
*pPixelsPerEm = font->pixelsPerEm;
|
||||||
|
*pDistanceRange = font->distanceRange;
|
||||||
|
|
||||||
return (Wellspring_Font*) font;
|
return (Wellspring_Font*) font;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue