mirror of
https://github.com/love2d/megasource.git
synced 2026-08-21 05:02:11 +02:00
update harfbuzz to 10.1.0
This commit is contained in:
@@ -38,19 +38,23 @@
|
||||
#include <locale.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h> /* for isatty() */
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(__CYGWIN__)
|
||||
#include <io.h> /* for setmode() under Windows */
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h> /* for isatty() */
|
||||
#endif
|
||||
|
||||
|
||||
#include <hb-features.h>
|
||||
#include <hb.h>
|
||||
#include <hb-ot.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
|
||||
|
||||
static inline void fail (hb_bool_t suggest_help, const char *format, ...) G_GNUC_NORETURN G_GNUC_PRINTF (2, 3);
|
||||
|
||||
static inline void
|
||||
@@ -241,4 +245,44 @@ __inline float scalbnf (float x, int exp)
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline bool
|
||||
parse_color (const char *s,
|
||||
unsigned &r,
|
||||
unsigned &g,
|
||||
unsigned &b,
|
||||
unsigned &a)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
while (*s == ' ') s++;
|
||||
if (*s == '#') s++;
|
||||
|
||||
unsigned sr, sg, sb, sa;
|
||||
sa = 255;
|
||||
if (sscanf (s, "%2x%2x%2x%2x", &sr, &sg, &sb, &sa) <= 2)
|
||||
{
|
||||
if (sscanf (s, "%1x%1x%1x%1x", &sr, &sg, &sb, &sa) >= 3)
|
||||
{
|
||||
sr *= 17;
|
||||
sg *= 17;
|
||||
sb *= 17;
|
||||
sa *= 17;
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
ret = true;
|
||||
|
||||
if (ret)
|
||||
{
|
||||
r = sr;
|
||||
g = sg;
|
||||
b = sb;
|
||||
a = sa;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user