Skip to content

Commit

Permalink
video: Update stb_truetype
Browse files Browse the repository at this point in the history
This was brought in in 2016 and a number of changes have been made since
then. There does not seem to be much change in functionality, but it is
a good idea to update from time to time.

Bring in the latest version:

   5736b15 ("re-add perlin noise again")

Add a few necessary functions, with dummies in some cases. Update the tests
as there are subtle changes in rendering, perhaps not for the better.

Signed-off-by: Simon Glass <[email protected]>
  • Loading branch information
sjg20 authored and trini committed Jul 14, 2023
1 parent 87c1a41 commit 04f3dcd
Show file tree
Hide file tree
Showing 3 changed files with 2,077 additions and 219 deletions.
33 changes: 33 additions & 0 deletions drivers/video/console_truetype.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,43 @@ static double tt_sqrt(double value)
return lo;
}

static double tt_fmod(double x, double y)
{
double rem;

if (y == 0.0)
return 0.0;
rem = x - (x / y) * y;

return rem;
}

/* dummy implementation */
static double tt_pow(double x, double y)
{
return 0;
}

/* dummy implementation */
static double tt_cos(double val)
{
return 0;
}

/* dummy implementation */
static double tt_acos(double val)
{
return 0;
}

#define STBTT_ifloor tt_floor
#define STBTT_iceil tt_ceil
#define STBTT_fabs tt_fabs
#define STBTT_sqrt tt_sqrt
#define STBTT_pow tt_pow
#define STBTT_fmod tt_fmod
#define STBTT_cos tt_cos
#define STBTT_acos tt_acos
#define STBTT_malloc(size, u) ((void)(u), malloc(size))
#define STBTT_free(size, u) ((void)(u), free(size))
#define STBTT_assert(x)
Expand Down
Loading

0 comments on commit 04f3dcd

Please sign in to comment.