summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/include')
-rw-r--r--src/3rdparty/freetype/include/dlg/dlg.h290
-rw-r--r--src/3rdparty/freetype/include/dlg/output.h172
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftconfig.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftheader.h14
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftmodule.h7
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftoption.h154
-rw-r--r--src/3rdparty/freetype/include/freetype/config/ftstdlib.h28
-rw-r--r--src/3rdparty/freetype/include/freetype/config/integer-types.h45
-rw-r--r--src/3rdparty/freetype/include/freetype/config/mac-support.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/config/public-macros.h20
-rw-r--r--src/3rdparty/freetype/include/freetype/freetype.h1364
-rw-r--r--src/3rdparty/freetype/include/freetype/ftadvanc.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbbox.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbdf.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbitmap.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftbzip2.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftcache.h78
-rw-r--r--src/3rdparty/freetype/include/freetype/ftchapters.h27
-rw-r--r--src/3rdparty/freetype/include/freetype/ftcid.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftcolor.h1356
-rw-r--r--src/3rdparty/freetype/include/freetype/ftdriver.h157
-rw-r--r--src/3rdparty/freetype/include/freetype/fterrdef.h6
-rw-r--r--src/3rdparty/freetype/include/freetype/fterrors.h6
-rw-r--r--src/3rdparty/freetype/include/freetype/ftfntfmt.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftgasp.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftglyph.h126
-rw-r--r--src/3rdparty/freetype/include/freetype/ftgxval.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftgzip.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftimage.h139
-rw-r--r--src/3rdparty/freetype/include/freetype/ftincrem.h17
-rw-r--r--src/3rdparty/freetype/include/freetype/ftlcdfil.h27
-rw-r--r--src/3rdparty/freetype/include/freetype/ftlist.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftlogging.h184
-rw-r--r--src/3rdparty/freetype/include/freetype/ftlzw.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmac.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmm.h71
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmodapi.h35
-rw-r--r--src/3rdparty/freetype/include/freetype/ftmoderr.h3
-rw-r--r--src/3rdparty/freetype/include/freetype/ftotval.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftoutln.h16
-rw-r--r--src/3rdparty/freetype/include/freetype/ftparams.h17
-rw-r--r--src/3rdparty/freetype/include/freetype/ftpfr.h4
-rw-r--r--src/3rdparty/freetype/include/freetype/ftrender.h4
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsizes.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsnames.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/ftstroke.h4
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsynth.h25
-rw-r--r--src/3rdparty/freetype/include/freetype/ftsystem.h12
-rw-r--r--src/3rdparty/freetype/include/freetype/fttrigon.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/fttypes.h24
-rw-r--r--src/3rdparty/freetype/include/freetype/ftwinfnt.h4
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/autohint.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/cffotypes.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/cfftypes.h4
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/compiler-macros.h174
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftcalc.h96
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftdebug.h171
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftdrv.h3
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftgloadr.h3
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftmemory.h25
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftmmtypes.h91
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftobjs.h7
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftpsprop.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftrfork.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftserv.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftstream.h138
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/fttrace.h26
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftvalid.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/psaux.h6
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/pshints.h6
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svbdf.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svcfftl.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svcid.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svgldict.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svgxval.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svkern.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svmetric.h12
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svmm.h158
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svotval.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpfr.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svprop.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h4
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svtteng.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h2
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/sfnt.h299
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/svginterface.h46
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/t1types.h32
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/tttypes.h157
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/wofftypes.h6
-rw-r--r--src/3rdparty/freetype/include/freetype/otsvg.h336
-rw-r--r--src/3rdparty/freetype/include/freetype/t1tables.h176
-rw-r--r--src/3rdparty/freetype/include/freetype/ttnameid.h4
-rw-r--r--src/3rdparty/freetype/include/freetype/tttables.h6
-rw-r--r--src/3rdparty/freetype/include/freetype/tttags.h3
-rw-r--r--src/3rdparty/freetype/include/ft2build.h2
101 files changed, 5168 insertions, 1343 deletions
diff --git a/src/3rdparty/freetype/include/dlg/dlg.h b/src/3rdparty/freetype/include/dlg/dlg.h
new file mode 100644
index 0000000000..fa10730e83
--- /dev/null
+++ b/src/3rdparty/freetype/include/dlg/dlg.h
@@ -0,0 +1,290 @@
+// Copyright (c) 2019 nyorain
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef INC_DLG_DLG_H_
+#define INC_DLG_DLG_H_
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+// Hosted at https://github.com/nyorain/dlg.
+// There are examples and documentation.
+// Issue reports and contributions appreciated.
+
+// - CONFIG -
+// Define this macro to make all dlg macros have no effect at all
+// #define DLG_DISABLE
+
+// the log/assertion levels below which logs/assertions are ignored
+// defaulted depending on the NDEBUG macro
+#ifndef DLG_LOG_LEVEL
+ #ifdef NDEBUG
+ #define DLG_LOG_LEVEL dlg_level_warn
+ #else
+ #define DLG_LOG_LEVEL dlg_level_trace
+ #endif
+#endif
+
+#ifndef DLG_ASSERT_LEVEL
+ #ifdef NDEBUG
+ #define DLG_ASSERT_LEVEL dlg_level_warn
+ #else
+ #define DLG_ASSERT_LEVEL dlg_level_trace
+ #endif
+#endif
+
+// the assert level of dlg_assert
+#ifndef DLG_DEFAULT_ASSERT
+ #define DLG_DEFAULT_ASSERT dlg_level_error
+#endif
+
+// evaluated to the 'file' member in dlg_origin
+#ifndef DLG_FILE
+ #define DLG_FILE dlg__strip_root_path(__FILE__, DLG_BASE_PATH)
+
+ // the base path stripped from __FILE__. If you don't override DLG_FILE set this to
+ // the project root to make 'main.c' from '/some/bullshit/main.c'
+ #ifndef DLG_BASE_PATH
+ #define DLG_BASE_PATH ""
+ #endif
+#endif
+
+// Default tags applied to all logs/assertions (in the defining file).
+// Must be in format ```#define DLG_DEFAULT_TAGS "tag1", "tag2"```
+// or just nothing (as defaulted here)
+#ifndef DLG_DEFAULT_TAGS
+ #define DLG_DEFAULT_TAGS_TERM NULL
+#else
+ #define DLG_DEFAULT_TAGS_TERM DLG_DEFAULT_TAGS, NULL
+#endif
+
+// The function used for formatting. Can have any signature, but must be callable with
+// the arguments the log/assertions macros are called with. Must return a const char*
+// that will not be freed by dlg, the formatting function must keep track of it.
+// The formatting function might use dlg_thread_buffer or a custom owned buffer.
+// The returned const char* has to be valid until the dlg log/assertion ends.
+// Usually a c function with ... (i.e. using va_list) or a variadic c++ template do
+// allow formatting.
+#ifndef DLG_FMT_FUNC
+ #define DLG_FMT_FUNC dlg__printf_format
+#endif
+
+// Only overwrite (i.e. predefine) this if you know what you are doing.
+// On windows this is used to add the dllimport specified.
+// If you are using the static version of dlg (on windows) define
+// DLG_STATIC before including dlg.h
+#ifndef DLG_API
+ #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(DLG_STATIC)
+ #define DLG_API __declspec(dllimport)
+ #else
+ #define DLG_API
+ #endif
+#endif
+
+// This macro is used when an assertion fails. It gets the source expression
+// and can return an alternative (that must stay alive).
+// Mainly useful to execute something on failed assertion.
+#ifndef DLG_FAILED_ASSERTION_TEXT
+ #define DLG_FAILED_ASSERTION_TEXT(x) x
+#endif
+
+// - utility -
+// two methods needed since cplusplus does not support compound literals
+// and c does not support uniform initialization/initializer lists
+#ifdef __cplusplus
+ #include <initializer_list>
+ #define DLG_CREATE_TAGS(...) std::initializer_list<const char*> \
+ {DLG_DEFAULT_TAGS_TERM, __VA_ARGS__, NULL}.begin()
+#else
+ #define DLG_CREATE_TAGS(...) (const char* const[]) {DLG_DEFAULT_TAGS_TERM, __VA_ARGS__, NULL}
+#endif
+
+#ifdef __GNUC__
+ #define DLG_PRINTF_ATTRIB(a, b) __attribute__ ((format (printf, a, b)))
+#else
+ #define DLG_PRINTF_ATTRIB(a, b)
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+// Represents the importance of a log/assertion call.
+enum dlg_level {
+ dlg_level_trace = 0, // temporary used debug, e.g. to check if control reaches function
+ dlg_level_debug, // general debugging, prints e.g. all major events
+ dlg_level_info, // general useful information
+ dlg_level_warn, // warning, something went wrong but might have no (really bad) side effect
+ dlg_level_error, // something really went wrong; expect serious issues
+ dlg_level_fatal // critical error; application is likely to crash/exit
+};
+
+// Holds various information associated with a log/assertion call.
+// Forwarded to the output handler.
+struct dlg_origin {
+ const char* file;
+ unsigned int line;
+ const char* func;
+ enum dlg_level level;
+ const char** tags; // null-terminated
+ const char* expr; // assertion expression, otherwise null
+};
+
+// Type of the output handler, see dlg_set_handler.
+typedef void(*dlg_handler)(const struct dlg_origin* origin, const char* string, void* data);
+
+#ifndef DLG_DISABLE
+ // Tagged/Untagged logging with variable level
+ // Tags must always be in the format `("tag1", "tag2")` (including brackets)
+ // Example usages:
+ // dlg_log(dlg_level_warning, "test 1")
+ // dlg_logt(("tag1, "tag2"), dlg_level_debug, "test %d", 2)
+ #define dlg_log(level, ...) if(level >= DLG_LOG_LEVEL) \
+ dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \
+ DLG_FMT_FUNC(__VA_ARGS__), NULL)
+ #define dlg_logt(level, tags, ...) if(level >= DLG_LOG_LEVEL) \
+ dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, \
+ DLG_FMT_FUNC(__VA_ARGS__), NULL)
+
+ // Dynamic level assert macros in various versions for additional arguments
+ // Example usages:
+ // dlg_assertl(dlg_level_warning, data != nullptr);
+ // dlg_assertlt(("tag1, "tag2"), dlg_level_trace, data != nullptr);
+ // dlg_asserttlm(("tag1), dlg_level_warning, data != nullptr, "Data must not be null");
+ // dlg_assertlm(dlg_level_error, data != nullptr, "Data must not be null");
+ #define dlg_assertl(level, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
+ dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, NULL, \
+ DLG_FAILED_ASSERTION_TEXT(#expr))
+ #define dlg_assertlt(level, tags, expr) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
+ dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, __func__, NULL, \
+ DLG_FAILED_ASSERTION_TEXT(#expr))
+ #define dlg_assertlm(level, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
+ dlg__do_log(level, DLG_CREATE_TAGS(NULL), DLG_FILE, __LINE__, __func__, \
+ DLG_FMT_FUNC(__VA_ARGS__), DLG_FAILED_ASSERTION_TEXT(#expr))
+ #define dlg_assertltm(level, tags, expr, ...) if(level >= DLG_ASSERT_LEVEL && !(expr)) \
+ dlg__do_log(level, DLG_CREATE_TAGS tags, DLG_FILE, __LINE__, \
+ __func__, DLG_FMT_FUNC(__VA_ARGS__), DLG_FAILED_ASSERTION_TEXT(#expr))
+
+ #define dlg__assert_or(level, tags, expr, code, msg) if(!(expr)) {\
+ if(level >= DLG_ASSERT_LEVEL) \
+ dlg__do_log(level, tags, DLG_FILE, __LINE__, __func__, msg, \
+ DLG_FAILED_ASSERTION_TEXT(#expr)); \
+ code; \
+ } (void) NULL
+
+ // - Private interface: not part of the abi/api but needed in macros -
+ // Formats the given format string and arguments as printf would, uses the thread buffer.
+ DLG_API const char* dlg__printf_format(const char* format, ...) DLG_PRINTF_ATTRIB(1, 2);
+ DLG_API void dlg__do_log(enum dlg_level lvl, const char* const*, const char*, int,
+ const char*, const char*, const char*);
+ DLG_API const char* dlg__strip_root_path(const char* file, const char* base);
+
+#else // DLG_DISABLE
+
+ #define dlg_log(level, ...)
+ #define dlg_logt(level, tags, ...)
+
+ #define dlg_assertl(level, expr) // assert without tags/message
+ #define dlg_assertlt(level, tags, expr) // assert with tags
+ #define dlg_assertlm(level, expr, ...) // assert with message
+ #define dlg_assertltm(level, tags, expr, ...) // assert with tags & message
+
+ #define dlg__assert_or(level, tags, expr, code, msg) if(!(expr)) { code; } (void) NULL
+#endif // DLG_DISABLE
+
+// The API below is independent from DLG_DISABLE
+
+// Sets the handler that is responsible for formatting and outputting log calls.
+// This function is not thread safe and the handler is set globally.
+// The handler itself must not change dlg tags or call a dlg macro (if it
+// does so, the provided string or tags array in 'origin' might get invalid).
+// The handler can also be used for various other things such as dealing
+// with failed assertions or filtering calls based on the passed tags.
+// The default handler is dlg_default_output (see its doc for more info).
+// If using c++ make sure the registered handler cannot throw e.g. by
+// wrapping everything into a try-catch blog.
+DLG_API void dlg_set_handler(dlg_handler handler, void* data);
+
+// The default output handler.
+// Only use this to reset the output handler, prefer to use
+// dlg_generic_output (from output.h) which this function simply calls.
+// It also flushes the stream used and correctly outputs even from multiple threads.
+DLG_API void dlg_default_output(const struct dlg_origin*, const char* string, void*);
+
+// Returns the currently active dlg handler and sets `data` to
+// its user data pointer. `data` must not be NULL.
+// Useful to create handler chains.
+// This function is not threadsafe, i.e. retrieving the handler while
+// changing it from another thread is unsafe.
+// See `dlg_set_handler`.
+DLG_API dlg_handler dlg_get_handler(void** data);
+
+// Adds the given tag associated with the given function to the thread specific list.
+// If func is not NULL the tag will only applied to calls from the same function.
+// Remove the tag again calling dlg_remove_tag (with exactly the same pointers!).
+// Does not check if the tag is already present.
+DLG_API void dlg_add_tag(const char* tag, const char* func);
+
+// Removes a tag added with dlg_add_tag (has no effect for tags no present).
+// The pointers must be exactly the same pointers that were supplied to dlg_add_tag,
+// this function will not check using strcmp. When the same tag/func combination
+// is added multiple times, this function remove exactly one candidate, it is
+// undefined which. Returns whether a tag was found (and removed).
+DLG_API bool dlg_remove_tag(const char* tag, const char* func);
+
+// Returns the thread-specific buffer and its size for dlg.
+// The buffer should only be used by formatting functions.
+// The buffer can be reallocated and the size changed, just make sure
+// to update both values correctly.
+DLG_API char** dlg_thread_buffer(size_t** size);
+
+// Untagged leveled logging
+#define dlg_trace(...) dlg_log(dlg_level_trace, __VA_ARGS__)
+#define dlg_debug(...) dlg_log(dlg_level_debug, __VA_ARGS__)
+#define dlg_info(...) dlg_log(dlg_level_info, __VA_ARGS__)
+#define dlg_warn(...) dlg_log(dlg_level_warn, __VA_ARGS__)
+#define dlg_error(...) dlg_log(dlg_level_error, __VA_ARGS__)
+#define dlg_fatal(...) dlg_log(dlg_level_fatal, __VA_ARGS__)
+
+// Tagged leveled logging
+#define dlg_tracet(tags, ...) dlg_logt(dlg_level_trace, tags, __VA_ARGS__)
+#define dlg_debugt(tags, ...) dlg_logt(dlg_level_debug, tags, __VA_ARGS__)
+#define dlg_infot(tags, ...) dlg_logt(dlg_level_info, tags, __VA_ARGS__)
+#define dlg_warnt(tags, ...) dlg_logt(dlg_level_warn, tags, __VA_ARGS__)
+#define dlg_errort(tags, ...) dlg_logt(dlg_level_error, tags, __VA_ARGS__)
+#define dlg_fatalt(tags, ...) dlg_logt(dlg_level_fatal, tags, __VA_ARGS__)
+
+// Assert macros useing DLG_DEFAULT_ASSERT as level
+#define dlg_assert(expr) dlg_assertl(DLG_DEFAULT_ASSERT, expr)
+#define dlg_assertt(tags, expr) dlg_assertlt(DLG_DEFAULT_ASSERT, tags, expr)
+#define dlg_assertm(expr, ...) dlg_assertlm(DLG_DEFAULT_ASSERT, expr, __VA_ARGS__)
+#define dlg_asserttm(tags, expr, ...) dlg_assertltm(DLG_DEFAULT_ASSERT, tags, expr, __VA_ARGS__)
+
+// If (expr) does not evaluate to true, always executes 'code' (no matter what
+// DLG_ASSERT_LEVEL is or if dlg is disabled or not).
+// When dlg is enabled and the level is greater or equal to DLG_ASSERT_LEVEL,
+// logs the failed assertion.
+// Example usages:
+// dlg_assertl_or(dlg_level_warn, data != nullptr, return);
+// dlg_assertlm_or(dlg_level_fatal, data != nullptr, return, "Data must not be null");
+// dlg_assert_or(data != nullptr, logError(); return false);
+#define dlg_assertltm_or(level, tags, expr, code, ...) dlg__assert_or(level, \
+ DLG_CREATE_TAGS tags, expr, code, DLG_FMT_FUNC(__VA_ARGS__))
+#define dlg_assertlm_or(level, expr, code, ...) dlg__assert_or(level, \
+ DLG_CREATE_TAGS(NULL), expr, code, DLG_FMT_FUNC(__VA_ARGS__))
+#define dlg_assertl_or(level, expr, code) dlg__assert_or(level, \
+ DLG_CREATE_TAGS(NULL), expr, code, NULL)
+
+#define dlg_assert_or(expr, code) dlg_assertl_or(DLG_DEFAULT_ASSERT, expr, code)
+#define dlg_assertm_or(expr, code, ...) dlg_assertlm_or(DLG_DEFAULT_ASSERT, expr, code, __VA_ARGS__)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // header guard
diff --git a/src/3rdparty/freetype/include/dlg/output.h b/src/3rdparty/freetype/include/dlg/output.h
new file mode 100644
index 0000000000..453e4a5613
--- /dev/null
+++ b/src/3rdparty/freetype/include/dlg/output.h
@@ -0,0 +1,172 @@
+// Copyright (c) 2019 nyorain
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt
+
+#ifndef INC_DLG_OUTPUT_H_
+#define INC_DLG_OUTPUT_H_
+
+#include <dlg/dlg.h>
+#include <stdio.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Text style
+enum dlg_text_style {
+ dlg_text_style_reset = 0,
+ dlg_text_style_bold = 1,
+ dlg_text_style_dim = 2,
+ dlg_text_style_italic = 3,
+ dlg_text_style_underline = 4,
+ dlg_text_style_blink = 5,
+ dlg_text_style_rblink = 6,
+ dlg_text_style_reversed = 7,
+ dlg_text_style_conceal = 8,
+ dlg_text_style_crossed = 9,
+ dlg_text_style_none,
+};
+
+// Text color
+enum dlg_color {
+ dlg_color_black = 0,
+ dlg_color_red,
+ dlg_color_green,
+ dlg_color_yellow,
+ dlg_color_blue,
+ dlg_color_magenta,
+ dlg_color_cyan,
+ dlg_color_gray,
+ dlg_color_reset = 9,
+
+ dlg_color_black2 = 60,
+ dlg_color_red2,
+ dlg_color_green2,
+ dlg_color_yellow2,
+ dlg_color_blue2,
+ dlg_color_magenta2,
+ dlg_color_cyan2,
+ dlg_color_gray2,
+
+ dlg_color_none = 69,
+};
+
+struct dlg_style {
+ enum dlg_text_style style;
+ enum dlg_color fg;
+ enum dlg_color bg;
+};
+
+// Like fprintf but fixes utf-8 output to console on windows.
+// On non-windows sytems just uses the corresponding standard library
+// functions. On windows, if dlg was compiled with the win_console option,
+// will first try to output it in a way that allows the default console
+// to display utf-8. If that fails, will fall back to the standard
+// library functions.
+DLG_API int dlg_fprintf(FILE* stream, const char* format, ...) DLG_PRINTF_ATTRIB(2, 3);
+DLG_API int dlg_vfprintf(FILE* stream, const char* format, va_list list);
+
+// Like dlg_printf, but also applies the given style to this output.
+// The style will always be applied (using escape sequences), independent of the given stream.
+// On windows escape sequences don't work out of the box, see dlg_win_init_ansi().
+DLG_API int dlg_styled_fprintf(FILE* stream, struct dlg_style style,
+ const char* format, ...) DLG_PRINTF_ATTRIB(3, 4);
+
+// Features to output from the generic output handler.
+// Some features might have only an effect in the specializations.
+enum dlg_output_feature {
+ dlg_output_tags = 1, // output tags list
+ dlg_output_time = 2, // output time of log call (hour:minute:second)
+ dlg_output_style = 4, // whether to use the supplied styles
+ dlg_output_func = 8, // output function
+ dlg_output_file_line = 16, // output file:line,
+ dlg_output_newline = 32, // output a newline at the end
+ dlg_output_threadsafe = 64, // locks stream before printing
+ dlg_output_time_msecs = 128 // output micro seconds (ms on windows)
+};
+
+// The default level-dependent output styles. The array values represent the styles
+// to be used for the associated level (i.e. [0] for trace level).
+DLG_API extern const struct dlg_style dlg_default_output_styles[6];
+
+// Generic output function. Used by the default output handler and might be useful
+// for custom output handlers (that don't want to manually format the output).
+// Will call the given output func with the given data (and format + args to print)
+// for everything it has to print in printf format.
+// See also the *_stream and *_buf specializations for common usage.
+// The given output function must not be NULL.
+typedef void(*dlg_generic_output_handler)(void* data, const char* format, ...);
+DLG_API void dlg_generic_output(dlg_generic_output_handler output, void* data,
+ unsigned int features, const struct dlg_origin* origin, const char* string,
+ const struct dlg_style styles[6]);
+
+// Generic output function, using a format string instead of feature flags.
+// Use following conversion characters:
+// %h - output the time in H:M:S format
+// %m - output the time in milliseconds
+// %t - output the full list of tags, comma separated
+// %f - output the function name noted in the origin
+// %o - output the file:line of the origin
+// %s - print the appropriate style escape sequence.
+// %r - print the escape sequence to reset the style.
+// %c - The content of the log/assert
+// %% - print the '%' character
+// Only the above specified conversion characters are valid, the rest are
+// written as it is.
+DLG_API void dlg_generic_outputf(dlg_generic_output_handler output, void* data,
+ const char* format_string, const struct dlg_origin* origin,
+ const char* string, const struct dlg_style styles[6]);
+
+// Generic output function. Used by the default output handler and might be useful
+// for custom output handlers (that don't want to manually format the output).
+// If stream is NULL uses stdout.
+// Automatically uses dlg_fprintf to assure correct utf-8 even on windows consoles.
+// Locks the stream (i.e. assures threadsafe access) when the associated feature
+// is passed (note that stdout/stderr might still mix from multiple threads).
+DLG_API void dlg_generic_output_stream(FILE* stream, unsigned int features,
+ const struct dlg_origin* origin, const char* string,
+ const struct dlg_style styles[6]);
+DLG_API void dlg_generic_outputf_stream(FILE* stream, const char* format_string,
+ const struct dlg_origin* origin, const char* string,
+ const struct dlg_style styles[6], bool lock_stream);
+
+// Generic output function (see dlg_generic_output) that uses a buffer instead of
+// a stream. buf must at least point to *size bytes. Will set *size to the number
+// of bytes written (capped to the given size), if buf == NULL will set *size
+// to the needed size. The size parameter must not be NULL.
+DLG_API void dlg_generic_output_buf(char* buf, size_t* size, unsigned int features,
+ const struct dlg_origin* origin, const char* string,
+ const struct dlg_style styles[6]);
+DLG_API void dlg_generic_outputf_buf(char* buf, size_t* size, const char* format_string,
+ const struct dlg_origin* origin, const char* string,
+ const struct dlg_style styles[6]);
+
+// Returns if the given stream is a tty. Useful for custom output handlers
+// e.g. to determine whether to use color.
+// NOTE: Due to windows limitations currently returns false for wsl ttys.
+DLG_API bool dlg_is_tty(FILE* stream);
+
+// Returns the null-terminated escape sequence for the given style into buf.
+// Undefined behvaiour if any member of style has a value outside its enum range (will
+// probably result in a buffer overflow or garbage being printed).
+// If all member of style are 'none' will simply nullterminate the first buf char.
+DLG_API void dlg_escape_sequence(struct dlg_style style, char buf[12]);
+
+// The reset style escape sequence.
+DLG_API extern const char* const dlg_reset_sequence;
+
+// Just returns true without other effect on non-windows systems or if dlg
+// was compiled without the win_console option.
+// On windows tries to set the console mode to ansi to make escape sequences work.
+// This works only on newer windows 10 versions. Returns false on error.
+// Only the first call to it will have an effect, following calls just return the result.
+// The function is threadsafe. Automatically called by the default output handler.
+// This will only be able to set the mode for the stdout and stderr consoles, so
+// other streams to consoles will still not work.
+DLG_API bool dlg_win_init_ansi(void);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // header guard
diff --git a/src/3rdparty/freetype/include/freetype/config/ftconfig.h b/src/3rdparty/freetype/include/freetype/config/ftconfig.h
index b464e0b789..a85151699d 100644
--- a/src/3rdparty/freetype/include/freetype/config/ftconfig.h
+++ b/src/3rdparty/freetype/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
*
* ANSI-specific configuration file (specification only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/config/ftheader.h b/src/3rdparty/freetype/include/freetype/config/ftheader.h
index 28b5cc60cf..e607bce15c 100644
--- a/src/3rdparty/freetype/include/freetype/config/ftheader.h
+++ b/src/3rdparty/freetype/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
*
* Build macros of the FreeType 2 library.
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -777,6 +777,18 @@
#define FT_COLOR_H <freetype/ftcolor.h>
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_OTSVG_H
+ *
+ * @description:
+ * A macro used in `#include` statements to name the file containing the
+ * FreeType~2 API which handles the OpenType 'SVG~' glyphs.
+ */
+#define FT_OTSVG_H <freetype/otsvg.h>
+
+
/* */
/* These header files don't need to be included by the user. */
diff --git a/src/3rdparty/freetype/include/freetype/config/ftmodule.h b/src/3rdparty/freetype/include/freetype/config/ftmodule.h
index b5c4b1ee58..b315baba8a 100644
--- a/src/3rdparty/freetype/include/freetype/config/ftmodule.h
+++ b/src/3rdparty/freetype/include/freetype/config/ftmodule.h
@@ -19,12 +19,15 @@ FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
+FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
-FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
-FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class )
/* EOF */
diff --git a/src/3rdparty/freetype/include/freetype/config/ftoption.h b/src/3rdparty/freetype/include/freetype/config/ftoption.h
index 097f19b8a5..1976b33af9 100644
--- a/src/3rdparty/freetype/include/freetype/config/ftoption.h
+++ b/src/3rdparty/freetype/include/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
*
* User-selectable configuration macros (specification only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -105,8 +105,7 @@ FT_BEGIN_HEADER
*
* ```
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
- * cff:no-stem-darkening=1 \
- * autofitter:warping=1
+ * cff:no-stem-darkening=1
* ```
*
*/
@@ -220,6 +219,10 @@ FT_BEGIN_HEADER
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
+ *
+ * If you use the GNU make build system directly (that is, without the
+ * `configure` script) and you define this macro, you also have to pass
+ * `SYSTEM_ZLIB=yes` as an argument to make.
*/
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
@@ -433,6 +436,23 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * Logging
+ *
+ * Compiling FreeType in debug or trace mode makes FreeType write error
+ * and trace log messages to `stderr`. Enabling this macro
+ * automatically forces the `FT_DEBUG_LEVEL_ERROR` and
+ * `FT_DEBUG_LEVEL_TRACE` macros and allows FreeType to write error and
+ * trace log messages to a file instead of `stderr`. For writing logs
+ * to a file, FreeType uses an the external `dlg` library (the source
+ * code is in `src/dlg`).
+ *
+ * This option needs a C99 compiler.
+ */
+/* #define FT_DEBUG_LOGGING */
+
+
+ /**************************************************************************
+ *
* Autofitter debugging
*
* If `FT_DEBUG_AUTOFIT` is defined, FreeType provides some means to
@@ -441,9 +461,9 @@ FT_BEGIN_HEADER
* while compiling in 'release' mode):
*
* ```
- * _af_debug_disable_horz_hints
- * _af_debug_disable_vert_hints
- * _af_debug_disable_blue_hints
+ * af_debug_disable_horz_hints_
+ * af_debug_disable_vert_hints_
+ * af_debug_disable_blue_hints_
* ```
*
* Additionally, the following functions provide dumps of various
@@ -460,7 +480,7 @@ FT_BEGIN_HEADER
* As an argument, they use another global variable:
*
* ```
- * _af_debug_hints
+ * af_debug_hints_
* ```
*
* Please have a look at the `ftgrid` demo program to see how those
@@ -509,6 +529,20 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * OpenType SVG Glyph Support
+ *
+ * Setting this macro enables support for OpenType SVG glyphs. By
+ * default, FreeType can only fetch SVG documents. However, it can also
+ * render them if external rendering hook functions are plugged in at
+ * runtime.
+ *
+ * More details on the hooks can be found in file `otsvg.h`.
+ */
+#define FT_CONFIG_OPTION_SVG
+
+
+ /**************************************************************************
+ *
* Error Strings
*
* If this macro is set, `FT_Error_String` will return meaningful
@@ -550,12 +584,12 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* Define `TT_CONFIG_OPTION_POSTSCRIPT_NAMES` if you want to be able to
- * load and enumerate the glyph Postscript names in a TrueType or OpenType
+ * load and enumerate Postscript names of glyphs in a TrueType or OpenType
* file.
*
- * Note that when you do not compile the 'psnames' module by undefining the
- * above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES`, the 'sfnt' module will
- * contain additional code used to read the PS Names table from a font.
+ * Note that if you do not compile the 'psnames' module by undefining the
+ * above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES` macro, the 'sfnt' module will
+ * contain additional code to read the PostScript name table from a font.
*
* (By default, the module uses 'psnames' to extract glyph names.)
*/
@@ -627,36 +661,12 @@ FT_BEGIN_HEADER
* not) instructions in a certain way so that all TrueType fonts look like
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
* technical overview on what this means. See `ttinterp.h` for more
- * details on the LEAN option.
- *
- * There are three possible values.
- *
- * Value 1:
- * This value is associated with the 'Infinality' moniker, contributed by
- * an individual nicknamed Infinality with the goal of making TrueType
- * fonts render better than on Windows. A high amount of configurability
- * and flexibility, down to rules for single glyphs in fonts, but also
- * very slow. Its experimental and slow nature and the original
- * developer losing interest meant that this option was never enabled in
- * default builds.
+ * details on this option.
*
- * The corresponding interpreter version is v38.
- *
- * Value 2:
- * The new default mode for the TrueType driver. The Infinality code
- * base was stripped to the bare minimum and all configurability removed
- * in the name of speed and simplicity. The configurability was mainly
- * aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'.
- * Legacy fonts are fonts that modify vertical stems to achieve clean
- * black-and-white bitmaps. The new mode focuses on applying a minimal
- * set of rules to all fonts indiscriminately so that modern and web
- * fonts render well while legacy fonts render okay.
- *
- * The corresponding interpreter version is v40.
- *
- * Value 3:
- * Compile both, making both v38 and v40 available (the latter is the
- * default).
+ * The new default mode focuses on applying a minimal set of rules to all
+ * fonts indiscriminately so that modern and web fonts render well while
+ * legacy fonts render okay. The corresponding interpreter version is v40.
+ * The so-called Infinality mode (v38) is no longer available in FreeType.
*
* By undefining these, you get rendering behavior like on Windows without
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
@@ -671,9 +681,7 @@ FT_BEGIN_HEADER
* [1]
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
*/
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
-#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
-/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
/**************************************************************************
@@ -707,6 +715,24 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * Define `TT_CONFIG_OPTION_NO_BORING_EXPANSION` if you want to exclude
+ * support for 'boring' OpenType specification expansions.
+ *
+ * https://github.com/harfbuzz/boring-expansion-spec
+ *
+ * Right now, the following features are covered:
+ *
+ * - 'avar' version 2.0
+ *
+ * Most likely, this is a temporary configuration option to be removed in
+ * the near future, since it is assumed that eventually those features are
+ * added to the OpenType standard.
+ */
+/* #define TT_CONFIG_OPTION_NO_BORING_EXPANSION */
+
+
+ /**************************************************************************
+ *
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
* embedded 'BDF~' table within SFNT-based bitmap formats.
*/
@@ -894,24 +920,6 @@ FT_BEGIN_HEADER
/**************************************************************************
*
- * Compile 'autofit' module with warp hinting. The idea of the warping
- * code is to slightly scale and shift a glyph within a single dimension so
- * that as much of its segments are aligned (more or less) on the grid. To
- * find out the optimal scaling and shifting value, various parameter
- * combinations are tried and scored.
- *
- * You can switch warping on and off with the `warping` property of the
- * auto-hinter (see file `ftdriver.h` for more information; by default it
- * is switched off).
- *
- * This experimental option is not active if the rendering mode is
- * `FT_RENDER_MODE_LIGHT`.
- */
-#define AF_CONFIG_OPTION_USE_WARPER
-
-
- /**************************************************************************
- *
* Use TrueType-like size metrics for 'light' auto-hinting.
*
* It is strongly recommended to avoid this option, which exists only to
@@ -943,21 +951,29 @@ FT_BEGIN_HEADER
/*
- * The next three macros are defined if native TrueType hinting is
+ * The next two macros are defined if native TrueType hinting is
* requested by the definitions above. Don't change this.
*/
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
#define TT_USE_BYTECODE_INTERPRETER
-
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
-#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
-#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
-#endif
-
-#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
#endif
#endif
+
+
+ /*
+ * The TT_SUPPORT_COLRV1 macro is defined to indicate to clients that this
+ * version of FreeType has support for 'COLR' v1 API. This definition is
+ * useful to FreeType clients that want to build in support for 'COLR' v1
+ * depending on a tip-of-tree checkout before it is officially released in
+ * FreeType, and while the feature cannot yet be tested against using
+ * version macros. Don't change this macro. This may be removed once the
+ * feature is in a FreeType release version and version macros can be used
+ * to test for availability.
+ */
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+#define TT_SUPPORT_COLRV1
#endif
@@ -989,8 +1005,8 @@ FT_BEGIN_HEADER
#error "Invalid CFF darkening parameters!"
#endif
-FT_END_HEADER
+FT_END_HEADER
#endif /* FTOPTION_H_ */
diff --git a/src/3rdparty/freetype/include/freetype/config/ftstdlib.h b/src/3rdparty/freetype/include/freetype/config/ftstdlib.h
index d6091f8b3d..f65148a902 100644
--- a/src/3rdparty/freetype/include/freetype/config/ftstdlib.h
+++ b/src/3rdparty/freetype/include/freetype/config/ftstdlib.h
@@ -5,7 +5,7 @@
* ANSI-specific library and header configuration file (specification
* only).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -43,7 +43,8 @@
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
- * platforms the library has been tested on.
+ * platforms the library has been tested on. We also check `ULLONG_MAX`
+ * to see whether we can use 64-bit `long long` later on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
@@ -66,6 +67,15 @@
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
+#ifdef LLONG_MAX
+#define FT_LLONG_MAX LLONG_MAX
+#endif
+#ifdef LLONG_MIN
+#define FT_LLONG_MIN LLONG_MIN
+#endif
+#ifdef ULLONG_MAX
+#define FT_ULLONG_MAX ULLONG_MAX
+#endif
/**************************************************************************
@@ -101,13 +111,13 @@
#include <stdio.h>
-#define FT_FILE FILE
-#define ft_fclose fclose
-#define ft_fopen fopen
-#define ft_fread fread
-#define ft_fseek fseek
-#define ft_ftell ftell
-#define ft_sprintf sprintf
+#define FT_FILE FILE
+#define ft_fclose fclose
+#define ft_fopen fopen
+#define ft_fread fread
+#define ft_fseek fseek
+#define ft_ftell ftell
+#define ft_snprintf snprintf
/**************************************************************************
diff --git a/src/3rdparty/freetype/include/freetype/config/integer-types.h b/src/3rdparty/freetype/include/freetype/config/integer-types.h
index a0ca0c95e2..7258b50854 100644
--- a/src/3rdparty/freetype/include/freetype/config/integer-types.h
+++ b/src/3rdparty/freetype/include/freetype/config/integer-types.h
@@ -4,7 +4,7 @@
*
* FreeType integer types definitions.
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -60,6 +60,18 @@
#endif /* !defined(FT_SIZEOF_LONG) */
+#ifndef FT_SIZEOF_LONG_LONG
+
+ /* The size of a `long long` type if available */
+#if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL
+#define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT )
+#else
+#define FT_SIZEOF_LONG_LONG 0
+#endif
+
+#endif /* !defined(FT_SIZEOF_LONG_LONG) */
+
+
/**************************************************************************
*
* @section:
@@ -174,15 +186,17 @@
#endif
- /* determine whether we have a 64-bit `int` type for platforms without */
- /* Autoconf */
+ /* determine whether we have a 64-bit integer type */
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
- /* `FT_LONG64` must be defined if a 64-bit type is available */
-#define FT_LONG64
#define FT_INT64 long
#define FT_UINT64 unsigned long
+#elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT )
+
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
+
/**************************************************************************
*
* A 64-bit data type may create compilation problems if you compile in
@@ -192,16 +206,9 @@
*/
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
-#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
-
-#define FT_LONG64
-#define FT_INT64 long long int
-#define FT_UINT64 unsigned long long int
-
-#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
+#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the `__int64` type */
-#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
@@ -211,32 +218,30 @@
/* to test the compiler version. */
/* this compiler provides the `__int64` type */
-#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
-#elif defined( __WATCOMC__ ) /* Watcom C++ */
+#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */
- /* Watcom doesn't provide 64-bit data types */
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
-#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( __GNUC__ )
/* GCC provides the `long long` type */
-#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
-#endif /* __STDC_VERSION__ >= 199901L */
+#endif /* !__STDC__ */
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
-#ifdef FT_LONG64
+#ifdef FT_INT64
typedef FT_INT64 FT_Int64;
typedef FT_UINT64 FT_UInt64;
#endif
diff --git a/src/3rdparty/freetype/include/freetype/config/mac-support.h b/src/3rdparty/freetype/include/freetype/config/mac-support.h
index 94867088e9..b77b96d5db 100644
--- a/src/3rdparty/freetype/include/freetype/config/mac-support.h
+++ b/src/3rdparty/freetype/include/freetype/config/mac-support.h
@@ -4,7 +4,7 @@
*
* Mac/OS X support configuration header.
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/config/public-macros.h b/src/3rdparty/freetype/include/freetype/config/public-macros.h
index 6aa673e807..23d0fa6a32 100644
--- a/src/3rdparty/freetype/include/freetype/config/public-macros.h
+++ b/src/3rdparty/freetype/include/freetype/config/public-macros.h
@@ -4,7 +4,7 @@
*
* Define a set of compiler macros used in public FreeType headers.
*
- * Copyright (C) 2020 by
+ * Copyright (C) 2020-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -103,6 +103,7 @@ FT_BEGIN_HEADER
*/
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
+
/*
* `FT_UNUSED` indicates that a given parameter is not used -- this is
* only used to get rid of unpleasant compiler warnings.
@@ -115,6 +116,23 @@ FT_BEGIN_HEADER
#endif
+ /*
+ * Support for casts in both C and C++.
+ */
+#ifdef __cplusplus
+#define FT_STATIC_CAST( type, var ) static_cast<type>(var)
+#define FT_REINTERPRET_CAST( type, var ) reinterpret_cast<type>(var)
+
+#define FT_STATIC_BYTE_CAST( type, var ) \
+ static_cast<type>( static_cast<unsigned char>( var ) )
+#else
+#define FT_STATIC_CAST( type, var ) (type)(var)
+#define FT_REINTERPRET_CAST( type, var ) (type)(var)
+
+#define FT_STATIC_BYTE_CAST( type, var ) (type)(unsigned char)(var)
+#endif
+
+
FT_END_HEADER
#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
diff --git a/src/3rdparty/freetype/include/freetype/freetype.h b/src/3rdparty/freetype/include/freetype/freetype.h
index be191f5aa0..92acf3794a 100644
--- a/src/3rdparty/freetype/include/freetype/freetype.h
+++ b/src/3rdparty/freetype/include/freetype/freetype.h
@@ -4,7 +4,7 @@
*
* FreeType high-level API and common types (specification only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -33,6 +33,34 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
+ * preamble
+ *
+ * @title:
+ * Preamble
+ *
+ * @abstract:
+ * What FreeType is and isn't
+ *
+ * @description:
+ * FreeType is a library that provides access to glyphs in font files. It
+ * scales the glyph images and their metrics to a requested size, and it
+ * rasterizes the glyph images to produce pixel or subpixel alpha coverage
+ * bitmaps.
+ *
+ * Note that FreeType is _not_ a text layout engine. You have to use
+ * higher-level libraries like HarfBuzz, Pango, or ICU for that.
+ *
+ * Note also that FreeType does _not_ perform alpha blending or
+ * compositing the resulting bitmaps or pixmaps by itself. Use your
+ * favourite graphics library (for example, Cairo or Skia) to further
+ * process FreeType's output.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
* header_inclusion
*
* @title:
@@ -74,58 +102,25 @@ FT_BEGIN_HEADER
*/
-
- /*************************************************************************/
- /*************************************************************************/
- /* */
- /* B A S I C T Y P E S */
- /* */
- /*************************************************************************/
- /*************************************************************************/
-
-
/**************************************************************************
*
* @section:
- * base_interface
+ * font_testing_macros
*
* @title:
- * Base Interface
+ * Font Testing Macros
*
* @abstract:
- * The FreeType~2 base font interface.
+ * Macros to test various properties of fonts.
*
* @description:
- * This section describes the most important public high-level API
- * functions of FreeType~2.
- *
- * @order:
- * FT_Library
- * FT_Face
- * FT_Size
- * FT_GlyphSlot
- * FT_CharMap
- * FT_Encoding
- * FT_ENC_TAG
+ * Macros to test the most important font properties.
*
- * FT_FaceRec
- *
- * FT_FACE_FLAG_SCALABLE
- * FT_FACE_FLAG_FIXED_SIZES
- * FT_FACE_FLAG_FIXED_WIDTH
- * FT_FACE_FLAG_HORIZONTAL
- * FT_FACE_FLAG_VERTICAL
- * FT_FACE_FLAG_COLOR
- * FT_FACE_FLAG_SFNT
- * FT_FACE_FLAG_CID_KEYED
- * FT_FACE_FLAG_TRICKY
- * FT_FACE_FLAG_KERNING
- * FT_FACE_FLAG_MULTIPLE_MASTERS
- * FT_FACE_FLAG_VARIATION
- * FT_FACE_FLAG_GLYPH_NAMES
- * FT_FACE_FLAG_EXTERNAL_STREAM
- * FT_FACE_FLAG_HINTER
+ * It is recommended to use these high-level macros instead of directly
+ * testing the corresponding flags, which are scattered over various
+ * structures.
*
+ * @order:
* FT_HAS_HORIZONTAL
* FT_HAS_VERTICAL
* FT_HAS_KERNING
@@ -133,6 +128,9 @@ FT_BEGIN_HEADER
* FT_HAS_GLYPH_NAMES
* FT_HAS_COLOR
* FT_HAS_MULTIPLE_MASTERS
+ * FT_HAS_SVG
+ * FT_HAS_SBIX
+ * FT_HAS_SBIX_OVERLAY
*
* FT_IS_SFNT
* FT_IS_SCALABLE
@@ -142,21 +140,59 @@ FT_BEGIN_HEADER
* FT_IS_NAMED_INSTANCE
* FT_IS_VARIATION
*
- * FT_STYLE_FLAG_BOLD
- * FT_STYLE_FLAG_ITALIC
+ */
+
+
+ /**************************************************************************
*
- * FT_SizeRec
- * FT_Size_Metrics
+ * @section:
+ * library_setup
*
- * FT_GlyphSlotRec
- * FT_Glyph_Metrics
- * FT_SubGlyph
+ * @title:
+ * Library Setup
*
- * FT_Bitmap_Size
+ * @abstract:
+ * Functions to start and end the usage of the FreeType library.
+ *
+ * @description:
+ * Functions to start and end the usage of the FreeType library.
*
+ * Note that @FT_Library_Version and @FREETYPE_XXX are of limited use
+ * because even a new release of FreeType with only documentation
+ * changes increases the version number.
+ *
+ * @order:
+ * FT_Library
* FT_Init_FreeType
* FT_Done_FreeType
*
+ * FT_Library_Version
+ * FREETYPE_XXX
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * face_creation
+ *
+ * @title:
+ * Face Creation
+ *
+ * @abstract:
+ * Functions to manage fonts.
+ *
+ * @description:
+ * The functions and structures collected in this section operate on
+ * fonts globally.
+ *
+ * @order:
+ * FT_Face
+ * FT_FaceRec
+ * FT_FACE_FLAG_XXX
+ * FT_STYLE_FLAG_XXX
+ *
* FT_New_Face
* FT_Done_Face
* FT_Reference_Face
@@ -164,10 +200,36 @@ FT_BEGIN_HEADER
* FT_Face_Properties
* FT_Open_Face
* FT_Open_Args
+ * FT_OPEN_XXX
* FT_Parameter
* FT_Attach_File
* FT_Attach_Stream
*
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * sizing_and_scaling
+ *
+ * @title:
+ * Sizing and Scaling
+ *
+ * @abstract:
+ * Functions to manage font sizes.
+ *
+ * @description:
+ * The functions and structures collected in this section are related to
+ * selecting and manipulating the size of a font globally.
+ *
+ * @order:
+ * FT_Size
+ * FT_SizeRec
+ * FT_Size_Metrics
+ *
+ * FT_Bitmap_Size
+ *
* FT_Set_Char_Size
* FT_Set_Pixel_Sizes
* FT_Request_Size
@@ -175,77 +237,159 @@ FT_BEGIN_HEADER
* FT_Size_Request_Type
* FT_Size_RequestRec
* FT_Size_Request
+ *
* FT_Set_Transform
- * FT_Load_Glyph
- * FT_Get_Char_Index
- * FT_Get_First_Char
- * FT_Get_Next_Char
- * FT_Get_Name_Index
- * FT_Load_Char
+ * FT_Get_Transform
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * glyph_retrieval
+ *
+ * @title:
+ * Glyph Retrieval
+ *
+ * @abstract:
+ * Functions to manage glyphs.
+ *
+ * @description:
+ * The functions and structures collected in this section operate on
+ * single glyphs, of which @FT_Load_Glyph is most important.
*
- * FT_OPEN_MEMORY
- * FT_OPEN_STREAM
- * FT_OPEN_PATHNAME
- * FT_OPEN_DRIVER
- * FT_OPEN_PARAMS
- *
- * FT_LOAD_DEFAULT
- * FT_LOAD_RENDER
- * FT_LOAD_MONOCHROME
- * FT_LOAD_LINEAR_DESIGN
- * FT_LOAD_NO_SCALE
- * FT_LOAD_NO_HINTING
- * FT_LOAD_NO_BITMAP
- * FT_LOAD_NO_AUTOHINT
- * FT_LOAD_COLOR
- *
- * FT_LOAD_VERTICAL_LAYOUT
- * FT_LOAD_IGNORE_TRANSFORM
- * FT_LOAD_FORCE_AUTOHINT
- * FT_LOAD_NO_RECURSE
- * FT_LOAD_PEDANTIC
- *
- * FT_LOAD_TARGET_NORMAL
- * FT_LOAD_TARGET_LIGHT
- * FT_LOAD_TARGET_MONO
- * FT_LOAD_TARGET_LCD
- * FT_LOAD_TARGET_LCD_V
+ * @order:
+ * FT_GlyphSlot
+ * FT_GlyphSlotRec
+ * FT_Glyph_Metrics
*
+ * FT_Load_Glyph
+ * FT_LOAD_XXX
* FT_LOAD_TARGET_MODE
+ * FT_LOAD_TARGET_XXX
*
* FT_Render_Glyph
* FT_Render_Mode
* FT_Get_Kerning
* FT_Kerning_Mode
* FT_Get_Track_Kerning
- * FT_Get_Glyph_Name
- * FT_Get_Postscript_Name
*
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * character_mapping
+ *
+ * @title:
+ * Character Mapping
+ *
+ * @abstract:
+ * Functions to manage character-to-glyph maps.
+ *
+ * @description:
+ * This section holds functions and structures that are related to
+ * mapping character input codes to glyph indices.
+ *
+ * Note that for many scripts the simplistic approach used by FreeType
+ * of mapping a single character to a single glyph is not valid or
+ * possible! In general, a higher-level library like HarfBuzz or ICU
+ * should be used for handling text strings.
+ *
+ * @order:
+ * FT_CharMap
* FT_CharMapRec
+ * FT_Encoding
+ * FT_ENC_TAG
+ *
* FT_Select_Charmap
* FT_Set_Charmap
* FT_Get_Charmap_Index
*
+ * FT_Get_Char_Index
+ * FT_Get_First_Char
+ * FT_Get_Next_Char
+ * FT_Load_Char
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * information_retrieval
+ *
+ * @title:
+ * Information Retrieval
+ *
+ * @abstract:
+ * Functions to retrieve font and glyph information.
+ *
+ * @description:
+ * Functions to retrieve font and glyph information. Only some very
+ * basic data is covered; see also the chapter on the format-specific
+ * API for more.
+ *
+ *
+ * @order:
+ * FT_Get_Name_Index
+ * FT_Get_Glyph_Name
+ * FT_Get_Postscript_Name
* FT_Get_FSType_Flags
+ * FT_FSTYPE_XXX
* FT_Get_SubGlyph_Info
+ * FT_SUBGLYPH_FLAG_XXX
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * other_api_data
*
+ * @title:
+ * Other API Data
+ *
+ * @abstract:
+ * Other structures, enumerations, and macros.
+ *
+ * @description:
+ * Other structures, enumerations, and macros. Deprecated functions are
+ * also listed here.
+ *
+ * @order:
* FT_Face_Internal
* FT_Size_Internal
* FT_Slot_Internal
*
- * FT_FACE_FLAG_XXX
- * FT_STYLE_FLAG_XXX
- * FT_OPEN_XXX
- * FT_LOAD_XXX
- * FT_LOAD_TARGET_XXX
- * FT_SUBGLYPH_FLAG_XXX
- * FT_FSTYPE_XXX
+ * FT_SubGlyph
*
* FT_HAS_FAST_GLYPHS
+ * FT_Face_CheckTrueTypePatents
+ * FT_Face_SetUnpatentedHinting
*
*/
+ /*************************************************************************/
+ /*************************************************************************/
+ /* */
+ /* B A S I C T Y P E S */
+ /* */
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * glyph_retrieval
+ *
+ */
+
/**************************************************************************
*
* @struct:
@@ -315,6 +459,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * sizing_and_scaling
+ *
+ */
+
+ /**************************************************************************
+ *
* @struct:
* FT_Bitmap_Size
*
@@ -375,6 +526,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * library_setup
+ *
+ */
+
+ /**************************************************************************
+ *
* @type:
* FT_Library
*
@@ -447,7 +605,7 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
- * base_interface
+ * face_creation
*
*/
@@ -485,6 +643,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * sizing_and_scaling
+ *
+ */
+
+ /**************************************************************************
+ *
* @type:
* FT_Size
*
@@ -493,13 +658,15 @@ FT_BEGIN_HEADER
* size.
*
* @note:
- * An @FT_Face has one _active_ @FT_Size object that is used by functions
- * like @FT_Load_Glyph to determine the scaling transformation that in
- * turn is used to load and hint glyphs and metrics.
+ * An @FT_Face has one _active_ `FT_Size` object that is used by
+ * functions like @FT_Load_Glyph to determine the scaling transformation
+ * that in turn is used to load and hint glyphs and metrics.
*
- * You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
+ * A newly created `FT_Size` object contains only meaningless zero values.
+ * You must use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
* or even @FT_Select_Size to change the content (i.e., the scaling
- * values) of the active @FT_Size.
+ * values) of the active `FT_Size`. Otherwise, the scaling and hinting
+ * will not be performed.
*
* You can use @FT_New_Size to create additional size objects for a given
* @FT_Face, but they won't be used by other functions until you activate
@@ -515,6 +682,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * glyph_retrieval
+ *
+ */
+
+ /**************************************************************************
+ *
* @type:
* FT_GlyphSlot
*
@@ -534,6 +708,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * character_mapping
+ *
+ */
+
+ /**************************************************************************
+ *
* @type:
* FT_CharMap
*
@@ -587,11 +768,12 @@ FT_BEGIN_HEADER
*/
#ifndef FT_ENC_TAG
-#define FT_ENC_TAG( value, a, b, c, d ) \
- value = ( ( (FT_UInt32)(a) << 24 ) | \
- ( (FT_UInt32)(b) << 16 ) | \
- ( (FT_UInt32)(c) << 8 ) | \
- (FT_UInt32)(d) )
+
+#define FT_ENC_TAG( value, a, b, c, d ) \
+ value = ( ( FT_STATIC_BYTE_CAST( FT_UInt32, a ) << 24 ) | \
+ ( FT_STATIC_BYTE_CAST( FT_UInt32, b ) << 16 ) | \
+ ( FT_STATIC_BYTE_CAST( FT_UInt32, c ) << 8 ) | \
+ FT_STATIC_BYTE_CAST( FT_UInt32, d ) )
#endif /* FT_ENC_TAG */
@@ -607,7 +789,7 @@ FT_BEGIN_HEADER
*
* @note:
* Despite the name, this enumeration lists specific character
- * repertories (i.e., charsets), and not text encoding methods (e.g.,
+ * repertoires (i.e., charsets), and not text encoding methods (e.g.,
* UTF-8, UTF-16, etc.).
*
* Other encodings might be defined in the future.
@@ -701,11 +883,16 @@ FT_BEGIN_HEADER
* Same as FT_ENCODING_JOHAB. Deprecated.
*
* @note:
- * By default, FreeType enables a Unicode charmap and tags it with
- * `FT_ENCODING_UNICODE` when it is either provided or can be generated
- * from PostScript glyph name dictionaries in the font file. All other
- * encodings are considered legacy and tagged only if explicitly defined
- * in the font file. Otherwise, `FT_ENCODING_NONE` is used.
+ * When loading a font, FreeType makes a Unicode charmap active if
+ * possible (either if the font provides such a charmap, or if FreeType
+ * can synthesize one from PostScript glyph name dictionaries; in either
+ * case, the charmap is tagged with `FT_ENCODING_UNICODE`). If such a
+ * charmap is synthesized, it is placed at the first position of the
+ * charmap array.
+ *
+ * All other encodings are considered legacy and tagged only if
+ * explicitly defined in the font file. Otherwise, `FT_ENCODING_NONE` is
+ * used.
*
* `FT_ENCODING_NONE` is set by the BDF and PCF drivers if the charmap is
* neither Unicode nor ISO-8859-1 (otherwise it is set to
@@ -735,7 +922,7 @@ FT_BEGIN_HEADER
* `encoding_id`. If, for example, `encoding_id` is `TT_MAC_ID_ROMAN`
* and the language ID (minus~1) is `TT_MAC_LANGID_GREEK`, it is the
* Greek encoding, not Roman. `TT_MAC_ID_ARABIC` with
- * `TT_MAC_LANGID_FARSI` means the Farsi variant the Arabic encoding.
+ * `TT_MAC_LANGID_FARSI` means the Farsi variant of the Arabic encoding.
*/
typedef enum FT_Encoding_
{
@@ -835,6 +1022,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * other_api_data
+ *
+ */
+
+ /**************************************************************************
+ *
* @type:
* FT_Face_Internal
*
@@ -850,6 +1044,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * face_creation
+ *
+ */
+
+ /**************************************************************************
+ *
* @struct:
* FT_FaceRec
*
@@ -874,7 +1075,7 @@ FT_BEGIN_HEADER
* If we have the third named instance of face~4, say, `face_index` is
* set to 0x00030004.
*
- * Bit 31 is always zero (this is, `face_index` is always a positive
+ * Bit 31 is always zero (that is, `face_index` is always a positive
* value).
*
* [Since 2.9] Changing the design coordinates with
@@ -892,7 +1093,7 @@ FT_BEGIN_HEADER
*
* [Since 2.6.1] Bits 16-30 hold the number of named instances
* available for the current face if we have a GX or OpenType variation
- * (sub)font. Bit 31 is always zero (this is, `style_flags` is always
+ * (sub)font. Bit 31 is always zero (that is, `style_flags` is always
* a positive value). Note that a variation font has always at least
* one named instance, namely the default instance.
*
@@ -958,7 +1159,7 @@ FT_BEGIN_HEADER
* Note that the bounding box might be off by (at least) one pixel for
* hinted fonts. See @FT_Size_Metrics for further discussion.
*
- * Note that the bounding box does not vary in OpenType variable fonts
+ * Note that the bounding box does not vary in OpenType variation fonts
* and should only be used in relation to the default instance.
*
* units_per_EM ::
@@ -1046,9 +1247,9 @@ FT_BEGIN_HEADER
FT_Generic generic;
- /*# The following member variables (down to `underline_thickness`) */
- /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
- /*# for bitmap fonts. */
+ /* The following member variables (down to `underline_thickness`) */
+ /* are only relevant to scalable outlines; cf. @FT_Bitmap_Size */
+ /* for bitmap fonts. */
FT_BBox bbox;
FT_UShort units_per_EM;
@@ -1066,7 +1267,7 @@ FT_BEGIN_HEADER
FT_Size size;
FT_CharMap charmap;
- /*@private begin */
+ /* private fields, internal to FreeType */
FT_Driver driver;
FT_Memory memory;
@@ -1079,8 +1280,6 @@ FT_BEGIN_HEADER
FT_Face_Internal internal;
- /*@private end */
-
} FT_FaceRec;
@@ -1123,9 +1322,9 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_KERNING ::
* The face contains kerning information. If set, the kerning distance
* can be retrieved using the function @FT_Get_Kerning. Otherwise the
- * function always return the vector (0,0). Note that FreeType doesn't
- * handle kerning data from the SFNT 'GPOS' table (as present in many
- * OpenType fonts).
+ * function always returns the vector (0,0). Note that FreeType
+ * doesn't handle kerning data from the SFNT 'GPOS' table (as present
+ * in many OpenType fonts).
*
* FT_FACE_FLAG_FAST_GLYPHS ::
* THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT.
@@ -1163,13 +1362,13 @@ FT_BEGIN_HEADER
* successfully; in all other cases you get an
* `FT_Err_Invalid_Argument` error.
*
- * Note that CID-keyed fonts that are in an SFNT wrapper (this is, all
+ * Note that CID-keyed fonts that are in an SFNT wrapper (that is, all
* OpenType/CFF fonts) don't have this flag set since the glyphs are
* accessed in the normal way (using contiguous indices); the
* 'CID-ness' isn't visible to the application.
*
* FT_FACE_FLAG_TRICKY ::
- * The face is 'tricky', this is, it always needs the font format's
+ * The face is 'tricky', that is, it always needs the font format's
* native hinting engine to get a reasonable result. A typical example
* is the old Chinese font `mingli.ttf` (but not `mingliu.ttc`) that
* uses TrueType bytecode instructions to move and scale all of its
@@ -1191,8 +1390,21 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_VARIATION ::
* [Since 2.9] Set if the current face (or named instance) has been
* altered with @FT_Set_MM_Design_Coordinates,
- * @FT_Set_Var_Design_Coordinates, or @FT_Set_Var_Blend_Coordinates.
- * This flag is unset by a call to @FT_Set_Named_Instance.
+ * @FT_Set_Var_Design_Coordinates, @FT_Set_Var_Blend_Coordinates, or
+ * @FT_Set_MM_WeightVector to select a non-default instance.
+ *
+ * FT_FACE_FLAG_SVG ::
+ * [Since 2.12] The face has an 'SVG~' OpenType table.
+ *
+ * FT_FACE_FLAG_SBIX ::
+ * [Since 2.12] The face has an 'sbix' OpenType table *and* outlines.
+ * For such fonts, @FT_FACE_FLAG_SCALABLE is not set by default to
+ * retain backward compatibility.
+ *
+ * FT_FACE_FLAG_SBIX_OVERLAY ::
+ * [Since 2.12] The face has an 'sbix' OpenType table where outlines
+ * should be drawn on top of bitmap strikes.
+ *
*/
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@@ -1210,7 +1422,17 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
+#define FT_FACE_FLAG_SVG ( 1L << 16 )
+#define FT_FACE_FLAG_SBIX ( 1L << 17 )
+#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
+
+ /**************************************************************************
+ *
+ * @section:
+ * font_testing_macros
+ *
+ */
/**************************************************************************
*
@@ -1323,6 +1545,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * other_api_data
+ *
+ */
+
+ /**************************************************************************
+ *
* @macro:
* FT_HAS_FAST_GLYPHS
*
@@ -1335,6 +1564,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * font_testing_macros
+ *
+ */
+
+ /**************************************************************************
+ *
* @macro:
* FT_HAS_GLYPH_NAMES
*
@@ -1391,8 +1627,8 @@ FT_BEGIN_HEADER
*
* @description:
* A macro that returns true whenever a face object has been altered by
- * @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates, or
- * @FT_Set_Var_Blend_Coordinates.
+ * @FT_Set_MM_Design_Coordinates, @FT_Set_Var_Design_Coordinates,
+ * @FT_Set_Var_Blend_Coordinates, or @FT_Set_MM_WeightVector.
*
* @since:
* 2.9
@@ -1452,6 +1688,131 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @macro:
+ * FT_HAS_SVG
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'SVG~'
+ * OpenType table.
+ *
+ * @since:
+ * 2.12
+ */
+#define FT_HAS_SVG( face ) \
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) )
+
+
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_HAS_SBIX
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'sbix'
+ * OpenType table *and* outline glyphs.
+ *
+ * Currently, FreeType only supports bitmap glyphs in PNG format for this
+ * table (i.e., JPEG and TIFF formats are unsupported, as are
+ * Apple-specific formats not part of the OpenType specification).
+ *
+ * @note:
+ * For backward compatibility, a font with an 'sbix' table is treated as
+ * a bitmap-only face. Using @FT_Open_Face with
+ * @FT_PARAM_TAG_IGNORE_SBIX, an application can switch off 'sbix'
+ * handling so that the face is treated as an ordinary outline font with
+ * scalable outlines.
+ *
+ * Here is some pseudo code that roughly illustrates how to implement
+ * 'sbix' handling according to the OpenType specification.
+ *
+ * ```
+ * if ( FT_HAS_SBIX( face ) )
+ * {
+ * // open font as a scalable one without sbix handling
+ * FT_Face face2;
+ * FT_Parameter param = { FT_PARAM_TAG_IGNORE_SBIX, NULL };
+ * FT_Open_Args args = { FT_OPEN_PARAMS | ...,
+ * ...,
+ * 1, &param };
+ *
+ *
+ * FT_Open_Face( library, &args, 0, &face2 );
+ *
+ * <sort `face->available_size` as necessary into
+ * `preferred_sizes`[*]>
+ *
+ * for ( i = 0; i < face->num_fixed_sizes; i++ )
+ * {
+ * size = preferred_sizes[i].size;
+ *
+ * error = FT_Set_Pixel_Sizes( face, size, size );
+ * <error handling omitted>
+ *
+ * // check whether we have a glyph in a bitmap strike
+ * error = FT_Load_Glyph( face,
+ * glyph_index,
+ * FT_LOAD_SBITS_ONLY |
+ * FT_LOAD_BITMAP_METRICS_ONLY );
+ * if ( error == FT_Err_Invalid_Argument )
+ * continue;
+ * else if ( error )
+ * <other error handling omitted>
+ * else
+ * break;
+ * }
+ *
+ * if ( i != face->num_fixed_sizes )
+ * <load embedded bitmap with `FT_Load_Glyph`,
+ * scale it, display it, etc.>
+ *
+ * if ( i == face->num_fixed_sizes ||
+ * FT_HAS_SBIX_OVERLAY( face ) )
+ * <use `face2` to load outline glyph with `FT_Load_Glyph`,
+ * scale it, display it on top of the bitmap, etc.>
+ * }
+ * ```
+ *
+ * [*] Assuming a target value of 400dpi and available strike sizes 100,
+ * 200, 300, and 400dpi, a possible order might be [400, 200, 300, 100]:
+ * scaling 200dpi to 400dpi usually gives better results than scaling
+ * 300dpi to 400dpi; it is also much faster. However, scaling 100dpi to
+ * 400dpi can yield a too pixelated result, thus the preference might be
+ * 300dpi over 100dpi.
+ *
+ * @since:
+ * 2.12
+ */
+#define FT_HAS_SBIX( face ) \
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX ) )
+
+
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_HAS_SBIX_OVERLAY
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'sbix'
+ * OpenType table with bit~1 in its `flags` field set, instructing the
+ * application to overlay the bitmap strike with the corresponding
+ * outline glyph. See @FT_HAS_SBIX for pseudo code how to use it.
+ *
+ * @since:
+ * 2.12
+ */
+#define FT_HAS_SBIX_OVERLAY( face ) \
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) )
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * face_creation
+ *
+ */
+
+ /**************************************************************************
+ *
* @enum:
* FT_STYLE_FLAG_XXX
*
@@ -1478,6 +1839,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * other_api_data
+ *
+ */
+
+ /**************************************************************************
+ *
* @type:
* FT_Size_Internal
*
@@ -1490,6 +1858,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * sizing_and_scaling
+ *
+ */
+
+ /**************************************************************************
+ *
* @struct:
* FT_Size_Metrics
*
@@ -1641,6 +2016,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * other_api_data
+ *
+ */
+
+ /**************************************************************************
+ *
* @struct:
* FT_SubGlyph
*
@@ -1672,6 +2054,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * glyph_retrieval
+ *
+ */
+
+ /**************************************************************************
+ *
* @struct:
* FT_GlyphSlotRec
*
@@ -1714,13 +2103,13 @@ FT_BEGIN_HEADER
* The advance width of the unhinted glyph. Its value is expressed in
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
* loading the glyph. This field can be important to perform correct
- * WYSIWYG layout. Only relevant for outline glyphs.
+ * WYSIWYG layout. Only relevant for scalable glyphs.
*
* linearVertAdvance ::
* The advance height of the unhinted glyph. Its value is expressed in
* 16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
* loading the glyph. This field can be important to perform correct
- * WYSIWYG layout. Only relevant for outline glyphs.
+ * WYSIWYG layout. Only relevant for scalable glyphs.
*
* advance ::
* This shorthand is, depending on @FT_LOAD_IGNORE_TRANSFORM, the
@@ -1916,6 +2305,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * library_setup
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Init_FreeType
*
@@ -1973,6 +2369,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * face_creation
+ *
+ */
+
+ /**************************************************************************
+ *
* @enum:
* FT_OPEN_XXX
*
@@ -2065,7 +2468,8 @@ FT_BEGIN_HEADER
* The size in bytes of the file in memory.
*
* pathname ::
- * A pointer to an 8-bit file pathname. The pointer is not owned by
+ * A pointer to an 8-bit file pathname, which must be a C~string (i.e.,
+ * no null bytes except at the very end). The pointer is not owned by
* FreeType.
*
* stream ::
@@ -2084,8 +2488,7 @@ FT_BEGIN_HEADER
* Extra parameters passed to the font driver when opening a new face.
*
* @note:
- * The stream type is determined by the contents of `flags` that are
- * tested in the following order by @FT_Open_Face:
+ * The stream type is determined by the contents of `flags`:
*
* If the @FT_OPEN_MEMORY bit is set, assume that this is a memory file
* of `memory_size` bytes, located at `memory_address`. The data are not
@@ -2098,6 +2501,9 @@ FT_BEGIN_HEADER
* Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this is a
* normal file and use `pathname` to open it.
*
+ * If none of the above bits are set or if multiple are set at the same
+ * time, the flags are invalid and @FT_Open_Face fails.
+ *
* If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to open
* the file with the driver whose handler is in `driver`.
*
@@ -2150,6 +2556,13 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
+ * The `pathname` string should be recognizable as such by a standard
+ * `fopen` call on your system; in particular, this means that `pathname`
+ * must not contain null bytes. If that is not sufficient to address all
+ * file name possibilities (for example, to handle wide character file
+ * names on Windows in UTF-16 encoding) you might use @FT_Open_Face to
+ * pass a memory array or a stream object instead.
+ *
* Use @FT_Done_Face to destroy the created @FT_Face object (along with
* its slot and sizes).
*/
@@ -2263,13 +2676,17 @@ FT_BEGIN_HEADER
* Each new face object created with this function also owns a default
* @FT_Size object, accessible as `face->size`.
*
- * One @FT_Library instance can have multiple face objects, this is,
+ * One @FT_Library instance can have multiple face objects, that is,
* @FT_Open_Face and its siblings can be called multiple times using the
* same `library` argument.
*
* See the discussion of reference counters in the description of
* @FT_Reference_Face.
*
+ * If `FT_OPEN_STREAM` is set in `args->flags`, the stream in
+ * `args->stream` is automatically closed before this function returns
+ * any error (including `FT_Err_Invalid_Argument`).
+ *
* @example:
* To loop over all faces, use code similar to the following snippet
* (omitting the error handling).
@@ -2401,8 +2818,8 @@ FT_BEGIN_HEADER
* stream attachments.
*/
FT_EXPORT( FT_Error )
- FT_Attach_Stream( FT_Face face,
- FT_Open_Args* parameters );
+ FT_Attach_Stream( FT_Face face,
+ const FT_Open_Args* parameters );
/**************************************************************************
@@ -2428,6 +2845,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.4.2
+ *
*/
FT_EXPORT( FT_Error )
FT_Reference_Face( FT_Face face );
@@ -2459,6 +2877,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * sizing_and_scaling
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Select_Size
*
@@ -2486,7 +2911,7 @@ FT_BEGIN_HEADER
* silently uses outlines if there is no bitmap for a given glyph index.
*
* For GX and OpenType variation fonts, a bitmap strike makes sense only
- * if the default instance is active (this is, no glyph variation takes
+ * if the default instance is active (that is, no glyph variation takes
* place); otherwise, FreeType simply ignores bitmap strikes. The same
* is true for all named instances that are different from the default
* instance.
@@ -2652,8 +3077,8 @@ FT_BEGIN_HEADER
* 'https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'.
*
* Contrary to @FT_Set_Char_Size, this function doesn't have special code
- * to normalize zero-valued widths, heights, or resolutions (which lead
- * to errors in most cases).
+ * to normalize zero-valued widths, heights, or resolutions, which are
+ * treated as @FT_LOAD_NO_SCALE.
*
* Don't use this function if you are using the FreeType cache API.
*/
@@ -2751,6 +3176,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * glyph_retrieval
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Load_Glyph
*
@@ -2769,7 +3201,7 @@ FT_BEGIN_HEADER
*
* load_flags ::
* A flag indicating what to load for this glyph. The @FT_LOAD_XXX
- * constants can be used to control the glyph loading process (e.g.,
+ * flags can be used to control the glyph loading process (e.g.,
* whether the outline should be scaled, whether to load bitmaps or
* not, whether to hint the outline, etc).
*
@@ -2777,11 +3209,13 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * The loaded glyph may be transformed. See @FT_Set_Transform for the
- * details.
+ * For proper scaling and hinting, the active @FT_Size object owned by
+ * the face has to be meaningfully initialized by calling
+ * @FT_Set_Char_Size before this function, for example. The loaded
+ * glyph may be transformed. See @FT_Set_Transform for the details.
*
* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument` is returned
- * for invalid CID values (this is, for CID values that don't have a
+ * for invalid CID values (that is, for CID values that don't have a
* corresponding glyph in the font). See the discussion of the
* @FT_FACE_FLAG_CID_KEYED flag for more details.
*
@@ -2797,6 +3231,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * character_mapping
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Load_Char
*
@@ -2840,6 +3281,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * glyph_retrieval
+ *
+ */
+
+ /**************************************************************************
+ *
* @enum:
* FT_LOAD_XXX
*
@@ -2868,19 +3316,21 @@ FT_BEGIN_HEADER
*
* FT_LOAD_NO_SCALE ::
* Don't scale the loaded outline glyph but keep it in font units.
+ * This flag is also assumed if @FT_Size owned by the face was not
+ * properly initialized.
*
* This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
* unsets @FT_LOAD_RENDER.
*
* If the font is 'tricky' (see @FT_FACE_FLAG_TRICKY for more), using
* `FT_LOAD_NO_SCALE` usually yields meaningless outlines because the
- * subglyphs must be scaled and positioned with hinting instructions.
+ * subglyphs must be scaled and positioned with hinting instructions.
* This can be solved by loading the font without `FT_LOAD_NO_SCALE`
* and setting the character size to `font->units_per_EM`.
*
* FT_LOAD_NO_HINTING ::
* Disable hinting. This generally generates 'blurrier' bitmap glyphs
- * when the glyph are rendered in any of the anti-aliased modes. See
+ * when the glyphs are rendered in any of the anti-aliased modes. See
* also the note below.
*
* This flag is implied by @FT_LOAD_NO_SCALE.
@@ -2898,6 +3348,15 @@ FT_BEGIN_HEADER
*
* @FT_LOAD_NO_SCALE always sets this flag.
*
+ * FT_LOAD_SBITS_ONLY ::
+ * [Since 2.12] This is the opposite of @FT_LOAD_NO_BITMAP, more or
+ * less: @FT_Load_Glyph returns `FT_Err_Invalid_Argument` if the face
+ * contains a bitmap strike for the given size (or the strike selected
+ * by @FT_Select_Size) but there is no glyph in the strike.
+ *
+ * Note that this load flag was part of FreeType since version 2.0.6
+ * but previously tagged as internal.
+ *
* FT_LOAD_VERTICAL_LAYOUT ::
* Load the glyph for vertical text layout. In particular, the
* `advance` value in the @FT_GlyphSlotRec structure is set to the
@@ -2954,25 +3413,39 @@ FT_BEGIN_HEADER
* Disable the auto-hinter. See also the note below.
*
* FT_LOAD_COLOR ::
- * Load colored glyphs. There are slight differences depending on the
- * font format.
- *
- * [Since 2.5] Load embedded color bitmap images. The resulting color
- * bitmaps, if available, will have the @FT_PIXEL_MODE_BGRA format,
- * with pre-multiplied color channels. If the flag is not set and
- * color bitmaps are found, they are converted to 256-level gray
- * bitmaps, using the @FT_PIXEL_MODE_GRAY format.
- *
- * [Since 2.10, experimental] If the glyph index contains an entry in
+ * Load colored glyphs. FreeType searches in the following order;
+ * there are slight differences depending on the font format.
+ *
+ * [Since 2.5] Load embedded color bitmap images (provided
+ * @FT_LOAD_NO_BITMAP is not set). The resulting color bitmaps, if
+ * available, have the @FT_PIXEL_MODE_BGRA format, with pre-multiplied
+ * color channels. If the flag is not set and color bitmaps are found,
+ * they are converted to 256-level gray bitmaps, using the
+ * @FT_PIXEL_MODE_GRAY format.
+ *
+ * [Since 2.12] If the glyph index maps to an entry in the face's
+ * 'SVG~' table, load the associated SVG document from this table and
+ * set the `format` field of @FT_GlyphSlotRec to @FT_GLYPH_FORMAT_SVG
+ * ([since 2.13.1] provided @FT_LOAD_NO_SVG is not set). Note that
+ * FreeType itself can't render SVG documents; however, the library
+ * provides hooks to seamlessly integrate an external renderer. See
+ * sections @ot_svg_driver and @svg_fonts for more.
+ *
+ * [Since 2.10, experimental] If the glyph index maps to an entry in
* the face's 'COLR' table with a 'CPAL' palette table (as defined in
* the OpenType specification), make @FT_Render_Glyph provide a default
* blending of the color glyph layers associated with the glyph index,
* using the same bitmap format as embedded color bitmap images. This
- * is mainly for convenience; for full control of color layers use
+ * is mainly for convenience and works only for glyphs in 'COLR' v0
+ * tables (or glyphs in 'COLR' v1 tables that exclusively use v0
+ * features). For full control of color layers use
* @FT_Get_Color_Glyph_Layer and FreeType's color functions like
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
* so that the client application can handle blending by itself.
*
+ * FT_LOAD_NO_SVG ::
+ * [Since 2.13.1] Ignore SVG glyph data when loading.
+ *
* FT_LOAD_COMPUTE_METRICS ::
* [Since 2.6.1] Compute glyph metrics from the glyph data, without the
* use of bundled metrics tables (for example, the 'hdmx' table in
@@ -3019,30 +3492,32 @@ FT_BEGIN_HEADER
*
*/
#define FT_LOAD_DEFAULT 0x0
-#define FT_LOAD_NO_SCALE ( 1L << 0 )
-#define FT_LOAD_NO_HINTING ( 1L << 1 )
-#define FT_LOAD_RENDER ( 1L << 2 )
-#define FT_LOAD_NO_BITMAP ( 1L << 3 )
-#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
-#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
-#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
-#define FT_LOAD_PEDANTIC ( 1L << 7 )
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
+#define FT_LOAD_NO_SCALE ( 1L << 0 )
+#define FT_LOAD_NO_HINTING ( 1L << 1 )
+#define FT_LOAD_RENDER ( 1L << 2 )
+#define FT_LOAD_NO_BITMAP ( 1L << 3 )
+#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
+#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
+#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
+#define FT_LOAD_PEDANTIC ( 1L << 7 )
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
#define FT_LOAD_NO_RECURSE ( 1L << 10 )
#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
#define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
+#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
/* Bits 16-19 are used by `FT_LOAD_TARGET_` */
#define FT_LOAD_COLOR ( 1L << 20 )
#define FT_LOAD_COMPUTE_METRICS ( 1L << 21 )
#define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 )
+#define FT_LOAD_NO_SVG ( 1L << 24 )
/* */
/* used internally only by certain font drivers */
-#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
-#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
+#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
+#define FT_LOAD_SVG_ONLY ( 1L << 23 )
/**************************************************************************
@@ -3132,7 +3607,7 @@ FT_BEGIN_HEADER
* necessary to empty the cache after a mode switch to avoid false hits.
*
*/
-#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
+#define FT_LOAD_TARGET_( x ) ( FT_STATIC_CAST( FT_Int32, (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
@@ -3151,11 +3626,19 @@ FT_BEGIN_HEADER
* @FT_LOAD_TARGET_XXX value.
*
*/
-#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
+#define FT_LOAD_TARGET_MODE( x ) \
+ FT_STATIC_CAST( FT_Render_Mode, ( (x) >> 16 ) & 15 )
/**************************************************************************
*
+ * @section:
+ * sizing_and_scaling
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Set_Transform
*
@@ -3172,11 +3655,12 @@ FT_BEGIN_HEADER
* A pointer to the transformation's 2x2 matrix. Use `NULL` for the
* identity matrix.
* delta ::
- * A pointer to the translation vector. Use `NULL` for the null vector.
+ * A pointer to the translation vector. Use `NULL` for the null
+ * vector.
*
* @note:
* This function is provided as a convenience, but keep in mind that
- * @FT_Matrix coefficients are only 16.16 fixed point values, which can
+ * @FT_Matrix coefficients are only 16.16 fixed-point values, which can
* limit the accuracy of the results. Using floating-point computations
* to perform the transform directly in client code instead will always
* yield better numbers.
@@ -3197,6 +3681,46 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @function:
+ * FT_Get_Transform
+ *
+ * @description:
+ * Return the transformation that is applied to glyph images when they
+ * are loaded into a glyph slot through @FT_Load_Glyph. See
+ * @FT_Set_Transform for more details.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face object.
+ *
+ * @output:
+ * matrix ::
+ * A pointer to a transformation's 2x2 matrix. Set this to NULL if you
+ * are not interested in the value.
+ *
+ * delta ::
+ * A pointer to a translation vector. Set this to NULL if you are not
+ * interested in the value.
+ *
+ * @since:
+ * 2.11
+ *
+ */
+ FT_EXPORT( void )
+ FT_Get_Transform( FT_Face face,
+ FT_Matrix* matrix,
+ FT_Vector* delta );
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * glyph_retrieval
+ *
+ */
+
+ /**************************************************************************
+ *
* @enum:
* FT_Render_Mode
*
@@ -3213,6 +3737,10 @@ FT_BEGIN_HEADER
* correction to correctly render non-monochrome glyph bitmaps onto a
* surface; see @FT_Render_Glyph.
*
+ * The @FT_RENDER_MODE_SDF is a special render mode that uses up to 256
+ * distance values, indicating the signed distance from the grid position
+ * to the nearest outline.
+ *
* @values:
* FT_RENDER_MODE_NORMAL ::
* Default render mode; it corresponds to 8-bit anti-aliased bitmaps.
@@ -3238,11 +3766,88 @@ FT_BEGIN_HEADER
* bitmaps that are 3~times the height of the original glyph outline in
* pixels and use the @FT_PIXEL_MODE_LCD_V mode.
*
+ * FT_RENDER_MODE_SDF ::
+ * This mode corresponds to 8-bit, single-channel signed distance field
+ * (SDF) bitmaps. Each pixel in the SDF grid is the value from the
+ * pixel's position to the nearest glyph's outline. The distances are
+ * calculated from the center of the pixel and are positive if they are
+ * filled by the outline (i.e., inside the outline) and negative
+ * otherwise. Check the note below on how to convert the output values
+ * to usable data.
+ *
* @note:
* The selected render mode only affects vector glyphs of a font.
* Embedded bitmaps often have a different pixel mode like
* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform them
* into 8-bit pixmaps.
+ *
+ * For @FT_RENDER_MODE_SDF the output bitmap buffer contains normalized
+ * distances that are packed into unsigned 8-bit values. To get pixel
+ * values in floating point representation use the following pseudo-C
+ * code for the conversion.
+ *
+ * ```
+ * // Load glyph and render using FT_RENDER_MODE_SDF,
+ * // then use the output buffer as follows.
+ *
+ * ...
+ * FT_Byte buffer = glyph->bitmap->buffer;
+ *
+ *
+ * for pixel in buffer
+ * {
+ * // `sd` is the signed distance and `spread` is the current spread;
+ * // the default spread is 2 and can be changed.
+ *
+ * float sd = (float)pixel - 128.0f;
+ *
+ *
+ * // Convert to pixel values.
+ * sd = ( sd / 128.0f ) * spread;
+ *
+ * // Store `sd` in a buffer or use as required.
+ * }
+ *
+ * ```
+ *
+ * FreeType has two rasterizers for generating SDF, namely:
+ *
+ * 1. `sdf` for generating SDF directly from glyph's outline, and
+ *
+ * 2. `bsdf` for generating SDF from rasterized bitmaps.
+ *
+ * Depending on the glyph type (i.e., outline or bitmap), one of the two
+ * rasterizers is chosen at runtime and used for generating SDFs. To
+ * force the use of `bsdf` you should render the glyph with any of the
+ * FreeType's other rendering modes (e.g., `FT_RENDER_MODE_NORMAL`) and
+ * then re-render with `FT_RENDER_MODE_SDF`.
+ *
+ * There are some issues with stability and possible failures of the SDF
+ * renderers (specifically `sdf`).
+ *
+ * 1. The `sdf` rasterizer is sensitive to really small features (e.g.,
+ * sharp turns that are less than 1~pixel) and imperfections in the
+ * glyph's outline, causing artifacts in the final output.
+ *
+ * 2. The `sdf` rasterizer has limited support for handling intersecting
+ * contours and *cannot* handle self-intersecting contours whatsoever.
+ * Self-intersection happens when a single connected contour
+ * intersects itself at some point; having these in your font
+ * definitely poses a problem to the rasterizer and cause artifacts,
+ * too.
+ *
+ * 3. Generating SDF for really small glyphs may result in undesirable
+ * output; the pixel grid (which stores distance information) becomes
+ * too coarse.
+ *
+ * 4. Since the output buffer is normalized, precision at smaller spreads
+ * is greater than precision at larger spread values because the
+ * output range of [0..255] gets mapped to a smaller SDF range. A
+ * spread of~2 should be sufficient in most cases.
+ *
+ * Points (1) and (2) can be avoided by using the `bsdf` rasterizer,
+ * which is more stable than the `sdf` rasterizer in general.
+ *
*/
typedef enum FT_Render_Mode_
{
@@ -3251,6 +3856,7 @@ FT_BEGIN_HEADER
FT_RENDER_MODE_MONO,
FT_RENDER_MODE_LCD,
FT_RENDER_MODE_LCD_V,
+ FT_RENDER_MODE_SDF,
FT_RENDER_MODE_MAX
@@ -3282,7 +3888,7 @@ FT_BEGIN_HEADER
* @FT_Render_Mode for a list of possible values.
*
* If @FT_RENDER_MODE_NORMAL is used, a previous call of @FT_Load_Glyph
- * with flag @FT_LOAD_COLOR makes FT_Render_Glyph provide a default
+ * with flag @FT_LOAD_COLOR makes `FT_Render_Glyph` provide a default
* blending of colored glyph layers associated with the current glyph
* slot (provided the font contains such layers) instead of rendering
* the glyph slot's outline. This is an experimental feature; see
@@ -3292,9 +3898,6 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * To get meaningful results, font scaling values must be set with
- * functions like @FT_Set_Char_Size before calling `FT_Render_Glyph`.
- *
* When FreeType outputs a bitmap of a glyph, it really outputs an alpha
* coverage map. If a pixel is completely covered by a filled-in
* outline, the bitmap contains 0xFF at that pixel, meaning that
@@ -3338,7 +3941,8 @@ FT_BEGIN_HEADER
*
* which is known as the OVER operator.
*
- * To correctly composite an antialiased pixel of a glyph onto a surface,
+ * To correctly composite an anti-aliased pixel of a glyph onto a
+ * surface,
*
* 1. take the foreground and background colors (e.g., in sRGB space)
* and apply gamma to get them in a linear space,
@@ -3511,86 +4115,10 @@ FT_BEGIN_HEADER
/**************************************************************************
*
- * @function:
- * FT_Get_Glyph_Name
- *
- * @description:
- * Retrieve the ASCII name of a given glyph in a face. This only works
- * for those faces where @FT_HAS_GLYPH_NAMES(face) returns~1.
- *
- * @input:
- * face ::
- * A handle to a source face object.
- *
- * glyph_index ::
- * The glyph index.
- *
- * buffer_max ::
- * The maximum number of bytes available in the buffer.
- *
- * @output:
- * buffer ::
- * A pointer to a target buffer where the name is copied to.
- *
- * @return:
- * FreeType error code. 0~means success.
- *
- * @note:
- * An error is returned if the face doesn't provide glyph names or if the
- * glyph index is invalid. In all cases of failure, the first byte of
- * `buffer` is set to~0 to indicate an empty name.
- *
- * The glyph name is truncated to fit within the buffer if it is too
- * long. The returned string is always zero-terminated.
- *
- * Be aware that FreeType reorders glyph indices internally so that glyph
- * index~0 always corresponds to the 'missing glyph' (called '.notdef').
- *
- * This function always returns an error if the config macro
- * `FT_CONFIG_OPTION_NO_GLYPH_NAMES` is not defined in `ftoption.h`.
- */
- FT_EXPORT( FT_Error )
- FT_Get_Glyph_Name( FT_Face face,
- FT_UInt glyph_index,
- FT_Pointer buffer,
- FT_UInt buffer_max );
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Get_Postscript_Name
- *
- * @description:
- * Retrieve the ASCII PostScript name of a given face, if available.
- * This only works with PostScript, TrueType, and OpenType fonts.
- *
- * @input:
- * face ::
- * A handle to the source face object.
- *
- * @return:
- * A pointer to the face's PostScript name. `NULL` if unavailable.
- *
- * @note:
- * The returned pointer is owned by the face and is destroyed with it.
- *
- * For variation fonts, this string changes if you select a different
- * instance, and you have to call `FT_Get_PostScript_Name` again to
- * retrieve it. FreeType follows Adobe TechNote #5902, 'Generating
- * PostScript Names for Fonts Using OpenType Font Variations'.
- *
- * https://download.macromedia.com/pub/developer/opentype/tech-notes/5902.AdobePSNameGeneration.html
+ * @section:
+ * character_mapping
*
- * [Since 2.9] Special PostScript names for named instances are only
- * returned if the named instance is set with @FT_Set_Named_Instance (and
- * the font has corresponding entries in its 'fvar' table). If
- * @FT_IS_VARIATION returns true, the algorithmically derived PostScript
- * name is provided, not looking up special entries for named instances.
*/
- FT_EXPORT( const char* )
- FT_Get_Postscript_Name( FT_Face face );
-
/**************************************************************************
*
@@ -3810,6 +4338,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * face_creation
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Face_Properties
*
@@ -3908,11 +4443,19 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * information_retrieval
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Get_Name_Index
*
* @description:
- * Return the glyph index of a given glyph name.
+ * Return the glyph index of a given glyph name. This only works
+ * for those faces where @FT_HAS_GLYPH_NAMES returns true.
*
* @input:
* face ::
@@ -3923,6 +4466,16 @@ FT_BEGIN_HEADER
*
* @return:
* The glyph index. 0~means 'undefined character code'.
+ *
+ * @note:
+ * Acceptable glyph names might come from the [Adobe Glyph
+ * List](https://github.com/adobe-type-tools/agl-aglfn). See
+ * @FT_Get_Glyph_Name for the inverse functionality.
+ *
+ * This function has limited capabilities if the config macro
+ * `FT_CONFIG_OPTION_POSTSCRIPT_NAMES` is not defined in `ftoption.h`:
+ * It then works only for fonts that actually embed glyph names (which
+ * many recent OpenType fonts do not).
*/
FT_EXPORT( FT_UInt )
FT_Get_Name_Index( FT_Face face,
@@ -3931,6 +4484,92 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @function:
+ * FT_Get_Glyph_Name
+ *
+ * @description:
+ * Retrieve the ASCII name of a given glyph in a face. This only works
+ * for those faces where @FT_HAS_GLYPH_NAMES returns true.
+ *
+ * @input:
+ * face ::
+ * A handle to a source face object.
+ *
+ * glyph_index ::
+ * The glyph index.
+ *
+ * buffer_max ::
+ * The maximum number of bytes available in the buffer.
+ *
+ * @output:
+ * buffer ::
+ * A pointer to a target buffer where the name is copied to.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * An error is returned if the face doesn't provide glyph names or if the
+ * glyph index is invalid. In all cases of failure, the first byte of
+ * `buffer` is set to~0 to indicate an empty name.
+ *
+ * The glyph name is truncated to fit within the buffer if it is too
+ * long. The returned string is always zero-terminated.
+ *
+ * Be aware that FreeType reorders glyph indices internally so that glyph
+ * index~0 always corresponds to the 'missing glyph' (called '.notdef').
+ *
+ * This function has limited capabilities if the config macro
+ * `FT_CONFIG_OPTION_POSTSCRIPT_NAMES` is not defined in `ftoption.h`:
+ * It then works only for fonts that actually embed glyph names (which
+ * many recent OpenType fonts do not).
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_Glyph_Name( FT_Face face,
+ FT_UInt glyph_index,
+ FT_Pointer buffer,
+ FT_UInt buffer_max );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Postscript_Name
+ *
+ * @description:
+ * Retrieve the ASCII PostScript name of a given face, if available.
+ * This only works with PostScript, TrueType, and OpenType fonts.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face object.
+ *
+ * @return:
+ * A pointer to the face's PostScript name. `NULL` if unavailable.
+ *
+ * @note:
+ * The returned pointer is owned by the face and is destroyed with it.
+ *
+ * For variation fonts, this string changes if you select a different
+ * instance, and you have to call `FT_Get_PostScript_Name` again to
+ * retrieve it. FreeType follows Adobe TechNote #5902, 'Generating
+ * PostScript Names for Fonts Using OpenType Font Variations'.
+ *
+ * https://download.macromedia.com/pub/developer/opentype/tech-notes/5902.AdobePSNameGeneration.html
+ *
+ * [Since 2.9] Special PostScript names for named instances are only
+ * returned if the named instance is set with @FT_Set_Named_Instance (and
+ * the font has corresponding entries in its 'fvar' table or is the
+ * default named instance). If @FT_IS_VARIATION returns true, the
+ * algorithmically derived PostScript name is provided, not looking up
+ * special entries for named instances.
+ */
+ FT_EXPORT( const char* )
+ FT_Get_Postscript_Name( FT_Face face );
+
+
+ /**************************************************************************
+ *
* @enum:
* FT_SUBGLYPH_FLAG_XXX
*
@@ -4017,175 +4656,6 @@ FT_BEGIN_HEADER
/**************************************************************************
*
- * @section:
- * layer_management
- *
- * @title:
- * Glyph Layer Management
- *
- * @abstract:
- * Retrieving and manipulating OpenType's 'COLR' table data.
- *
- * @description:
- * The functions described here allow access of colored glyph layer data
- * in OpenType's 'COLR' tables.
- */
-
-
- /**************************************************************************
- *
- * @struct:
- * FT_LayerIterator
- *
- * @description:
- * This iterator object is needed for @FT_Get_Color_Glyph_Layer.
- *
- * @fields:
- * num_layers ::
- * The number of glyph layers for the requested glyph index. Will be
- * set by @FT_Get_Color_Glyph_Layer.
- *
- * layer ::
- * The current layer. Will be set by @FT_Get_Color_Glyph_Layer.
- *
- * p ::
- * An opaque pointer into 'COLR' table data. The caller must set this
- * to `NULL` before the first call of @FT_Get_Color_Glyph_Layer.
- */
- typedef struct FT_LayerIterator_
- {
- FT_UInt num_layers;
- FT_UInt layer;
- FT_Byte* p;
-
- } FT_LayerIterator;
-
-
- /**************************************************************************
- *
- * @function:
- * FT_Get_Color_Glyph_Layer
- *
- * @description:
- * This is an interface to the 'COLR' table in OpenType fonts to
- * iteratively retrieve the colored glyph layers associated with the
- * current glyph slot.
- *
- * https://docs.microsoft.com/en-us/typography/opentype/spec/colr
- *
- * The glyph layer data for a given glyph index, if present, provides an
- * alternative, multi-color glyph representation: Instead of rendering
- * the outline or bitmap with the given glyph index, glyphs with the
- * indices and colors returned by this function are rendered layer by
- * layer.
- *
- * The returned elements are ordered in the z~direction from bottom to
- * top; the 'n'th element should be rendered with the associated palette
- * color and blended on top of the already rendered layers (elements 0,
- * 1, ..., n-1).
- *
- * @input:
- * face ::
- * A handle to the parent face object.
- *
- * base_glyph ::
- * The glyph index the colored glyph layers are associated with.
- *
- * @inout:
- * iterator ::
- * An @FT_LayerIterator object. For the first call you should set
- * `iterator->p` to `NULL`. For all following calls, simply use the
- * same object again.
- *
- * @output:
- * aglyph_index ::
- * The glyph index of the current layer.
- *
- * acolor_index ::
- * The color index into the font face's color palette of the current
- * layer. The value 0xFFFF is special; it doesn't reference a palette
- * entry but indicates that the text foreground color should be used
- * instead (to be set up by the application outside of FreeType).
- *
- * The color palette can be retrieved with @FT_Palette_Select.
- *
- * @return:
- * Value~1 if everything is OK. If there are no more layers (or if there
- * are no layers at all), value~0 gets returned. In case of an error,
- * value~0 is returned also.
- *
- * @note:
- * This function is necessary if you want to handle glyph layers by
- * yourself. In particular, functions that operate with @FT_GlyphRec
- * objects (like @FT_Get_Glyph or @FT_Glyph_To_Bitmap) don't have access
- * to this information.
- *
- * Note that @FT_Render_Glyph is able to handle colored glyph layers
- * automatically if the @FT_LOAD_COLOR flag is passed to a previous call
- * to @FT_Load_Glyph. [This is an experimental feature.]
- *
- * @example:
- * ```
- * FT_Color* palette;
- * FT_LayerIterator iterator;
- *
- * FT_Bool have_layers;
- * FT_UInt layer_glyph_index;
- * FT_UInt layer_color_index;
- *
- *
- * error = FT_Palette_Select( face, palette_index, &palette );
- * if ( error )
- * palette = NULL;
- *
- * iterator.p = NULL;
- * have_layers = FT_Get_Color_Glyph_Layer( face,
- * glyph_index,
- * &layer_glyph_index,
- * &layer_color_index,
- * &iterator );
- *
- * if ( palette && have_layers )
- * {
- * do
- * {
- * FT_Color layer_color;
- *
- *
- * if ( layer_color_index == 0xFFFF )
- * layer_color = text_foreground_color;
- * else
- * layer_color = palette[layer_color_index];
- *
- * // Load and render glyph `layer_glyph_index', then
- * // blend resulting pixmap (using color `layer_color')
- * // with previously created pixmaps.
- *
- * } while ( FT_Get_Color_Glyph_Layer( face,
- * glyph_index,
- * &layer_glyph_index,
- * &layer_color_index,
- * &iterator ) );
- * }
- * ```
- */
- FT_EXPORT( FT_Bool )
- FT_Get_Color_Glyph_Layer( FT_Face face,
- FT_UInt base_glyph,
- FT_UInt *aglyph_index,
- FT_UInt *acolor_index,
- FT_LayerIterator* iterator );
-
-
- /**************************************************************************
- *
- * @section:
- * base_interface
- *
- */
-
- /**************************************************************************
- *
* @enum:
* FT_FSTYPE_XXX
*
@@ -4267,6 +4737,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.8
+ *
*/
FT_EXPORT( FT_UShort )
FT_Get_FSType_Flags( FT_Face face );
@@ -4360,6 +4831,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
+ *
*/
FT_EXPORT( FT_UInt )
FT_Face_GetCharVariantIndex( FT_Face face,
@@ -4396,6 +4868,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
+ *
*/
FT_EXPORT( FT_Int )
FT_Face_GetCharVariantIsDefault( FT_Face face,
@@ -4427,6 +4900,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
+ *
*/
FT_EXPORT( FT_UInt32* )
FT_Face_GetVariantSelectors( FT_Face face );
@@ -4460,6 +4934,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
+ *
*/
FT_EXPORT( FT_UInt32* )
FT_Face_GetVariantsOfChar( FT_Face face,
@@ -4494,6 +4969,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
+ *
*/
FT_EXPORT( FT_UInt32* )
FT_Face_GetCharsOfVariant( FT_Face face,
@@ -4513,7 +4989,8 @@ FT_BEGIN_HEADER
*
* @description:
* This section contains various functions used to perform computations
- * on 16.16 fixed-float numbers or 2d vectors.
+ * on 16.16 fixed-point numbers or 2D vectors. FreeType does not use
+ * floating-point data types.
*
* **Attention**: Most arithmetic functions take `FT_Long` as arguments.
* For historical reasons, FreeType was designed under the assumption
@@ -4717,32 +5194,10 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
- * version
- *
- * @title:
- * FreeType Version
- *
- * @abstract:
- * Functions and macros related to FreeType versions.
- *
- * @description:
- * Note that those functions and macros are of limited use because even a
- * new release of FreeType with only documentation changes increases the
- * version number.
- *
- * @order:
- * FT_Library_Version
- *
- * FREETYPE_MAJOR
- * FREETYPE_MINOR
- * FREETYPE_PATCH
- *
- * FT_Face_CheckTrueTypePatents
- * FT_Face_SetUnpatentedHinting
+ * library_setup
*
*/
-
/**************************************************************************
*
* @enum:
@@ -4766,8 +5221,8 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 10
-#define FREETYPE_PATCH 4
+#define FREETYPE_MINOR 13
+#define FREETYPE_PATCH 2
/**************************************************************************
@@ -4811,6 +5266,13 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @section:
+ * other_api_data
+ *
+ */
+
+ /**************************************************************************
+ *
* @function:
* FT_Face_CheckTrueTypePatents
*
@@ -4829,6 +5291,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.5
+ *
*/
FT_EXPORT( FT_Bool )
FT_Face_CheckTrueTypePatents( FT_Face face );
@@ -4857,6 +5320,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.5
+ *
*/
FT_EXPORT( FT_Bool )
FT_Face_SetUnpatentedHinting( FT_Face face,
diff --git a/src/3rdparty/freetype/include/freetype/ftadvanc.h b/src/3rdparty/freetype/include/freetype/ftadvanc.h
index f166bc6f99..4560ded6dc 100644
--- a/src/3rdparty/freetype/include/freetype/ftadvanc.h
+++ b/src/3rdparty/freetype/include/freetype/ftadvanc.h
@@ -4,7 +4,7 @@
*
* Quick computation of advance widths (specification only).
*
- * Copyright (C) 2008-2020 by
+ * Copyright (C) 2008-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftbbox.h b/src/3rdparty/freetype/include/freetype/ftbbox.h
index fda1ad94a5..fc21740fc2 100644
--- a/src/3rdparty/freetype/include/freetype/ftbbox.h
+++ b/src/3rdparty/freetype/include/freetype/ftbbox.h
@@ -4,7 +4,7 @@
*
* FreeType exact bbox computation (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftbdf.h b/src/3rdparty/freetype/include/freetype/ftbdf.h
index 2e1daeeaaf..e8ce643128 100644
--- a/src/3rdparty/freetype/include/freetype/ftbdf.h
+++ b/src/3rdparty/freetype/include/freetype/ftbdf.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing BDF-specific strings (specification).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftbitmap.h b/src/3rdparty/freetype/include/freetype/ftbitmap.h
index 282c22e1cf..eb6b4b1eeb 100644
--- a/src/3rdparty/freetype/include/freetype/ftbitmap.h
+++ b/src/3rdparty/freetype/include/freetype/ftbitmap.h
@@ -4,7 +4,7 @@
*
* FreeType utility functions for bitmaps (specification).
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftbzip2.h b/src/3rdparty/freetype/include/freetype/ftbzip2.h
index eb6a5a55d1..7d29f4682c 100644
--- a/src/3rdparty/freetype/include/freetype/ftbzip2.h
+++ b/src/3rdparty/freetype/include/freetype/ftbzip2.h
@@ -4,7 +4,7 @@
*
* Bzip2-compressed stream support.
*
- * Copyright (C) 2010-2020 by
+ * Copyright (C) 2010-2023 by
* Joel Klinghed.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftcache.h b/src/3rdparty/freetype/include/freetype/ftcache.h
index 6047275205..a2072e26b8 100644
--- a/src/3rdparty/freetype/include/freetype/ftcache.h
+++ b/src/3rdparty/freetype/include/freetype/ftcache.h
@@ -4,7 +4,7 @@
*
* FreeType Cache subsystem (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -43,61 +43,61 @@ FT_BEGIN_HEADER
* objects, as well as caching information like character maps and glyph
* images while limiting their maximum memory usage.
*
- * Note that all types and functions begin with the `FTC_` prefix.
+ * Note that all types and functions begin with the `FTC_` prefix rather
+ * than the usual `FT_` prefix in the rest of FreeType.
*
- * The cache is highly portable and thus doesn't know anything about the
- * fonts installed on your system, or how to access them. This implies
- * the following scheme:
+ * The cache is highly portable and, thus, doesn't know anything about
+ * the fonts installed on your system, or how to access them. Therefore,
+ * it requires the following.
*
- * First, available or installed font faces are uniquely identified by
- * @FTC_FaceID values, provided to the cache by the client. Note that
- * the cache only stores and compares these values, and doesn't try to
- * interpret them in any way.
+ * * @FTC_FaceID, an arbitrary non-zero value that uniquely identifies
+ * available or installed font faces, has to be provided to the
+ * cache by the client. Note that the cache only stores and compares
+ * these values and doesn't try to interpret them in any way, but they
+ * have to be persistent on the client side.
*
- * Second, the cache calls, only when needed, a client-provided function
- * to convert an @FTC_FaceID into a new @FT_Face object. The latter is
- * then completely managed by the cache, including its termination
- * through @FT_Done_Face. To monitor termination of face objects, the
- * finalizer callback in the `generic` field of the @FT_Face object can
- * be used, which might also be used to store the @FTC_FaceID of the
- * face.
+ * * @FTC_Face_Requester, a method to convert an @FTC_FaceID into a new
+ * @FT_Face object when necessary, has to be provided to the cache by
+ * the client. The @FT_Face object is completely managed by the cache,
+ * including its termination through @FT_Done_Face. To monitor
+ * termination of face objects, the finalizer callback in the `generic`
+ * field of the @FT_Face object can be used, which might also be used
+ * to store the @FTC_FaceID of the face.
*
- * Clients are free to map face IDs to anything else. The most simple
- * usage is to associate them to a (pathname,face_index) pair that is
- * used to call @FT_New_Face. However, more complex schemes are also
- * possible.
+ * Clients are free to map face IDs to anything useful. The most simple
+ * usage is, for example, to associate them to a `{pathname,face_index}`
+ * pair that is then used by @FTC_Face_Requester to call @FT_New_Face.
+ * However, more complex schemes are also possible.
*
* Note that for the cache to work correctly, the face ID values must be
* **persistent**, which means that the contents they point to should not
* change at runtime, or that their value should not become invalid.
- *
* If this is unavoidable (e.g., when a font is uninstalled at runtime),
- * you should call @FTC_Manager_RemoveFaceID as soon as possible, to let
+ * you should call @FTC_Manager_RemoveFaceID as soon as possible to let
* the cache get rid of any references to the old @FTC_FaceID it may keep
* internally. Failure to do so will lead to incorrect behaviour or even
- * crashes.
+ * crashes in @FTC_Face_Requester.
*
* To use the cache, start with calling @FTC_Manager_New to create a new
* @FTC_Manager object, which models a single cache instance. You can
* then look up @FT_Face and @FT_Size objects with
- * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.
- *
- * If you want to use the charmap caching, call @FTC_CMapCache_New, then
- * later use @FTC_CMapCache_Lookup to perform the equivalent of
- * @FT_Get_Char_Index, only much faster.
- *
- * If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
- * later use @FTC_ImageCache_Lookup to retrieve the corresponding
- * @FT_Glyph objects from the cache.
+ * @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively, and
+ * use them in any FreeType work stream. You can also cache other
+ * FreeType objects as follows.
*
- * If you need lots of small bitmaps, it is much more memory efficient to
- * call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
- * returns @FTC_SBitRec structures, which are used to store small bitmaps
- * directly. (A small bitmap is one whose metrics and dimensions all fit
- * into 8-bit integers).
+ * * If you want to use the charmap caching, call @FTC_CMapCache_New,
+ * then later use @FTC_CMapCache_Lookup to perform the equivalent of
+ * @FT_Get_Char_Index, only much faster.
*
- * We hope to also provide a kerning cache in the near future.
+ * * If you want to use the @FT_Glyph caching, call @FTC_ImageCache_New,
+ * then later use @FTC_ImageCache_Lookup to retrieve the corresponding
+ * @FT_Glyph objects from the cache.
*
+ * * If you need lots of small bitmaps, it is much more memory-efficient
+ * to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup. This
+ * returns @FTC_SBitRec structures, which are used to store small
+ * bitmaps directly. (A small bitmap is one whose metrics and
+ * dimensions all fit into 8-bit integers).
*
* @order:
* FTC_Manager
@@ -424,7 +424,7 @@ FT_BEGIN_HEADER
* pixel ::
* A Boolean. If 1, the `width` and `height` fields are interpreted as
* integer pixel character sizes. Otherwise, they are expressed as
- * 1/64th of points.
+ * 1/64 of points.
*
* x_res ::
* Only used when `pixel` is value~0 to indicate the horizontal
diff --git a/src/3rdparty/freetype/include/freetype/ftchapters.h b/src/3rdparty/freetype/include/freetype/ftchapters.h
index 2ee26973e4..7566fbd10f 100644
--- a/src/3rdparty/freetype/include/freetype/ftchapters.h
+++ b/src/3rdparty/freetype/include/freetype/ftchapters.h
@@ -15,6 +15,7 @@
* General Remarks
*
* @sections:
+ * preamble
* header_inclusion
* user_allocation
*
@@ -30,9 +31,28 @@
* Core API
*
* @sections:
- * version
* basic_types
- * base_interface
+ * library_setup
+ * face_creation
+ * font_testing_macros
+ * sizing_and_scaling
+ * glyph_retrieval
+ * character_mapping
+ * information_retrieval
+ * other_api_data
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @chapter:
+ * extended_api
+ *
+ * @title:
+ * Extended API
+ *
+ * @sections:
* glyph_variants
* color_management
* layer_management
@@ -61,6 +81,7 @@
* cid_fonts
* pfr_fonts
* winfnt_fonts
+ * svg_fonts
* font_formats
* gasp_table
*
@@ -81,6 +102,7 @@
* t1_cid_driver
* tt_driver
* pcf_driver
+ * ot_svg_driver
* properties
* parameter_tags
* lcd_rendering
@@ -123,6 +145,7 @@
* gzip
* lzw
* bzip2
+ * debugging_apis
*
*/
diff --git a/src/3rdparty/freetype/include/freetype/ftcid.h b/src/3rdparty/freetype/include/freetype/ftcid.h
index a29fb33306..ef22939022 100644
--- a/src/3rdparty/freetype/include/freetype/ftcid.h
+++ b/src/3rdparty/freetype/include/freetype/ftcid.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing CID font information (specification).
*
- * Copyright (C) 2007-2020 by
+ * Copyright (C) 2007-2023 by
* Dereg Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftcolor.h b/src/3rdparty/freetype/include/freetype/ftcolor.h
index ecc6485e5a..eae200fdf1 100644
--- a/src/3rdparty/freetype/include/freetype/ftcolor.h
+++ b/src/3rdparty/freetype/include/freetype/ftcolor.h
@@ -4,7 +4,7 @@
*
* FreeType's glyph color management (specification).
*
- * Copyright (C) 2018-2020 by
+ * Copyright (C) 2018-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -302,6 +302,1360 @@ FT_BEGIN_HEADER
FT_Palette_Set_Foreground_Color( FT_Face face,
FT_Color foreground_color );
+
+ /**************************************************************************
+ *
+ * @section:
+ * layer_management
+ *
+ * @title:
+ * Glyph Layer Management
+ *
+ * @abstract:
+ * Retrieving and manipulating OpenType's 'COLR' table data.
+ *
+ * @description:
+ * The functions described here allow access of colored glyph layer data
+ * in OpenType's 'COLR' tables.
+ */
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_LayerIterator
+ *
+ * @description:
+ * This iterator object is needed for @FT_Get_Color_Glyph_Layer.
+ *
+ * @fields:
+ * num_layers ::
+ * The number of glyph layers for the requested glyph index. Will be
+ * set by @FT_Get_Color_Glyph_Layer.
+ *
+ * layer ::
+ * The current layer. Will be set by @FT_Get_Color_Glyph_Layer.
+ *
+ * p ::
+ * An opaque pointer into 'COLR' table data. The caller must set this
+ * to `NULL` before the first call of @FT_Get_Color_Glyph_Layer.
+ */
+ typedef struct FT_LayerIterator_
+ {
+ FT_UInt num_layers;
+ FT_UInt layer;
+ FT_Byte* p;
+
+ } FT_LayerIterator;
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Color_Glyph_Layer
+ *
+ * @description:
+ * This is an interface to the 'COLR' table in OpenType fonts to
+ * iteratively retrieve the colored glyph layers associated with the
+ * current glyph slot.
+ *
+ * https://docs.microsoft.com/en-us/typography/opentype/spec/colr
+ *
+ * The glyph layer data for a given glyph index, if present, provides an
+ * alternative, multi-color glyph representation: Instead of rendering
+ * the outline or bitmap with the given glyph index, glyphs with the
+ * indices and colors returned by this function are rendered layer by
+ * layer.
+ *
+ * The returned elements are ordered in the z~direction from bottom to
+ * top; the 'n'th element should be rendered with the associated palette
+ * color and blended on top of the already rendered layers (elements 0,
+ * 1, ..., n-1).
+ *
+ * @input:
+ * face ::
+ * A handle to the parent face object.
+ *
+ * base_glyph ::
+ * The glyph index the colored glyph layers are associated with.
+ *
+ * @inout:
+ * iterator ::
+ * An @FT_LayerIterator object. For the first call you should set
+ * `iterator->p` to `NULL`. For all following calls, simply use the
+ * same object again.
+ *
+ * @output:
+ * aglyph_index ::
+ * The glyph index of the current layer.
+ *
+ * acolor_index ::
+ * The color index into the font face's color palette of the current
+ * layer. The value 0xFFFF is special; it doesn't reference a palette
+ * entry but indicates that the text foreground color should be used
+ * instead (to be set up by the application outside of FreeType).
+ *
+ * The color palette can be retrieved with @FT_Palette_Select.
+ *
+ * @return:
+ * Value~1 if everything is OK. If there are no more layers (or if there
+ * are no layers at all), value~0 gets returned. In case of an error,
+ * value~0 is returned also.
+ *
+ * @note:
+ * This function is necessary if you want to handle glyph layers by
+ * yourself. In particular, functions that operate with @FT_GlyphRec
+ * objects (like @FT_Get_Glyph or @FT_Glyph_To_Bitmap) don't have access
+ * to this information.
+ *
+ * Note that @FT_Render_Glyph is able to handle colored glyph layers
+ * automatically if the @FT_LOAD_COLOR flag is passed to a previous call
+ * to @FT_Load_Glyph. [This is an experimental feature.]
+ *
+ * @example:
+ * ```
+ * FT_Color* palette;
+ * FT_LayerIterator iterator;
+ *
+ * FT_Bool have_layers;
+ * FT_UInt layer_glyph_index;
+ * FT_UInt layer_color_index;
+ *
+ *
+ * error = FT_Palette_Select( face, palette_index, &palette );
+ * if ( error )
+ * palette = NULL;
+ *
+ * iterator.p = NULL;
+ * have_layers = FT_Get_Color_Glyph_Layer( face,
+ * glyph_index,
+ * &layer_glyph_index,
+ * &layer_color_index,
+ * &iterator );
+ *
+ * if ( palette && have_layers )
+ * {
+ * do
+ * {
+ * FT_Color layer_color;
+ *
+ *
+ * if ( layer_color_index == 0xFFFF )
+ * layer_color = text_foreground_color;
+ * else
+ * layer_color = palette[layer_color_index];
+ *
+ * // Load and render glyph `layer_glyph_index', then
+ * // blend resulting pixmap (using color `layer_color')
+ * // with previously created pixmaps.
+ *
+ * } while ( FT_Get_Color_Glyph_Layer( face,
+ * glyph_index,
+ * &layer_glyph_index,
+ * &layer_color_index,
+ * &iterator ) );
+ * }
+ * ```
+ *
+ * @since:
+ * 2.10
+ */
+ FT_EXPORT( FT_Bool )
+ FT_Get_Color_Glyph_Layer( FT_Face face,
+ FT_UInt base_glyph,
+ FT_UInt *aglyph_index,
+ FT_UInt *acolor_index,
+ FT_LayerIterator* iterator );
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_PaintFormat
+ *
+ * @description:
+ * Enumeration describing the different paint format types of the v1
+ * extensions to the 'COLR' table, see
+ * 'https://github.com/googlefonts/colr-gradients-spec'.
+ *
+ * The enumeration values loosely correspond with the format numbers of
+ * the specification: FreeType always returns a fully specified 'Paint'
+ * structure for the 'Transform', 'Translate', 'Scale', 'Rotate', and
+ * 'Skew' table types even though the specification has different formats
+ * depending on whether or not a center is specified, whether the scale
+ * is uniform in x and y~direction or not, etc. Also, only non-variable
+ * format identifiers are listed in this enumeration; as soon as support
+ * for variable 'COLR' v1 fonts is implemented, interpolation is
+ * performed dependent on axis coordinates, which are configured on the
+ * @FT_Face through @FT_Set_Var_Design_Coordinates. This implies that
+ * always static, readily interpolated values are returned in the 'Paint'
+ * structures.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef enum FT_PaintFormat_
+ {
+ FT_COLR_PAINTFORMAT_COLR_LAYERS = 1,
+ FT_COLR_PAINTFORMAT_SOLID = 2,
+ FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4,
+ FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6,
+ FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8,
+ FT_COLR_PAINTFORMAT_GLYPH = 10,
+ FT_COLR_PAINTFORMAT_COLR_GLYPH = 11,
+ FT_COLR_PAINTFORMAT_TRANSFORM = 12,
+ FT_COLR_PAINTFORMAT_TRANSLATE = 14,
+ FT_COLR_PAINTFORMAT_SCALE = 16,
+ FT_COLR_PAINTFORMAT_ROTATE = 24,
+ FT_COLR_PAINTFORMAT_SKEW = 28,
+ FT_COLR_PAINTFORMAT_COMPOSITE = 32,
+ FT_COLR_PAINT_FORMAT_MAX = 33,
+ FT_COLR_PAINTFORMAT_UNSUPPORTED = 255
+
+ } FT_PaintFormat;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_ColorStopIterator
+ *
+ * @description:
+ * This iterator object is needed for @FT_Get_Colorline_Stops. It keeps
+ * state while iterating over the stops of an @FT_ColorLine, representing
+ * the `ColorLine` struct of the v1 extensions to 'COLR', see
+ * 'https://github.com/googlefonts/colr-gradients-spec'. Do not manually
+ * modify fields of this iterator.
+ *
+ * @fields:
+ * num_color_stops ::
+ * The number of color stops for the requested glyph index. Set by
+ * @FT_Get_Paint.
+ *
+ * current_color_stop ::
+ * The current color stop. Set by @FT_Get_Colorline_Stops.
+ *
+ * p ::
+ * An opaque pointer into 'COLR' table data. Set by @FT_Get_Paint.
+ * Updated by @FT_Get_Colorline_Stops.
+ *
+ * read_variable ::
+ * A boolean keeping track of whether variable color lines are to be
+ * read. Set by @FT_Get_Paint.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_ColorStopIterator_
+ {
+ FT_UInt num_color_stops;
+ FT_UInt current_color_stop;
+
+ FT_Byte* p;
+
+ FT_Bool read_variable;
+
+ } FT_ColorStopIterator;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_ColorIndex
+ *
+ * @description:
+ * A structure representing a `ColorIndex` value of the 'COLR' v1
+ * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
+ *
+ * @fields:
+ * palette_index ::
+ * The palette index into a 'CPAL' palette.
+ *
+ * alpha ::
+ * Alpha transparency value multiplied with the value from 'CPAL'.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_ColorIndex_
+ {
+ FT_UInt16 palette_index;
+ FT_F2Dot14 alpha;
+
+ } FT_ColorIndex;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_ColorStop
+ *
+ * @description:
+ * A structure representing a `ColorStop` value of the 'COLR' v1
+ * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
+ *
+ * @fields:
+ * stop_offset ::
+ * The stop offset along the gradient, expressed as a 16.16 fixed-point
+ * coordinate.
+ *
+ * color ::
+ * The color information for this stop, see @FT_ColorIndex.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_ColorStop_
+ {
+ FT_Fixed stop_offset;
+ FT_ColorIndex color;
+
+ } FT_ColorStop;
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_PaintExtend
+ *
+ * @description:
+ * An enumeration representing the 'Extend' mode of the 'COLR' v1
+ * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
+ * It describes how the gradient fill continues at the other boundaries.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef enum FT_PaintExtend_
+ {
+ FT_COLR_PAINT_EXTEND_PAD = 0,
+ FT_COLR_PAINT_EXTEND_REPEAT = 1,
+ FT_COLR_PAINT_EXTEND_REFLECT = 2
+
+ } FT_PaintExtend;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_ColorLine
+ *
+ * @description:
+ * A structure representing a `ColorLine` value of the 'COLR' v1
+ * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
+ * It describes a list of color stops along the defined gradient.
+ *
+ * @fields:
+ * extend ::
+ * The extend mode at the outer boundaries, see @FT_PaintExtend.
+ *
+ * color_stop_iterator ::
+ * The @FT_ColorStopIterator used to enumerate and retrieve the
+ * actual @FT_ColorStop's.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_ColorLine_
+ {
+ FT_PaintExtend extend;
+ FT_ColorStopIterator color_stop_iterator;
+
+ } FT_ColorLine;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_Affine23
+ *
+ * @description:
+ * A structure used to store a 2x3 matrix. Coefficients are in
+ * 16.16 fixed-point format. The computation performed is
+ *
+ * ```
+ * x' = x*xx + y*xy + dx
+ * y' = x*yx + y*yy + dy
+ * ```
+ *
+ * @fields:
+ * xx ::
+ * Matrix coefficient.
+ *
+ * xy ::
+ * Matrix coefficient.
+ *
+ * dx ::
+ * x translation.
+ *
+ * yx ::
+ * Matrix coefficient.
+ *
+ * yy ::
+ * Matrix coefficient.
+ *
+ * dy ::
+ * y translation.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_Affine_23_
+ {
+ FT_Fixed xx, xy, dx;
+ FT_Fixed yx, yy, dy;
+
+ } FT_Affine23;
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_Composite_Mode
+ *
+ * @description:
+ * An enumeration listing the 'COLR' v1 composite modes used in
+ * @FT_PaintComposite. For more details on each paint mode, see
+ * 'https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators'.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef enum FT_Composite_Mode_
+ {
+ FT_COLR_COMPOSITE_CLEAR = 0,
+ FT_COLR_COMPOSITE_SRC = 1,
+ FT_COLR_COMPOSITE_DEST = 2,
+ FT_COLR_COMPOSITE_SRC_OVER = 3,
+ FT_COLR_COMPOSITE_DEST_OVER = 4,
+ FT_COLR_COMPOSITE_SRC_IN = 5,
+ FT_COLR_COMPOSITE_DEST_IN = 6,
+ FT_COLR_COMPOSITE_SRC_OUT = 7,
+ FT_COLR_COMPOSITE_DEST_OUT = 8,
+ FT_COLR_COMPOSITE_SRC_ATOP = 9,
+ FT_COLR_COMPOSITE_DEST_ATOP = 10,
+ FT_COLR_COMPOSITE_XOR = 11,
+ FT_COLR_COMPOSITE_PLUS = 12,
+ FT_COLR_COMPOSITE_SCREEN = 13,
+ FT_COLR_COMPOSITE_OVERLAY = 14,
+ FT_COLR_COMPOSITE_DARKEN = 15,
+ FT_COLR_COMPOSITE_LIGHTEN = 16,
+ FT_COLR_COMPOSITE_COLOR_DODGE = 17,
+ FT_COLR_COMPOSITE_COLOR_BURN = 18,
+ FT_COLR_COMPOSITE_HARD_LIGHT = 19,
+ FT_COLR_COMPOSITE_SOFT_LIGHT = 20,
+ FT_COLR_COMPOSITE_DIFFERENCE = 21,
+ FT_COLR_COMPOSITE_EXCLUSION = 22,
+ FT_COLR_COMPOSITE_MULTIPLY = 23,
+ FT_COLR_COMPOSITE_HSL_HUE = 24,
+ FT_COLR_COMPOSITE_HSL_SATURATION = 25,
+ FT_COLR_COMPOSITE_HSL_COLOR = 26,
+ FT_COLR_COMPOSITE_HSL_LUMINOSITY = 27,
+ FT_COLR_COMPOSITE_MAX = 28
+
+ } FT_Composite_Mode;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_OpaquePaint
+ *
+ * @description:
+ * A structure representing an offset to a `Paint` value stored in any
+ * of the paint tables of a 'COLR' v1 font. Compare Offset<24> there.
+ * When 'COLR' v1 paint tables represented by FreeType objects such as
+ * @FT_PaintColrLayers, @FT_PaintComposite, or @FT_PaintTransform
+ * reference downstream nested paint tables, we do not immediately
+ * retrieve them but encapsulate their location in this type. Use
+ * @FT_Get_Paint to retrieve the actual @FT_COLR_Paint object that
+ * describes the details of the respective paint table.
+ *
+ * @fields:
+ * p ::
+ * An internal offset to a Paint table, needs to be set to NULL before
+ * passing this struct as an argument to @FT_Get_Paint.
+ *
+ * insert_root_transform ::
+ * An internal boolean to track whether an initial root transform is
+ * to be provided. Do not set this value.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_Opaque_Paint_
+ {
+ FT_Byte* p;
+ FT_Bool insert_root_transform;
+ } FT_OpaquePaint;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintColrLayers
+ *
+ * @description:
+ * A structure representing a `PaintColrLayers` table of a 'COLR' v1
+ * font. This table describes a set of layers that are to be composited
+ * with composite mode `FT_COLR_COMPOSITE_SRC_OVER`. The return value
+ * of this function is an @FT_LayerIterator initialized so that it can
+ * be used with @FT_Get_Paint_Layers to retrieve the @FT_OpaquePaint
+ * objects as references to each layer.
+ *
+ * @fields:
+ * layer_iterator ::
+ * The layer iterator that describes the layers of this paint.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintColrLayers_
+ {
+ FT_LayerIterator layer_iterator;
+
+ } FT_PaintColrLayers;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintSolid
+ *
+ * @description:
+ * A structure representing a `PaintSolid` value of the 'COLR' v1
+ * extensions, see 'https://github.com/googlefonts/colr-gradients-spec'.
+ * Using a `PaintSolid` value means that the glyph layer filled with
+ * this paint is solid-colored and does not contain a gradient.
+ *
+ * @fields:
+ * color ::
+ * The color information for this solid paint, see @FT_ColorIndex.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintSolid_
+ {
+ FT_ColorIndex color;
+
+ } FT_PaintSolid;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintLinearGradient
+ *
+ * @description:
+ * A structure representing a `PaintLinearGradient` value of the 'COLR'
+ * v1 extensions, see
+ * 'https://github.com/googlefonts/colr-gradients-spec'. The glyph
+ * layer filled with this paint is drawn filled with a linear gradient.
+ *
+ * @fields:
+ * colorline ::
+ * The @FT_ColorLine information for this paint, i.e., the list of
+ * color stops along the gradient.
+ *
+ * p0 ::
+ * The starting point of the gradient definition in font units
+ * represented as a 16.16 fixed-point `FT_Vector`.
+ *
+ * p1 ::
+ * The end point of the gradient definition in font units
+ * represented as a 16.16 fixed-point `FT_Vector`.
+ *
+ * p2 ::
+ * Optional point~p2 to rotate the gradient in font units
+ * represented as a 16.16 fixed-point `FT_Vector`.
+ * Otherwise equal to~p0.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintLinearGradient_
+ {
+ FT_ColorLine colorline;
+
+ /* TODO: Potentially expose those as x0, y0 etc. */
+ FT_Vector p0;
+ FT_Vector p1;
+ FT_Vector p2;
+
+ } FT_PaintLinearGradient;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintRadialGradient
+ *
+ * @description:
+ * A structure representing a `PaintRadialGradient` value of the 'COLR'
+ * v1 extensions, see
+ * 'https://github.com/googlefonts/colr-gradients-spec'. The glyph
+ * layer filled with this paint is drawn filled with a radial gradient.
+ *
+ * @fields:
+ * colorline ::
+ * The @FT_ColorLine information for this paint, i.e., the list of
+ * color stops along the gradient.
+ *
+ * c0 ::
+ * The center of the starting point of the radial gradient in font
+ * units represented as a 16.16 fixed-point `FT_Vector`.
+ *
+ * r0 ::
+ * The radius of the starting circle of the radial gradient in font
+ * units represented as a 16.16 fixed-point value.
+ *
+ * c1 ::
+ * The center of the end point of the radial gradient in font units
+ * represented as a 16.16 fixed-point `FT_Vector`.
+ *
+ * r1 ::
+ * The radius of the end circle of the radial gradient in font
+ * units represented as a 16.16 fixed-point value.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintRadialGradient_
+ {
+ FT_ColorLine colorline;
+
+ FT_Vector c0;
+ FT_Pos r0;
+ FT_Vector c1;
+ FT_Pos r1;
+
+ } FT_PaintRadialGradient;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintSweepGradient
+ *
+ * @description:
+ * A structure representing a `PaintSweepGradient` value of the 'COLR'
+ * v1 extensions, see
+ * 'https://github.com/googlefonts/colr-gradients-spec'. The glyph
+ * layer filled with this paint is drawn filled with a sweep gradient
+ * from `start_angle` to `end_angle`.
+ *
+ * @fields:
+ * colorline ::
+ * The @FT_ColorLine information for this paint, i.e., the list of
+ * color stops along the gradient.
+ *
+ * center ::
+ * The center of the sweep gradient in font units represented as a
+ * vector of 16.16 fixed-point values.
+ *
+ * start_angle ::
+ * The start angle of the sweep gradient in 16.16 fixed-point
+ * format specifying degrees divided by 180.0 (as in the
+ * spec). Multiply by 180.0f to receive degrees value. Values are
+ * given counter-clockwise, starting from the (positive) y~axis.
+ *
+ * end_angle ::
+ * The end angle of the sweep gradient in 16.16 fixed-point
+ * format specifying degrees divided by 180.0 (as in the
+ * spec). Multiply by 180.0f to receive degrees value. Values are
+ * given counter-clockwise, starting from the (positive) y~axis.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintSweepGradient_
+ {
+ FT_ColorLine colorline;
+
+ FT_Vector center;
+ FT_Fixed start_angle;
+ FT_Fixed end_angle;
+
+ } FT_PaintSweepGradient;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintGlyph
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 `PaintGlyph` paint table.
+ *
+ * @fields:
+ * paint ::
+ * An opaque paint object pointing to a `Paint` table that serves as
+ * the fill for the glyph ID.
+ *
+ * glyphID ::
+ * The glyph ID from the 'glyf' table, which serves as the contour
+ * information that is filled with paint.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintGlyph_
+ {
+ FT_OpaquePaint paint;
+ FT_UInt glyphID;
+
+ } FT_PaintGlyph;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintColrGlyph
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 `PaintColorGlyph` paint table.
+ *
+ * @fields:
+ * glyphID ::
+ * The glyph ID from the `BaseGlyphV1List` table that is drawn for
+ * this paint.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintColrGlyph_
+ {
+ FT_UInt glyphID;
+
+ } FT_PaintColrGlyph;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintTransform
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 `PaintTransform` paint table.
+ *
+ * @fields:
+ * paint ::
+ * An opaque paint that is subject to being transformed.
+ *
+ * affine ::
+ * A 2x3 transformation matrix in @FT_Affine23 format containing
+ * 16.16 fixed-point values.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintTransform_
+ {
+ FT_OpaquePaint paint;
+ FT_Affine23 affine;
+
+ } FT_PaintTransform;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintTranslate
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 `PaintTranslate` paint table.
+ * Used for translating downstream paints by a given x and y~delta.
+ *
+ * @fields:
+ * paint ::
+ * An @FT_OpaquePaint object referencing the paint that is to be
+ * rotated.
+ *
+ * dx ::
+ * Translation in x~direction in font units represented as a
+ * 16.16 fixed-point value.
+ *
+ * dy ::
+ * Translation in y~direction in font units represented as a
+ * 16.16 fixed-point value.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintTranslate_
+ {
+ FT_OpaquePaint paint;
+
+ FT_Fixed dx;
+ FT_Fixed dy;
+
+ } FT_PaintTranslate;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintScale
+ *
+ * @description:
+ * A structure representing all of the 'COLR' v1 'PaintScale*' paint
+ * tables. Used for scaling downstream paints by a given x and y~scale,
+ * with a given center. This structure is used for all 'PaintScale*'
+ * types that are part of specification; fields of this structure are
+ * filled accordingly. If there is a center, the center values are set,
+ * otherwise they are set to the zero coordinate. If the source font
+ * file has 'PaintScaleUniform*' set, the scale values are set
+ * accordingly to the same value.
+ *
+ * @fields:
+ * paint ::
+ * An @FT_OpaquePaint object referencing the paint that is to be
+ * scaled.
+ *
+ * scale_x ::
+ * Scale factor in x~direction represented as a
+ * 16.16 fixed-point value.
+ *
+ * scale_y ::
+ * Scale factor in y~direction represented as a
+ * 16.16 fixed-point value.
+ *
+ * center_x ::
+ * x~coordinate of center point to scale from represented as a
+ * 16.16 fixed-point value.
+ *
+ * center_y ::
+ * y~coordinate of center point to scale from represented as a
+ * 16.16 fixed-point value.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintScale_
+ {
+ FT_OpaquePaint paint;
+
+ FT_Fixed scale_x;
+ FT_Fixed scale_y;
+
+ FT_Fixed center_x;
+ FT_Fixed center_y;
+
+ } FT_PaintScale;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintRotate
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 `PaintRotate` paint table. Used
+ * for rotating downstream paints with a given center and angle.
+ *
+ * @fields:
+ * paint ::
+ * An @FT_OpaquePaint object referencing the paint that is to be
+ * rotated.
+ *
+ * angle ::
+ * The rotation angle that is to be applied in degrees divided by
+ * 180.0 (as in the spec) represented as a 16.16 fixed-point
+ * value. Multiply by 180.0f to receive degrees value.
+ *
+ * center_x ::
+ * The x~coordinate of the pivot point of the rotation in font
+ * units represented as a 16.16 fixed-point value.
+ *
+ * center_y ::
+ * The y~coordinate of the pivot point of the rotation in font
+ * units represented as a 16.16 fixed-point value.
+ *
+ * @since:
+ * 2.13
+ */
+
+ typedef struct FT_PaintRotate_
+ {
+ FT_OpaquePaint paint;
+
+ FT_Fixed angle;
+
+ FT_Fixed center_x;
+ FT_Fixed center_y;
+
+ } FT_PaintRotate;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintSkew
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 `PaintSkew` paint table. Used
+ * for skewing or shearing downstream paints by a given center and
+ * angle.
+ *
+ * @fields:
+ * paint ::
+ * An @FT_OpaquePaint object referencing the paint that is to be
+ * skewed.
+ *
+ * x_skew_angle ::
+ * The skewing angle in x~direction in degrees divided by 180.0
+ * (as in the spec) represented as a 16.16 fixed-point
+ * value. Multiply by 180.0f to receive degrees.
+ *
+ * y_skew_angle ::
+ * The skewing angle in y~direction in degrees divided by 180.0
+ * (as in the spec) represented as a 16.16 fixed-point
+ * value. Multiply by 180.0f to receive degrees.
+ *
+ * center_x ::
+ * The x~coordinate of the pivot point of the skew in font units
+ * represented as a 16.16 fixed-point value.
+ *
+ * center_y ::
+ * The y~coordinate of the pivot point of the skew in font units
+ * represented as a 16.16 fixed-point value.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintSkew_
+ {
+ FT_OpaquePaint paint;
+
+ FT_Fixed x_skew_angle;
+ FT_Fixed y_skew_angle;
+
+ FT_Fixed center_x;
+ FT_Fixed center_y;
+
+ } FT_PaintSkew;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_PaintComposite
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 `PaintComposite` paint table.
+ * Used for compositing two paints in a 'COLR' v1 directed acyclic graph.
+ *
+ * @fields:
+ * source_paint ::
+ * An @FT_OpaquePaint object referencing the source that is to be
+ * composited.
+ *
+ * composite_mode ::
+ * An @FT_Composite_Mode enum value determining the composition
+ * operation.
+ *
+ * backdrop_paint ::
+ * An @FT_OpaquePaint object referencing the backdrop paint that
+ * `source_paint` is composited onto.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_PaintComposite_
+ {
+ FT_OpaquePaint source_paint;
+ FT_Composite_Mode composite_mode;
+ FT_OpaquePaint backdrop_paint;
+
+ } FT_PaintComposite;
+
+
+ /**************************************************************************
+ *
+ * @union:
+ * FT_COLR_Paint
+ *
+ * @description:
+ * A union object representing format and details of a paint table of a
+ * 'COLR' v1 font, see
+ * 'https://github.com/googlefonts/colr-gradients-spec'. Use
+ * @FT_Get_Paint to retrieve a @FT_COLR_Paint for an @FT_OpaquePaint
+ * object.
+ *
+ * @fields:
+ * format ::
+ * The gradient format for this Paint structure.
+ *
+ * u ::
+ * Union of all paint table types:
+ *
+ * * @FT_PaintColrLayers
+ * * @FT_PaintGlyph
+ * * @FT_PaintSolid
+ * * @FT_PaintLinearGradient
+ * * @FT_PaintRadialGradient
+ * * @FT_PaintSweepGradient
+ * * @FT_PaintTransform
+ * * @FT_PaintTranslate
+ * * @FT_PaintRotate
+ * * @FT_PaintSkew
+ * * @FT_PaintComposite
+ * * @FT_PaintColrGlyph
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_COLR_Paint_
+ {
+ FT_PaintFormat format;
+
+ union
+ {
+ FT_PaintColrLayers colr_layers;
+ FT_PaintGlyph glyph;
+ FT_PaintSolid solid;
+ FT_PaintLinearGradient linear_gradient;
+ FT_PaintRadialGradient radial_gradient;
+ FT_PaintSweepGradient sweep_gradient;
+ FT_PaintTransform transform;
+ FT_PaintTranslate translate;
+ FT_PaintScale scale;
+ FT_PaintRotate rotate;
+ FT_PaintSkew skew;
+ FT_PaintComposite composite;
+ FT_PaintColrGlyph colr_glyph;
+
+ } u;
+
+ } FT_COLR_Paint;
+
+
+ /**************************************************************************
+ *
+ * @enum:
+ * FT_Color_Root_Transform
+ *
+ * @description:
+ * An enumeration to specify whether @FT_Get_Color_Glyph_Paint is to
+ * return a root transform to configure the client's graphics context
+ * matrix.
+ *
+ * @values:
+ * FT_COLOR_INCLUDE_ROOT_TRANSFORM ::
+ * Do include the root transform as the initial @FT_COLR_Paint object.
+ *
+ * FT_COLOR_NO_ROOT_TRANSFORM ::
+ * Do not output an initial root transform.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef enum FT_Color_Root_Transform_
+ {
+ FT_COLOR_INCLUDE_ROOT_TRANSFORM,
+ FT_COLOR_NO_ROOT_TRANSFORM,
+
+ FT_COLOR_ROOT_TRANSFORM_MAX
+
+ } FT_Color_Root_Transform;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_ClipBox
+ *
+ * @description:
+ * A structure representing a 'COLR' v1 'ClipBox' table. 'COLR' v1
+ * glyphs may optionally define a clip box for aiding allocation or
+ * defining a maximum drawable region. Use @FT_Get_Color_Glyph_ClipBox
+ * to retrieve it.
+ *
+ * @fields:
+ * bottom_left ::
+ * The bottom left corner of the clip box as an @FT_Vector with
+ * fixed-point coordinates in 26.6 format.
+ *
+ * top_left ::
+ * The top left corner of the clip box as an @FT_Vector with
+ * fixed-point coordinates in 26.6 format.
+ *
+ * top_right ::
+ * The top right corner of the clip box as an @FT_Vector with
+ * fixed-point coordinates in 26.6 format.
+ *
+ * bottom_right ::
+ * The bottom right corner of the clip box as an @FT_Vector with
+ * fixed-point coordinates in 26.6 format.
+ *
+ * @since:
+ * 2.13
+ */
+ typedef struct FT_ClipBox_
+ {
+ FT_Vector bottom_left;
+ FT_Vector top_left;
+ FT_Vector top_right;
+ FT_Vector bottom_right;
+
+ } FT_ClipBox;
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Color_Glyph_Paint
+ *
+ * @description:
+ * This is the starting point and interface to color gradient
+ * information in a 'COLR' v1 table in OpenType fonts to recursively
+ * retrieve the paint tables for the directed acyclic graph of a colored
+ * glyph, given a glyph ID.
+ *
+ * https://github.com/googlefonts/colr-gradients-spec
+ *
+ * In a 'COLR' v1 font, each color glyph defines a directed acyclic
+ * graph of nested paint tables, such as `PaintGlyph`, `PaintSolid`,
+ * `PaintLinearGradient`, `PaintRadialGradient`, and so on. Using this
+ * function and specifying a glyph ID, one retrieves the root paint
+ * table for this glyph ID.
+ *
+ * This function allows control whether an initial root transform is
+ * returned to configure scaling, transform, and translation correctly
+ * on the client's graphics context. The initial root transform is
+ * computed and returned according to the values configured for @FT_Size
+ * and @FT_Set_Transform on the @FT_Face object, see below for details
+ * of the `root_transform` parameter. This has implications for a
+ * client 'COLR' v1 implementation: When this function returns an
+ * initially computed root transform, at the time of executing the
+ * @FT_PaintGlyph operation, the contours should be retrieved using
+ * @FT_Load_Glyph at unscaled, untransformed size. This is because the
+ * root transform applied to the graphics context will take care of
+ * correct scaling.
+ *
+ * Alternatively, to allow hinting of contours, at the time of executing
+ * @FT_Load_Glyph, the current graphics context transformation matrix
+ * can be decomposed into a scaling matrix and a remainder, and
+ * @FT_Load_Glyph can be used to retrieve the contours at scaled size.
+ * Care must then be taken to blit or clip to the graphics context with
+ * taking this remainder transformation into account.
+ *
+ * @input:
+ * face ::
+ * A handle to the parent face object.
+ *
+ * base_glyph ::
+ * The glyph index for which to retrieve the root paint table.
+ *
+ * root_transform ::
+ * Specifies whether an initially computed root is returned by the
+ * @FT_PaintTransform operation to account for the activated size
+ * (see @FT_Activate_Size) and the configured transform and translate
+ * (see @FT_Set_Transform).
+ *
+ * This root transform is returned before nodes of the glyph graph of
+ * the font are returned. Subsequent @FT_COLR_Paint structures
+ * contain unscaled and untransformed values. The inserted root
+ * transform enables the client application to apply an initial
+ * transform to its graphics context. When executing subsequent
+ * FT_COLR_Paint operations, values from @FT_COLR_Paint operations
+ * will ultimately be correctly scaled because of the root transform
+ * applied to the graphics context. Use
+ * @FT_COLOR_INCLUDE_ROOT_TRANSFORM to include the root transform, use
+ * @FT_COLOR_NO_ROOT_TRANSFORM to not include it. The latter may be
+ * useful when traversing the 'COLR' v1 glyph graph and reaching a
+ * @FT_PaintColrGlyph. When recursing into @FT_PaintColrGlyph and
+ * painting that inline, no additional root transform is needed as it
+ * has already been applied to the graphics context at the beginning
+ * of drawing this glyph.
+ *
+ * @output:
+ * paint ::
+ * The @FT_OpaquePaint object that references the actual paint table.
+ *
+ * The respective actual @FT_COLR_Paint object is retrieved via
+ * @FT_Get_Paint.
+ *
+ * @return:
+ * Value~1 if everything is OK. If no color glyph is found, or the root
+ * paint could not be retrieved, value~0 gets returned. In case of an
+ * error, value~0 is returned also.
+ *
+ * @since:
+ * 2.13
+ */
+ FT_EXPORT( FT_Bool )
+ FT_Get_Color_Glyph_Paint( FT_Face face,
+ FT_UInt base_glyph,
+ FT_Color_Root_Transform root_transform,
+ FT_OpaquePaint* paint );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Color_Glyph_ClipBox
+ *
+ * @description:
+ * Search for a 'COLR' v1 clip box for the specified `base_glyph` and
+ * fill the `clip_box` parameter with the 'COLR' v1 'ClipBox' information
+ * if one is found.
+ *
+ * @input:
+ * face ::
+ * A handle to the parent face object.
+ *
+ * base_glyph ::
+ * The glyph index for which to retrieve the clip box.
+ *
+ * @output:
+ * clip_box ::
+ * The clip box for the requested `base_glyph` if one is found. The
+ * clip box is computed taking scale and transformations configured on
+ * the @FT_Face into account. @FT_ClipBox contains @FT_Vector values
+ * in 26.6 format.
+ *
+ * @return:
+ * Value~1 if a clip box is found. If no clip box is found or an error
+ * occured, value~0 is returned.
+ *
+ * @note:
+ * To retrieve the clip box in font units, reset scale to units-per-em
+ * and remove transforms configured using @FT_Set_Transform.
+ *
+ * @since:
+ * 2.13
+ */
+ FT_EXPORT( FT_Bool )
+ FT_Get_Color_Glyph_ClipBox( FT_Face face,
+ FT_UInt base_glyph,
+ FT_ClipBox* clip_box );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Paint_Layers
+ *
+ * @description:
+ * Access the layers of a `PaintColrLayers` table.
+ *
+ * If the root paint of a color glyph, or a nested paint of a 'COLR'
+ * glyph is a `PaintColrLayers` table, this function retrieves the
+ * layers of the `PaintColrLayers` table.
+ *
+ * The @FT_PaintColrLayers object contains an @FT_LayerIterator, which
+ * is used here to iterate over the layers. Each layer is returned as
+ * an @FT_OpaquePaint object, which then can be used with @FT_Get_Paint
+ * to retrieve the actual paint object.
+ *
+ * @input:
+ * face ::
+ * A handle to the parent face object.
+ *
+ * @inout:
+ * iterator ::
+ * The @FT_LayerIterator from an @FT_PaintColrLayers object, for which
+ * the layers are to be retrieved. The internal state of the iterator
+ * is incremented after one call to this function for retrieving one
+ * layer.
+ *
+ * @output:
+ * paint ::
+ * The @FT_OpaquePaint object that references the actual paint table.
+ * The respective actual @FT_COLR_Paint object is retrieved via
+ * @FT_Get_Paint.
+ *
+ * @return:
+ * Value~1 if everything is OK. Value~0 gets returned when the paint
+ * object can not be retrieved or any other error occurs.
+ *
+ * @since:
+ * 2.13
+ */
+ FT_EXPORT( FT_Bool )
+ FT_Get_Paint_Layers( FT_Face face,
+ FT_LayerIterator* iterator,
+ FT_OpaquePaint* paint );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Colorline_Stops
+ *
+ * @description:
+ * This is an interface to color gradient information in a 'COLR' v1
+ * table in OpenType fonts to iteratively retrieve the gradient and
+ * solid fill information for colored glyph layers for a specified glyph
+ * ID.
+ *
+ * https://github.com/googlefonts/colr-gradients-spec
+ *
+ * @input:
+ * face ::
+ * A handle to the parent face object.
+ *
+ * @inout:
+ * iterator ::
+ * The retrieved @FT_ColorStopIterator, configured on an @FT_ColorLine,
+ * which in turn got retrieved via paint information in
+ * @FT_PaintLinearGradient or @FT_PaintRadialGradient.
+ *
+ * @output:
+ * color_stop ::
+ * Color index and alpha value for the retrieved color stop.
+ *
+ * @return:
+ * Value~1 if everything is OK. If there are no more color stops,
+ * value~0 gets returned. In case of an error, value~0 is returned
+ * also.
+ *
+ * @since:
+ * 2.13
+ */
+ FT_EXPORT( FT_Bool )
+ FT_Get_Colorline_Stops( FT_Face face,
+ FT_ColorStop* color_stop,
+ FT_ColorStopIterator* iterator );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Paint
+ *
+ * @description:
+ * Access the details of a paint using an @FT_OpaquePaint opaque paint
+ * object, which internally stores the offset to the respective `Paint`
+ * object in the 'COLR' table.
+ *
+ * @input:
+ * face ::
+ * A handle to the parent face object.
+ *
+ * opaque_paint ::
+ * The opaque paint object for which the underlying @FT_COLR_Paint
+ * data is to be retrieved.
+ *
+ * @output:
+ * paint ::
+ * The specific @FT_COLR_Paint object containing information coming
+ * from one of the font's `Paint*` tables.
+ *
+ * @return:
+ * Value~1 if everything is OK. Value~0 if no details can be found for
+ * this paint or any other error occured.
+ *
+ * @since:
+ * 2.13
+ */
+ FT_EXPORT( FT_Bool )
+ FT_Get_Paint( FT_Face face,
+ FT_OpaquePaint opaque_paint,
+ FT_COLR_Paint* paint );
+
/* */
diff --git a/src/3rdparty/freetype/include/freetype/ftdriver.h b/src/3rdparty/freetype/include/freetype/ftdriver.h
index 804ec34a39..7af7465bc7 100644
--- a/src/3rdparty/freetype/include/freetype/ftdriver.h
+++ b/src/3rdparty/freetype/include/freetype/ftdriver.h
@@ -4,7 +4,7 @@
*
* FreeType API for controlling driver modules (specification only).
*
- * Copyright (C) 2017-2020 by
+ * Copyright (C) 2017-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -53,10 +53,10 @@ FT_BEGIN_HEADER
* reasons.
*
* Available properties are @increase-x-height, @no-stem-darkening
- * (experimental), @darkening-parameters (experimental), @warping
- * (experimental), @glyph-to-script-map (experimental), @fallback-script
- * (experimental), and @default-script (experimental), as documented in
- * the @properties section.
+ * (experimental), @darkening-parameters (experimental),
+ * @glyph-to-script-map (experimental), @fallback-script (experimental),
+ * and @default-script (experimental), as documented in the @properties
+ * section.
*
*/
@@ -84,15 +84,15 @@ FT_BEGIN_HEADER
* @properties section.
*
*
- * **Hinting and antialiasing principles of the new engine**
+ * **Hinting and anti-aliasing principles of the new engine**
*
* The rasterizer is positioning horizontal features (e.g., ascender
* height & x-height, or crossbars) on the pixel grid and minimizing the
- * amount of antialiasing applied to them, while placing vertical
+ * amount of anti-aliasing applied to them, while placing vertical
* features (vertical stems) on the pixel grid without hinting, thus
* representing the stem position and weight accurately. Sometimes the
* vertical stems may be only partially black. In this context,
- * 'antialiasing' means that stems are not positioned exactly on pixel
+ * 'anti-aliasing' means that stems are not positioned exactly on pixel
* borders, causing a fuzzy appearance.
*
* There are two principles behind this approach.
@@ -108,7 +108,7 @@ FT_BEGIN_HEADER
* sizes are comparable to kerning values and thus would be noticeable
* (and distracting) while reading if hinting were applied.
*
- * One of the reasons to not hint horizontally is antialiasing for LCD
+ * One of the reasons to not hint horizontally is anti-aliasing for LCD
* screens: The pixel geometry of modern displays supplies three vertical
* subpixels as the eye moves horizontally across each visible pixel. On
* devices where we can be certain this characteristic is present a
@@ -116,7 +116,7 @@ FT_BEGIN_HEADER
* weight. In Western writing systems this turns out to be the more
* critical direction anyway; the weights and spacing of vertical stems
* (see above) are central to Armenian, Cyrillic, Greek, and Latin type
- * designs. Even when the rasterizer uses greyscale antialiasing instead
+ * designs. Even when the rasterizer uses greyscale anti-aliasing instead
* of color (a necessary compromise when one doesn't know the screen
* characteristics), the unhinted vertical features preserve the design's
* weight and spacing much better than aliased type would.
@@ -134,7 +134,7 @@ FT_BEGIN_HEADER
* each being rounded to the nearest pixel edge, taking care of overshoot
* suppression at small sizes, stem darkening, and scaling.
*
- * Hstems (this is, hint values defined in the font to help align
+ * Hstems (that is, hint values defined in the font to help align
* horizontal features) that fall within a blue zone are said to be
* 'captured' and are aligned to that zone. Uncaptured stems are moved
* in one of four ways, top edge up or down, bottom edge up or down.
@@ -212,16 +212,14 @@ FT_BEGIN_HEADER
* @description:
* While FreeType's TrueType driver doesn't expose API functions by
* itself, it is possible to control its behaviour with @FT_Property_Set
- * and @FT_Property_Get. The following lists the available properties
- * together with the necessary macros and structures.
- *
- * The TrueType driver's module name is 'truetype'.
+ * and @FT_Property_Get.
*
- * A single property @interpreter-version is available, as documented in
- * the @properties section.
+ * The TrueType driver's module name is 'truetype'; a single property
+ * @interpreter-version is available, as documented in the @properties
+ * section.
*
- * We start with a list of definitions, kindly provided by Greg
- * Hitchcock.
+ * To help understand the differences between interpreter versions, we
+ * introduce a list of definitions, kindly provided by Greg Hitchcock.
*
* _Bi-Level Rendering_
*
@@ -303,6 +301,31 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
+ * ot_svg_driver
+ *
+ * @title:
+ * The SVG driver
+ *
+ * @abstract:
+ * Controlling the external rendering of OT-SVG glyphs.
+ *
+ * @description:
+ * By default, FreeType can only load the 'SVG~' table of OpenType fonts
+ * if configuration macro `FT_CONFIG_OPTION_SVG` is defined. To make it
+ * render SVG glyphs, an external SVG rendering library is needed. All
+ * details on the interface between FreeType and the external library
+ * via function hooks can be found in section @svg_fonts.
+ *
+ * The OT-SVG driver's module name is 'ot-svg'; it supports a single
+ * property called @svg-hooks, documented below in the @properties
+ * section.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
* properties
*
* @title:
@@ -362,12 +385,8 @@ FT_BEGIN_HEADER
* The same holds for the Type~1 and CID modules if compiled with
* `T1_CONFIG_OPTION_OLD_ENGINE`.
*
- * For the 'cff' module, the default engine is 'freetype' if
- * `CFF_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe' otherwise.
- *
- * For both the 'type1' and 't1cid' modules, the default engine is
- * 'freetype' if `T1_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe'
- * otherwise.
+ * For the 'cff' module, the default engine is 'adobe'. For both the
+ * 'type1' and 't1cid' modules, the default engine is 'adobe', too.
*
* @note:
* This property can be used with @FT_Property_Get also.
@@ -427,7 +446,7 @@ FT_BEGIN_HEADER
* at smaller sizes.
*
* For the auto-hinter, stem-darkening is experimental currently and thus
- * switched off by default (this is, `no-stem-darkening` is set to TRUE
+ * switched off by default (that is, `no-stem-darkening` is set to TRUE
* by default). Total consistency with the CFF driver is not achieved
* right now because the emboldening method differs and glyphs must be
* scaled down on the Y-axis to keep outline points inside their
@@ -632,11 +651,8 @@ FT_BEGIN_HEADER
* Windows~98; only grayscale and B/W rasterizing is supported.
*
* TT_INTERPRETER_VERSION_38 ::
- * Version~38 corresponds to MS rasterizer v.1.9; it is roughly
- * equivalent to the hinting provided by DirectWrite ClearType (as can
- * be found, for example, in the Internet Explorer~9 running on
- * Windows~7). It is used in FreeType to select the 'Infinality'
- * subpixel hinting code. The code may be removed in a future version.
+ * Version~38 is the same Version~40. The original 'Infinality' code is
+ * no longer available.
*
* TT_INTERPRETER_VERSION_40 ::
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
@@ -801,6 +817,39 @@ FT_BEGIN_HEADER
* 2.5
*/
+ /**************************************************************************
+ *
+ * @property:
+ * svg-hooks
+ *
+ * @description:
+ * Set up the interface between FreeType and an extern SVG rendering
+ * library like 'librsvg'. All details on the function hooks can be
+ * found in section @svg_fonts.
+ *
+ * @example:
+ * The following example code expects that the four hook functions
+ * `svg_*` are defined elsewhere. Error handling is omitted, too.
+ *
+ * ```
+ * FT_Library library;
+ * SVG_RendererHooks hooks = {
+ * (SVG_Lib_Init_Func)svg_init,
+ * (SVG_Lib_Free_Func)svg_free,
+ * (SVG_Lib_Render_Func)svg_render,
+ * (SVG_Lib_Preset_Slot_Func)svg_preset_slot };
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "ot-svg",
+ * "svg-hooks", &hooks );
+ * ```
+ *
+ * @since:
+ * 2.12
+ */
+
/**************************************************************************
*
@@ -1166,48 +1215,18 @@ FT_BEGIN_HEADER
* warping
*
* @description:
- * **Experimental only**
+ * **Obsolete**
*
- * If FreeType gets compiled with option `AF_CONFIG_OPTION_USE_WARPER` to
- * activate the warp hinting code in the auto-hinter, this property
- * switches warping on and off.
+ * This property was always experimental and probably never worked
+ * correctly. It was entirely removed from the FreeType~2 sources. This
+ * entry is only here for historical reference.
*
- * Warping only works in 'normal' auto-hinting mode replacing it. The
- * idea of the code is to slightly scale and shift a glyph along the
+ * Warping only worked in 'normal' auto-hinting mode replacing it. The
+ * idea of the code was to slightly scale and shift a glyph along the
* non-hinted dimension (which is usually the horizontal axis) so that as
- * much of its segments are aligned (more or less) to the grid. To find
+ * much of its segments were aligned (more or less) to the grid. To find
* out a glyph's optimal scaling and shifting value, various parameter
- * combinations are tried and scored.
- *
- * By default, warping is off.
- *
- * @note:
- * This property can be used with @FT_Property_Get also.
- *
- * This property can be set via the `FREETYPE_PROPERTIES` environment
- * variable (using values 1 and 0 for 'on' and 'off', respectively).
- *
- * The warping code can also change advance widths. Have a look at the
- * `lsb_delta` and `rsb_delta` fields in the @FT_GlyphSlotRec structure
- * for details on improving inter-glyph distances while rendering.
- *
- * Since warping is a global property of the auto-hinter it is best to
- * change its value before rendering any face. Otherwise, you should
- * reload all faces that get auto-hinted in 'normal' hinting mode.
- *
- * @example:
- * This example shows how to switch on warping (omitting the error
- * handling).
- *
- * ```
- * FT_Library library;
- * FT_Bool warping = 1;
- *
- *
- * FT_Init_FreeType( &library );
- *
- * FT_Property_Set( library, "autofitter", "warping", &warping );
- * ```
+ * combinations were tried and scored.
*
* @since:
* 2.6
diff --git a/src/3rdparty/freetype/include/freetype/fterrdef.h b/src/3rdparty/freetype/include/freetype/fterrdef.h
index 895d2d4dc8..d59b3cc2da 100644
--- a/src/3rdparty/freetype/include/freetype/fterrdef.h
+++ b/src/3rdparty/freetype/include/freetype/fterrdef.h
@@ -4,7 +4,7 @@
*
* FreeType error codes (specification).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -101,6 +101,8 @@
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
"invalid pixel size" )
+ FT_ERRORDEF_( Invalid_SVG_Document, 0x18,
+ "invalid SVG document" )
/* handle errors */
@@ -234,6 +236,8 @@
"found FDEF or IDEF opcode in glyf bytecode" )
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
"missing bitmap in strike" )
+ FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E,
+ "SVG hooks have not been set" )
/* CFF, CID, and Type 1 errors */
diff --git a/src/3rdparty/freetype/include/freetype/fterrors.h b/src/3rdparty/freetype/include/freetype/fterrors.h
index 60a637c77c..15ef3f76b5 100644
--- a/src/3rdparty/freetype/include/freetype/fterrors.h
+++ b/src/3rdparty/freetype/include/freetype/fterrors.h
@@ -4,7 +4,7 @@
*
* FreeType error code handling (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -29,7 +29,7 @@
*
* @description:
* The header file `fterrors.h` (which is automatically included by
- * `freetype.h` defines the handling of FreeType's enumeration
+ * `freetype.h`) defines the handling of FreeType's enumeration
* constants. It can also be used to generate error message strings
* with a small macro trick explained below.
*
@@ -281,6 +281,8 @@ FT_BEGIN_HEADER
FT_EXPORT( const char* )
FT_Error_String( FT_Error error_code );
+ /* */
+
FT_END_HEADER
diff --git a/src/3rdparty/freetype/include/freetype/ftfntfmt.h b/src/3rdparty/freetype/include/freetype/ftfntfmt.h
index f803349cd7..c0018fc830 100644
--- a/src/3rdparty/freetype/include/freetype/ftfntfmt.h
+++ b/src/3rdparty/freetype/include/freetype/ftfntfmt.h
@@ -4,7 +4,7 @@
*
* Support functions for font formats.
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftgasp.h b/src/3rdparty/freetype/include/freetype/ftgasp.h
index 6b76882c74..d5f19add8f 100644
--- a/src/3rdparty/freetype/include/freetype/ftgasp.h
+++ b/src/3rdparty/freetype/include/freetype/ftgasp.h
@@ -4,7 +4,7 @@
*
* Access of TrueType's 'gasp' table (specification).
*
- * Copyright (C) 2007-2020 by
+ * Copyright (C) 2007-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftglyph.h b/src/3rdparty/freetype/include/freetype/ftglyph.h
index 704619e3d0..4658895f7a 100644
--- a/src/3rdparty/freetype/include/freetype/ftglyph.h
+++ b/src/3rdparty/freetype/include/freetype/ftglyph.h
@@ -4,7 +4,7 @@
*
* FreeType convenience functions to handle glyphs (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -126,7 +126,7 @@ FT_BEGIN_HEADER
*
* @description:
* A handle to an object used to model a bitmap glyph image. This is a
- * sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.
+ * 'sub-class' of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.
*/
typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
@@ -142,7 +142,7 @@ FT_BEGIN_HEADER
*
* @fields:
* root ::
- * The root @FT_Glyph fields.
+ * The root fields of @FT_Glyph.
*
* left ::
* The left-side bearing, i.e., the horizontal distance from the
@@ -181,7 +181,7 @@ FT_BEGIN_HEADER
*
* @description:
* A handle to an object used to model an outline glyph image. This is a
- * sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec.
+ * 'sub-class' of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec.
*/
typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
@@ -224,6 +224,92 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @type:
+ * FT_SvgGlyph
+ *
+ * @description:
+ * A handle to an object used to model an SVG glyph. This is a
+ * 'sub-class' of @FT_Glyph, and a pointer to @FT_SvgGlyphRec.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct FT_SvgGlyphRec_* FT_SvgGlyph;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_SvgGlyphRec
+ *
+ * @description:
+ * A structure used for OT-SVG glyphs. This is a 'sub-class' of
+ * @FT_GlyphRec.
+ *
+ * @fields:
+ * root ::
+ * The root @FT_GlyphRec fields.
+ *
+ * svg_document ::
+ * A pointer to the SVG document.
+ *
+ * svg_document_length ::
+ * The length of `svg_document`.
+ *
+ * glyph_index ::
+ * The index of the glyph to be rendered.
+ *
+ * metrics ::
+ * A metrics object storing the size information.
+ *
+ * units_per_EM ::
+ * The size of the EM square.
+ *
+ * start_glyph_id ::
+ * The first glyph ID in the glyph range covered by this document.
+ *
+ * end_glyph_id ::
+ * The last glyph ID in the glyph range covered by this document.
+ *
+ * transform ::
+ * A 2x2 transformation matrix to apply to the glyph while rendering
+ * it.
+ *
+ * delta ::
+ * Translation to apply to the glyph while rendering.
+ *
+ * @note:
+ * The Glyph Management API requires @FT_Glyph or its 'sub-class' to have
+ * all the information needed to completely define the glyph's rendering.
+ * Outline-based glyphs can directly apply transformations to the outline
+ * but this is not possible for an SVG document that hasn't been parsed.
+ * Therefore, the transformation is stored along with the document. In
+ * the absence of a 'ViewBox' or 'Width'/'Height' attribute, the size of
+ * the ViewPort should be assumed to be 'units_per_EM'.
+ */
+ typedef struct FT_SvgGlyphRec_
+ {
+ FT_GlyphRec root;
+
+ FT_Byte* svg_document;
+ FT_ULong svg_document_length;
+
+ FT_UInt glyph_index;
+
+ FT_Size_Metrics metrics;
+ FT_UShort units_per_EM;
+
+ FT_UShort start_glyph_id;
+ FT_UShort end_glyph_id;
+
+ FT_Matrix transform;
+ FT_Vector delta;
+
+ } FT_SvgGlyphRec;
+
+
+ /**************************************************************************
+ *
* @function:
* FT_New_Glyph
*
@@ -269,7 +355,7 @@ FT_BEGIN_HEADER
*
* @output:
* aglyph ::
- * A handle to the glyph object.
+ * A handle to the glyph object. `NULL` in case of error.
*
* @return:
* FreeType error code. 0~means success.
@@ -299,7 +385,7 @@ FT_BEGIN_HEADER
*
* @output:
* target ::
- * A handle to the target glyph object. 0~in case of error.
+ * A handle to the target glyph object. `NULL` in case of error.
*
* @return:
* FreeType error code. 0~means success.
@@ -327,7 +413,7 @@ FT_BEGIN_HEADER
*
* delta ::
* A pointer to a 2d vector to apply. Coordinates are expressed in
- * 1/64th of a pixel.
+ * 1/64 of a pixel.
*
* @return:
* FreeType error code (if not 0, the glyph format is not scalable).
@@ -337,9 +423,9 @@ FT_BEGIN_HEADER
* vector.
*/
FT_EXPORT( FT_Error )
- FT_Glyph_Transform( FT_Glyph glyph,
- FT_Matrix* matrix,
- FT_Vector* delta );
+ FT_Glyph_Transform( FT_Glyph glyph,
+ const FT_Matrix* matrix,
+ const FT_Vector* delta );
/**************************************************************************
@@ -414,7 +500,7 @@ FT_BEGIN_HEADER
* @output:
* acbox ::
* The glyph coordinate bounding box. Coordinates are expressed in
- * 1/64th of pixels if it is grid-fitted.
+ * 1/64 of pixels if it is grid-fitted.
*
* @note:
* Coordinates are relative to the glyph origin, using the y~upwards
@@ -498,9 +584,9 @@ FT_BEGIN_HEADER
* The glyph image is translated with the `origin` vector before
* rendering.
*
- * The first parameter is a pointer to an @FT_Glyph handle, that will be
+ * The first parameter is a pointer to an @FT_Glyph handle that will be
* _replaced_ by this function (with newly allocated data). Typically,
- * you would use (omitting error handling):
+ * you would do something like the following (omitting error handling).
*
* ```
* FT_Glyph glyph;
@@ -517,7 +603,7 @@ FT_BEGIN_HEADER
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
* {
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
- * 0, 1 );
+ * 0, 1 );
* if ( error ) // `glyph' unchanged
* ...
* }
@@ -532,7 +618,7 @@ FT_BEGIN_HEADER
* FT_Done_Glyph( glyph );
* ```
*
- * Here is another example, again without error handling:
+ * Here is another example, again without error handling.
*
* ```
* FT_Glyph glyphs[MAX_GLYPHS]
@@ -569,10 +655,10 @@ FT_BEGIN_HEADER
* ```
*/
FT_EXPORT( FT_Error )
- FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
- FT_Render_Mode render_mode,
- FT_Vector* origin,
- FT_Bool destroy );
+ FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
+ FT_Render_Mode render_mode,
+ const FT_Vector* origin,
+ FT_Bool destroy );
/**************************************************************************
@@ -585,7 +671,7 @@ FT_BEGIN_HEADER
*
* @input:
* glyph ::
- * A handle to the target glyph object.
+ * A handle to the target glyph object. Can be `NULL`.
*/
FT_EXPORT( void )
FT_Done_Glyph( FT_Glyph glyph );
diff --git a/src/3rdparty/freetype/include/freetype/ftgxval.h b/src/3rdparty/freetype/include/freetype/ftgxval.h
index 354460a9a7..e8de9a6ed5 100644
--- a/src/3rdparty/freetype/include/freetype/ftgxval.h
+++ b/src/3rdparty/freetype/include/freetype/ftgxval.h
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* Masatake YAMATO, Redhat K.K,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/src/3rdparty/freetype/include/freetype/ftgzip.h b/src/3rdparty/freetype/include/freetype/ftgzip.h
index ec5939a191..443ec29db1 100644
--- a/src/3rdparty/freetype/include/freetype/ftgzip.h
+++ b/src/3rdparty/freetype/include/freetype/ftgzip.h
@@ -4,7 +4,7 @@
*
* Gzip-compressed stream support.
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftimage.h b/src/3rdparty/freetype/include/freetype/ftimage.h
index 74911620d2..6baa812560 100644
--- a/src/3rdparty/freetype/include/freetype/ftimage.h
+++ b/src/3rdparty/freetype/include/freetype/ftimage.h
@@ -5,7 +5,7 @@
* FreeType glyph image formats and default raster interface
* (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -19,7 +19,7 @@
/**************************************************************************
*
* Note: A 'raster' is simply a scan-line converter, used to render
- * FT_Outlines into FT_Bitmaps.
+ * `FT_Outline`s into `FT_Bitmap`s.
*
*/
@@ -28,11 +28,6 @@
#define FTIMAGE_H_
- /* STANDALONE_ is from ftgrays.c */
-#ifndef STANDALONE_
-#endif
-
-
FT_BEGIN_HEADER
@@ -201,6 +196,11 @@ FT_BEGIN_HEADER
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
+ /* */
+
+ /* For debugging, the @FT_Pixel_Mode enumeration must stay in sync */
+ /* with the `pixel_modes` array in file `ftobjs.c`. */
+
/**************************************************************************
*
@@ -256,6 +256,12 @@ FT_BEGIN_HEADER
* palette ::
* A typeless pointer to the bitmap palette; this field is intended for
* paletted pixel modes. Not used currently.
+ *
+ * @note:
+ * `width` and `rows` refer to the *physical* size of the bitmap, not the
+ * *logical* one. For example, if @FT_Pixel_Mode is set to
+ * `FT_PIXEL_MODE_LCD`, the logical width is a just a third of the
+ * physical one.
*/
typedef struct FT_Bitmap_
{
@@ -401,11 +407,11 @@ FT_BEGIN_HEADER
* information.
*
* FT_OUTLINE_OVERLAP ::
- * This flag indicates that this outline contains overlapping contrours
- * and the anti-aliased renderer should perform oversampling to
- * mitigate possible artifacts. This flag should _not_ be set for
- * well designed glyphs without overlaps because it quadruples the
- * rendering time.
+ * [Since 2.10.3] This flag indicates that this outline contains
+ * overlapping contours and the anti-aliased renderer should perform
+ * oversampling to mitigate possible artifacts. This flag should _not_
+ * be set for well designed glyphs without overlaps because it quadruples
+ * the rendering time.
*
* FT_OUTLINE_HIGH_PRECISION ::
* This flag indicates that the scan-line converter should try to
@@ -695,11 +701,13 @@ FT_BEGIN_HEADER
* to get a simple enumeration without assigning special numbers.
*/
#ifndef FT_IMAGE_TAG
-#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
- value = ( ( (unsigned long)_x1 << 24 ) | \
- ( (unsigned long)_x2 << 16 ) | \
- ( (unsigned long)_x3 << 8 ) | \
- (unsigned long)_x4 )
+
+#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
+ value = ( ( FT_STATIC_BYTE_CAST( unsigned long, _x1 ) << 24 ) | \
+ ( FT_STATIC_BYTE_CAST( unsigned long, _x2 ) << 16 ) | \
+ ( FT_STATIC_BYTE_CAST( unsigned long, _x3 ) << 8 ) | \
+ FT_STATIC_BYTE_CAST( unsigned long, _x4 ) )
+
#endif /* FT_IMAGE_TAG */
@@ -739,6 +747,10 @@ FT_BEGIN_HEADER
* contours. Some Type~1 fonts, like those in the Hershey family,
* contain glyphs in this format. These are described as @FT_Outline,
* but FreeType isn't currently capable of rendering them correctly.
+ *
+ * FT_GLYPH_FORMAT_SVG ::
+ * [Since 2.12] The glyph is represented by an SVG document in the
+ * 'SVG~' table.
*/
typedef enum FT_Glyph_Format_
{
@@ -747,7 +759,8 @@ FT_BEGIN_HEADER
FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
- FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_SVG, 'S', 'V', 'G', ' ' )
} FT_Glyph_Format;
@@ -772,17 +785,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
- /**************************************************************************
- *
- * A raster is a scan converter, in charge of rendering an outline into a
- * bitmap. This section contains the public API for rasters.
- *
- * Note that in FreeType 2, all rasters are now encapsulated within
- * specific modules called 'renderers'. See `ftrender.h` for more details
- * on renderers.
- *
- */
-
/**************************************************************************
*
@@ -796,16 +798,35 @@ FT_BEGIN_HEADER
* How vectorial outlines are converted into bitmaps and pixmaps.
*
* @description:
- * This section contains technical definitions.
+ * A raster or a rasterizer is a scan converter in charge of producing a
+ * pixel coverage bitmap that can be used as an alpha channel when
+ * compositing a glyph with a background. FreeType comes with two
+ * rasterizers: bilevel `raster1` and anti-aliased `smooth` are two
+ * separate modules. They are usually called from the high-level
+ * @FT_Load_Glyph or @FT_Render_Glyph functions and produce the entire
+ * coverage bitmap at once, while staying largely invisible to users.
+ *
+ * Instead of working with complete coverage bitmaps, it is also possible
+ * to intercept consecutive pixel runs on the same scanline with the same
+ * coverage, called _spans_, and process them individually. Only the
+ * `smooth` rasterizer permits this when calling @FT_Outline_Render with
+ * @FT_Raster_Params as described below.
+ *
+ * Working with either complete bitmaps or spans it is important to think
+ * of them as colorless coverage objects suitable as alpha channels to
+ * blend arbitrary colors with a background. For best results, it is
+ * recommended to use gamma correction, too.
+ *
+ * This section also describes the public API needed to set up alternative
+ * @FT_Renderer modules.
*
* @order:
- * FT_Raster
* FT_Span
* FT_SpanFunc
- *
* FT_Raster_Params
* FT_RASTER_FLAG_XXX
*
+ * FT_Raster
* FT_Raster_NewFunc
* FT_Raster_DoneFunc
* FT_Raster_ResetFunc
@@ -818,24 +839,12 @@ FT_BEGIN_HEADER
/**************************************************************************
*
- * @type:
- * FT_Raster
- *
- * @description:
- * An opaque handle (pointer) to a raster object. Each object can be
- * used independently to convert an outline into a bitmap or pixmap.
- */
- typedef struct FT_RasterRec_* FT_Raster;
-
-
- /**************************************************************************
- *
* @struct:
* FT_Span
*
* @description:
- * A structure used to model a single span of gray pixels when rendering
- * an anti-aliased bitmap.
+ * A structure to model a single span of consecutive pixels when
+ * rendering an anti-aliased bitmap.
*
* @fields:
* x ::
@@ -852,8 +861,8 @@ FT_BEGIN_HEADER
* This structure is used by the span drawing callback type named
* @FT_SpanFunc that takes the y~coordinate of the span as a parameter.
*
- * The coverage value is always between 0 and 255. If you want less gray
- * values, the callback function has to reduce them.
+ * The anti-aliased rasterizer produces coverage values from 0 to 255,
+ * that is, from completely transparent to completely opaque.
*/
typedef struct FT_Span_
{
@@ -871,8 +880,8 @@ FT_BEGIN_HEADER
*
* @description:
* A function used as a call-back by the anti-aliased renderer in order
- * to let client applications draw themselves the gray pixel spans on
- * each scan line.
+ * to let client applications draw themselves the pixel spans on each
+ * scan line.
*
* @input:
* y ::
@@ -888,11 +897,12 @@ FT_BEGIN_HEADER
* User-supplied data that is passed to the callback.
*
* @note:
- * This callback allows client applications to directly render the gray
- * spans of the anti-aliased bitmap to any kind of surfaces.
+ * This callback allows client applications to directly render the spans
+ * of the anti-aliased bitmap to any kind of surfaces.
*
* This can be used to write anti-aliased outlines directly to a given
- * background bitmap, and even perform translucency.
+ * background bitmap using alpha compositing. It can also be used for
+ * oversampling and averaging.
*/
typedef void
(*FT_SpanFunc)( int y,
@@ -962,11 +972,17 @@ FT_BEGIN_HEADER
* will be clipped to a box specified in the `clip_box` field of the
* @FT_Raster_Params structure. Otherwise, the `clip_box` is
* effectively set to the bounding box and all spans are generated.
+ *
+ * FT_RASTER_FLAG_SDF ::
+ * This flag is set to indicate that a signed distance field glyph
+ * image should be generated. This is only used while rendering with
+ * the @FT_RENDER_MODE_SDF render mode.
*/
#define FT_RASTER_FLAG_DEFAULT 0x0
#define FT_RASTER_FLAG_AA 0x1
#define FT_RASTER_FLAG_DIRECT 0x2
#define FT_RASTER_FLAG_CLIP 0x4
+#define FT_RASTER_FLAG_SDF 0x8
/* these constants are deprecated; use the corresponding */
/* `FT_RASTER_FLAG_XXX` values instead */
@@ -1049,6 +1065,23 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @type:
+ * FT_Raster
+ *
+ * @description:
+ * An opaque handle (pointer) to a raster object. Each object can be
+ * used independently to convert an outline into a bitmap or pixmap.
+ *
+ * @note:
+ * In FreeType 2, all rasters are now encapsulated within specific
+ * @FT_Renderer modules and only used in their context.
+ *
+ */
+ typedef struct FT_RasterRec_* FT_Raster;
+
+
+ /**************************************************************************
+ *
* @functype:
* FT_Raster_NewFunc
*
diff --git a/src/3rdparty/freetype/include/freetype/ftincrem.h b/src/3rdparty/freetype/include/freetype/ftincrem.h
index f67655eda0..2d4f5def24 100644
--- a/src/3rdparty/freetype/include/freetype/ftincrem.h
+++ b/src/3rdparty/freetype/include/freetype/ftincrem.h
@@ -4,7 +4,7 @@
*
* FreeType incremental loading (specification).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -213,9 +213,14 @@ FT_BEGIN_HEADER
*
* @description:
* A function used to retrieve the basic metrics of a given glyph index
- * before accessing its data. This is necessary because, in certain
- * formats like TrueType, the metrics are stored in a different place
- * from the glyph images proper.
+ * before accessing its data. This allows for handling font types such
+ * as PCL~XL Format~1, Class~2 downloaded TrueType fonts, where the glyph
+ * metrics (`hmtx` and `vmtx` tables) are permitted to be omitted from
+ * the font, and the relevant metrics included in the header of the glyph
+ * outline data. Importantly, this is not intended to allow custom glyph
+ * metrics (for example, Postscript Metrics dictionaries), because that
+ * conflicts with the requirements of outline hinting. Such custom
+ * metrics must be handled separately, by the calling application.
*
* @input:
* incremental ::
@@ -235,7 +240,7 @@ FT_BEGIN_HEADER
*
* @output:
* ametrics ::
- * The replacement glyph metrics in font units.
+ * The glyph metrics in font units.
*
*/
typedef FT_Error
@@ -264,7 +269,7 @@ FT_BEGIN_HEADER
*
* get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does not
- * provide overriding glyph metrics.
+ * require it.
*
*/
typedef struct FT_Incremental_FuncsRec_
diff --git a/src/3rdparty/freetype/include/freetype/ftlcdfil.h b/src/3rdparty/freetype/include/freetype/ftlcdfil.h
index c6995f2ff7..d3723e16f6 100644
--- a/src/3rdparty/freetype/include/freetype/ftlcdfil.h
+++ b/src/3rdparty/freetype/include/freetype/ftlcdfil.h
@@ -5,7 +5,7 @@
* FreeType API for color filtering of subpixel bitmap glyphs
* (specification).
*
- * Copyright (C) 2006-2020 by
+ * Copyright (C) 2006-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -44,7 +44,7 @@ FT_BEGIN_HEADER
* API to control subpixel rendering.
*
* @description:
- * FreeType provides two alternative subpixel rendering technologies.
+ * FreeType provides two alternative subpixel rendering technologies.
* Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
* `ftoption.h` file, this enables ClearType-style rendering.
* Otherwise, Harmony LCD rendering is enabled. These technologies are
@@ -55,13 +55,12 @@ FT_BEGIN_HEADER
* ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of
* the stripe (usually horizontal RGB) by a factor of~3. Using the
- * subpixels coverages unfiltered can create severe color fringes
+ * subpixel coverages unfiltered can create severe color fringes
* especially when rendering thin features. Indeed, to produce
* black-on-white text, the nearby color subpixels must be dimmed
- * equally.
- *
- * A good 5-tap FIR filter should be applied to subpixel coverages
- * regardless of pixel boundaries and should have these properties:
+ * evenly. Therefore, an equalizing 5-tap FIR filter should be applied
+ * to subpixel coverages regardless of pixel boundaries and should have
+ * these properties:
*
* 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
* any shifts in appearance.
@@ -84,7 +83,7 @@ FT_BEGIN_HEADER
* Harmony LCD rendering is suitable to panels with any regular subpixel
* structure, not just monitors with 3 color striped subpixels, as long
* as the color subpixels have fixed positions relative to the pixel
- * center. In this case, each color channel is then rendered separately
+ * center. In this case, each color channel can be rendered separately
* after shifting the outline opposite to the subpixel shift so that the
* coverage maps are aligned. This method is immune to color fringes
* because the shifts do not change integral coverage.
@@ -101,9 +100,9 @@ FT_BEGIN_HEADER
* clockwise. Harmony with default LCD geometry is equivalent to
* ClearType with light filter.
*
- * As a result of ClearType filtering or Harmony rendering, the
- * dimensions of LCD bitmaps can be either wider or taller than the
- * dimensions of the corresponding outline with regard to the pixel grid.
+ * As a result of ClearType filtering or Harmony shifts, the resulting
+ * dimensions of LCD bitmaps can be slightly wider or taller than the
+ * dimensions the original outline with regard to the pixel grid.
* For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
* the left, and 2~subpixels to the right. The bitmap offset values are
* adjusted accordingly, so clients shouldn't need to modify their layout
@@ -138,11 +137,11 @@ FT_BEGIN_HEADER
*
* FT_LCD_FILTER_DEFAULT ::
* This is a beveled, normalized, and color-balanced five-tap filter
- * with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units.
+ * with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256 units.
*
* FT_LCD_FILTER_LIGHT ::
* this is a boxy, normalized, and color-balanced three-tap filter with
- * weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units.
+ * weights of [0x00 0x55 0x56 0x55 0x00] in 1/256 units.
*
* FT_LCD_FILTER_LEGACY ::
* FT_LCD_FILTER_LEGACY1 ::
@@ -227,7 +226,7 @@ FT_BEGIN_HEADER
*
* weights ::
* A pointer to an array; the function copies the first five bytes and
- * uses them to specify the filter weights in 1/256th units.
+ * uses them to specify the filter weights in 1/256 units.
*
* @return:
* FreeType error code. 0~means success.
diff --git a/src/3rdparty/freetype/include/freetype/ftlist.h b/src/3rdparty/freetype/include/freetype/ftlist.h
index 4588922706..b553131335 100644
--- a/src/3rdparty/freetype/include/freetype/ftlist.h
+++ b/src/3rdparty/freetype/include/freetype/ftlist.h
@@ -4,7 +4,7 @@
*
* Generic list support for FreeType (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftlogging.h b/src/3rdparty/freetype/include/freetype/ftlogging.h
new file mode 100644
index 0000000000..53b8b89642
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/ftlogging.h
@@ -0,0 +1,184 @@
+/****************************************************************************
+ *
+ * ftlogging.h
+ *
+ * Additional debugging APIs.
+ *
+ * Copyright (C) 2020-2023 by
+ * David Turner, Robert Wilhelm, and Werner Lemberg.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+#ifndef FTLOGGING_H_
+#define FTLOGGING_H_
+
+
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * debugging_apis
+ *
+ * @title:
+ * External Debugging APIs
+ *
+ * @abstract:
+ * Public APIs to control the `FT_DEBUG_LOGGING` macro.
+ *
+ * @description:
+ * This section contains the declarations of public functions that
+ * enables fine control of what the `FT_DEBUG_LOGGING` macro outputs.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Trace_Set_Level
+ *
+ * @description:
+ * Change the levels of tracing components of FreeType at run time.
+ *
+ * @input:
+ * tracing_level ::
+ * New tracing value.
+ *
+ * @example:
+ * The following call makes FreeType trace everything but the 'memory'
+ * component.
+ *
+ * ```
+ * FT_Trace_Set_Level( "any:7 memory:0" );
+ * ```
+ *
+ * @note:
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
+ *
+ * @since:
+ * 2.11
+ *
+ */
+ FT_EXPORT( void )
+ FT_Trace_Set_Level( const char* tracing_level );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Trace_Set_Default_Level
+ *
+ * @description:
+ * Reset tracing value of FreeType's components to the default value
+ * (i.e., to the value of the `FT2_DEBUG` environment value or to NULL
+ * if `FT2_DEBUG` is not set).
+ *
+ * @note:
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
+ *
+ * @since:
+ * 2.11
+ *
+ */
+ FT_EXPORT( void )
+ FT_Trace_Set_Default_Level( void );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * FT_Custom_Log_Handler
+ *
+ * @description:
+ * A function typedef that is used to handle the logging of tracing and
+ * debug messages on a file system.
+ *
+ * @input:
+ * ft_component ::
+ * The name of `FT_COMPONENT` from which the current debug or error
+ * message is produced.
+ *
+ * fmt ::
+ * Actual debug or tracing message.
+ *
+ * args::
+ * Arguments of debug or tracing messages.
+ *
+ * @since:
+ * 2.11
+ *
+ */
+ typedef void
+ (*FT_Custom_Log_Handler)( const char* ft_component,
+ const char* fmt,
+ va_list args );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Set_Log_Handler
+ *
+ * @description:
+ * A function to set a custom log handler.
+ *
+ * @input:
+ * handler ::
+ * New logging function.
+ *
+ * @note:
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
+ *
+ * @since:
+ * 2.11
+ *
+ */
+ FT_EXPORT( void )
+ FT_Set_Log_Handler( FT_Custom_Log_Handler handler );
+
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Set_Default_Log_Handler
+ *
+ * @description:
+ * A function to undo the effect of @FT_Set_Log_Handler, resetting the
+ * log handler to FreeType's built-in version.
+ *
+ * @note:
+ * This function does nothing if compilation option `FT_DEBUG_LOGGING`
+ * isn't set.
+ *
+ * @since:
+ * 2.11
+ *
+ */
+ FT_EXPORT( void )
+ FT_Set_Default_Log_Handler( void );
+
+ /* */
+
+
+FT_END_HEADER
+
+#endif /* FTLOGGING_H_ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/ftlzw.h b/src/3rdparty/freetype/include/freetype/ftlzw.h
index ae46ad6021..adfd172479 100644
--- a/src/3rdparty/freetype/include/freetype/ftlzw.h
+++ b/src/3rdparty/freetype/include/freetype/ftlzw.h
@@ -4,7 +4,7 @@
*
* LZW-compressed stream support.
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftmac.h b/src/3rdparty/freetype/include/freetype/ftmac.h
index c9de981845..a91e38f9ea 100644
--- a/src/3rdparty/freetype/include/freetype/ftmac.h
+++ b/src/3rdparty/freetype/include/freetype/ftmac.h
@@ -4,7 +4,7 @@
*
* Additional Mac-specific API.
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftmm.h b/src/3rdparty/freetype/include/freetype/ftmm.h
index d8781a8296..d145128a9b 100644
--- a/src/3rdparty/freetype/include/freetype/ftmm.h
+++ b/src/3rdparty/freetype/include/freetype/ftmm.h
@@ -4,7 +4,7 @@
*
* FreeType Multiple Master font interface (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -47,6 +47,9 @@ FT_BEGIN_HEADER
* MM fonts, others will work with all three types. They are similar
* enough that a consistent interface makes sense.
*
+ * For Adobe MM fonts, macro @FT_IS_SFNT returns false. For GX and
+ * OpenType variation fonts, it returns true.
+ *
*/
@@ -150,7 +153,7 @@ FT_BEGIN_HEADER
* @note:
* The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
* for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
- * values are integers.
+ * values are whole numbers (i.e., the fractional part is zero).
*/
typedef struct FT_Var_Axis_
{
@@ -395,6 +398,10 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
+ * The design coordinates are 16.16 fractional values for TrueType GX and
+ * OpenType variation fonts. For Adobe MM fonts, the values are supposed
+ * to be whole numbers (i.e., the fractional part is zero).
+ *
* [Since 2.8.1] To reset all axes to the default values, call the
* function with `num_coords` set to zero and `coords` set to `NULL`.
* [Since 2.9] 'Default values' means the currently selected named
@@ -437,6 +444,11 @@ FT_BEGIN_HEADER
* @return:
* FreeType error code. 0~means success.
*
+ * @note:
+ * The design coordinates are 16.16 fractional values for TrueType GX and
+ * OpenType variation fonts. For Adobe MM fonts, the values are whole
+ * numbers (i.e., the fractional part is zero).
+ *
* @since:
* 2.7.1
*/
@@ -468,9 +480,9 @@ FT_BEGIN_HEADER
* the number of axes, use default values for the remaining axes.
*
* coords ::
- * The design coordinates array (each element must be between 0 and 1.0
- * for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and
- * OpenType variation fonts).
+ * The design coordinates array. Each element is a 16.16 fractional
+ * value and must be between 0 and 1.0 for Adobe MM fonts, and between
+ * -1.0 and 1.0 for TrueType GX and OpenType variation fonts.
*
* @return:
* FreeType error code. 0~means success.
@@ -515,7 +527,7 @@ FT_BEGIN_HEADER
*
* @output:
* coords ::
- * The normalized blend coordinates array.
+ * The normalized blend coordinates array (as 16.16 fractional values).
*
* @return:
* FreeType error code. 0~means success.
@@ -590,10 +602,12 @@ FT_BEGIN_HEADER
*
* @note:
* Adobe Multiple Master fonts limit the number of designs, and thus the
- * length of the weight vector to~16.
+ * length of the weight vector to 16~elements.
*
- * If `len` is zero and `weightvector` is `NULL`, the weight vector array
- * is reset to the default values.
+ * If `len` is larger than zero, this function sets the
+ * @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e.,
+ * @FT_IS_VARIATION will return true). If `len` is zero, this bit flag
+ * is unset and the weight vector array is reset to the default values.
*
* The Adobe documentation also states that the values in the
* WeightVector array must total 1.0 +/-~0.001. In practice this does
@@ -741,6 +755,45 @@ FT_BEGIN_HEADER
FT_Set_Named_Instance( FT_Face face,
FT_UInt instance_index );
+
+ /**************************************************************************
+ *
+ * @function:
+ * FT_Get_Default_Named_Instance
+ *
+ * @description:
+ * Retrieve the index of the default named instance, to be used with
+ * @FT_Set_Named_Instance.
+ *
+ * The default instance of a variation font is that instance for which
+ * the nth axis coordinate is equal to `axis[n].def` (as specified in the
+ * @FT_MM_Var structure), with~n covering all axes.
+ *
+ * FreeType synthesizes a named instance for the default instance if the
+ * font does not contain such an entry.
+ *
+ * @input:
+ * face ::
+ * A handle to the source face.
+ *
+ * @output:
+ * instance_index ::
+ * The index of the default named instance.
+ *
+ * @return:
+ * FreeType error code. 0~means success.
+ *
+ * @note:
+ * For Adobe MM fonts (which don't have named instances) this function
+ * always returns zero for `instance_index`.
+ *
+ * @since:
+ * 2.13.1
+ */
+ FT_EXPORT( FT_Error )
+ FT_Get_Default_Named_Instance( FT_Face face,
+ FT_UInt *instance_index );
+
/* */
diff --git a/src/3rdparty/freetype/include/freetype/ftmodapi.h b/src/3rdparty/freetype/include/freetype/ftmodapi.h
index 3f7ae82bab..c8f0c2c2a4 100644
--- a/src/3rdparty/freetype/include/freetype/ftmodapi.h
+++ b/src/3rdparty/freetype/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
*
* FreeType modules public interface (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -45,10 +45,12 @@ FT_BEGIN_HEADER
*
* @description:
* The definitions below are used to manage modules within FreeType.
- * Modules can be added, upgraded, and removed at runtime. Additionally,
- * some module properties can be controlled also.
+ * Internal and external modules can be added, upgraded, and removed at
+ * runtime. For example, an alternative renderer or proprietary font
+ * driver can be registered and prioritized. Additionally, some module
+ * properties can also be controlled.
*
- * Here is a list of possible values of the `module_name` field in the
+ * Here is a list of existing values of the `module_name` field in the
* @FT_Module_Class structure.
*
* ```
@@ -86,6 +88,7 @@ FT_BEGIN_HEADER
* FT_Remove_Module
* FT_Add_Default_Modules
*
+ * FT_FACE_DRIVER_NAME
* FT_Property_Set
* FT_Property_Get
* FT_Set_Default_Properties
@@ -330,6 +333,27 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @macro:
+ * FT_FACE_DRIVER_NAME
+ *
+ * @description:
+ * A macro that retrieves the name of a font driver from a face object.
+ *
+ * @note:
+ * The font driver name is a valid `module_name` for @FT_Property_Set
+ * and @FT_Property_Get. This is not the same as @FT_Get_Font_Format.
+ *
+ * @since:
+ * 2.11
+ *
+ */
+#define FT_FACE_DRIVER_NAME( face ) \
+ ( ( *FT_REINTERPRET_CAST( FT_Module_Class**, \
+ ( face )->driver ) )->module_name )
+
+
+ /**************************************************************************
+ *
* @function:
* FT_Property_Set
*
@@ -485,8 +509,7 @@ FT_BEGIN_HEADER
*
* ```
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
- * cff:no-stem-darkening=0 \
- * autofitter:warping=1
+ * cff:no-stem-darkening=0
* ```
*
* @inout:
diff --git a/src/3rdparty/freetype/include/freetype/ftmoderr.h b/src/3rdparty/freetype/include/freetype/ftmoderr.h
index f05fc53aa3..c8c892dcce 100644
--- a/src/3rdparty/freetype/include/freetype/ftmoderr.h
+++ b/src/3rdparty/freetype/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
*
* FreeType module error offsets (specification).
*
- * Copyright (C) 2001-2020 by
+ * Copyright (C) 2001-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -171,6 +171,7 @@
FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
+ FT_MODERRDEF( Sdf, 0x1700, "Signed distance field raster module" )
#ifdef FT_MODERR_END_LIST
diff --git a/src/3rdparty/freetype/include/freetype/ftotval.h b/src/3rdparty/freetype/include/freetype/ftotval.h
index 9c00ad30b9..011bdfc837 100644
--- a/src/3rdparty/freetype/include/freetype/ftotval.h
+++ b/src/3rdparty/freetype/include/freetype/ftotval.h
@@ -4,7 +4,7 @@
*
* FreeType API for validating OpenType tables (specification).
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftoutln.h b/src/3rdparty/freetype/include/freetype/ftoutln.h
index 84e9b144c1..f9329ca40c 100644
--- a/src/3rdparty/freetype/include/freetype/ftoutln.h
+++ b/src/3rdparty/freetype/include/freetype/ftoutln.h
@@ -5,7 +5,7 @@
* Support for the FT_Outline type used to store glyph shapes of
* most scalable font formats (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -109,14 +109,16 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * A contour that contains a single point only is represented by a 'move
- * to' operation followed by 'line to' to the same point. In most cases,
- * it is best to filter this out before using the outline for stroking
- * purposes (otherwise it would result in a visible dot when round caps
- * are used).
+ * Degenerate contours, segments, and Bezier arcs may be reported. In
+ * most cases, it is best to filter these out before using the outline
+ * for stroking or other path modification purposes (which may cause
+ * degenerate segments to become non-degenrate and visible, like when
+ * stroke caps are used or the path is otherwise outset). Some glyph
+ * outlines may contain deliberate degenerate single points for mark
+ * attachement.
*
* Similarly, the function returns success for an empty outline also
- * (doing nothing, this is, not calling any emitter); if necessary, you
+ * (doing nothing, that is, not calling any emitter); if necessary, you
* should filter this out, too.
*/
FT_EXPORT( FT_Error )
diff --git a/src/3rdparty/freetype/include/freetype/ftparams.h b/src/3rdparty/freetype/include/freetype/ftparams.h
index 55ea2a3870..6a9f243bc9 100644
--- a/src/3rdparty/freetype/include/freetype/ftparams.h
+++ b/src/3rdparty/freetype/include/freetype/ftparams.h
@@ -4,7 +4,7 @@
*
* FreeType API for possible FT_Parameter tags (specification only).
*
- * Copyright (C) 2017-2020 by
+ * Copyright (C) 2017-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -115,6 +115,21 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @enum:
+ * FT_PARAM_TAG_IGNORE_SBIX
+ *
+ * @description:
+ * A tag for @FT_Parameter to make @FT_Open_Face ignore an 'sbix' table
+ * while loading a font. Use this if @FT_FACE_FLAG_SBIX is set and you
+ * want to access the outline glyphs in the font.
+ *
+ */
+#define FT_PARAM_TAG_IGNORE_SBIX \
+ FT_MAKE_TAG( 'i', 's', 'b', 'x' )
+
+
+ /**************************************************************************
+ *
+ * @enum:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
diff --git a/src/3rdparty/freetype/include/freetype/ftpfr.h b/src/3rdparty/freetype/include/freetype/ftpfr.h
index 9a5383f918..7111d40a0c 100644
--- a/src/3rdparty/freetype/include/freetype/ftpfr.h
+++ b/src/3rdparty/freetype/include/freetype/ftpfr.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing PFR-specific data (specification only).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -161,7 +161,7 @@ FT_BEGIN_HEADER
*
* @note:
* You can use the `x_scale` or `y_scale` results of @FT_Get_PFR_Metrics
- * to convert the advance to device subpixels (i.e., 1/64th of pixels).
+ * to convert the advance to device subpixels (i.e., 1/64 of pixels).
*/
FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face,
diff --git a/src/3rdparty/freetype/include/freetype/ftrender.h b/src/3rdparty/freetype/include/freetype/ftrender.h
index 8007951b37..0b6fad32e8 100644
--- a/src/3rdparty/freetype/include/freetype/ftrender.h
+++ b/src/3rdparty/freetype/include/freetype/ftrender.h
@@ -4,7 +4,7 @@
*
* FreeType renderer modules public interface (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -158,7 +158,7 @@ FT_BEGIN_HEADER
FT_Renderer_GetCBoxFunc get_glyph_cbox;
FT_Renderer_SetModeFunc set_mode;
- FT_Raster_Funcs* raster_class;
+ const FT_Raster_Funcs* raster_class;
} FT_Renderer_Class;
diff --git a/src/3rdparty/freetype/include/freetype/ftsizes.h b/src/3rdparty/freetype/include/freetype/ftsizes.h
index a8682a30fb..7bfb1aed4c 100644
--- a/src/3rdparty/freetype/include/freetype/ftsizes.h
+++ b/src/3rdparty/freetype/include/freetype/ftsizes.h
@@ -4,7 +4,7 @@
*
* FreeType size objects management (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftsnames.h b/src/3rdparty/freetype/include/freetype/ftsnames.h
index 729e6ab069..9d5d22bb25 100644
--- a/src/3rdparty/freetype/include/freetype/ftsnames.h
+++ b/src/3rdparty/freetype/include/freetype/ftsnames.h
@@ -7,7 +7,7 @@
*
* This is _not_ used to retrieve glyph names!
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/ftstroke.h b/src/3rdparty/freetype/include/freetype/ftstroke.h
index a759c94dde..b3d90802a5 100644
--- a/src/3rdparty/freetype/include/freetype/ftstroke.h
+++ b/src/3rdparty/freetype/include/freetype/ftstroke.h
@@ -4,7 +4,7 @@
*
* FreeType path stroker (specification).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -293,7 +293,7 @@ FT_BEGIN_HEADER
*
* miter_limit ::
* The maximum reciprocal sine of half-angle at the miter join,
- * expressed as 16.16 fixed point value.
+ * expressed as 16.16 fixed-point value.
*
* @note:
* The `radius` is expressed in the same units as the outline
diff --git a/src/3rdparty/freetype/include/freetype/ftsynth.h b/src/3rdparty/freetype/include/freetype/ftsynth.h
index bdb4c5753e..af90967dda 100644
--- a/src/3rdparty/freetype/include/freetype/ftsynth.h
+++ b/src/3rdparty/freetype/include/freetype/ftsynth.h
@@ -5,7 +5,7 @@
* FreeType synthesizing code for emboldening and slanting
* (specification).
*
- * Copyright (C) 2000-2020 by
+ * Copyright (C) 2000-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -68,10 +68,31 @@ FT_BEGIN_HEADER
FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
- /* Slant an outline glyph to the right by about 12 degrees. */
+ /* Precisely adjust the glyph weight either horizontally or vertically. */
+ /* The `xdelta` and `ydelta` values are fractions of the face Em size */
+ /* (in fixed-point format). Considering that a regular face would have */
+ /* stem widths on the order of 0.1 Em, a delta of 0.05 (0x0CCC) should */
+ /* be very noticeable. To increase or decrease the weight, use positive */
+ /* or negative values, respectively. */
+ FT_EXPORT( void )
+ FT_GlyphSlot_AdjustWeight( FT_GlyphSlot slot,
+ FT_Fixed xdelta,
+ FT_Fixed ydelta );
+
+
+ /* Slant an outline glyph to the right by about 12 degrees. */
FT_EXPORT( void )
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
+ /* Slant an outline glyph by a given sine of an angle. You can apply */
+ /* slant along either x- or y-axis by choosing a corresponding non-zero */
+ /* argument. If both slants are non-zero, some affine transformation */
+ /* will result. */
+ FT_EXPORT( void )
+ FT_GlyphSlot_Slant( FT_GlyphSlot slot,
+ FT_Fixed xslant,
+ FT_Fixed yslant );
+
/* */
diff --git a/src/3rdparty/freetype/include/freetype/ftsystem.h b/src/3rdparty/freetype/include/freetype/ftsystem.h
index 22aead7140..3a08f4912c 100644
--- a/src/3rdparty/freetype/include/freetype/ftsystem.h
+++ b/src/3rdparty/freetype/include/freetype/ftsystem.h
@@ -4,7 +4,7 @@
*
* FreeType low-level system interface definition (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -229,7 +229,7 @@ FT_BEGIN_HEADER
* A handle to the source stream.
*
* offset ::
- * The offset of read in stream (always from start).
+ * The offset from the start of the stream to seek to.
*
* buffer ::
* The address of the read buffer.
@@ -238,11 +238,9 @@ FT_BEGIN_HEADER
* The number of bytes to read from the stream.
*
* @return:
- * The number of bytes effectively read by the stream.
- *
- * @note:
- * This function might be called to perform a seek or skip operation with
- * a `count` of~0. A non-zero return value then indicates an error.
+ * If count >~0, return the number of bytes effectively read by the
+ * stream (after seeking to `offset`). If count ==~0, return the status
+ * of the seek operation (non-zero indicates an error).
*
*/
typedef unsigned long
diff --git a/src/3rdparty/freetype/include/freetype/fttrigon.h b/src/3rdparty/freetype/include/freetype/fttrigon.h
index 2ce6b324c9..294981a6f3 100644
--- a/src/3rdparty/freetype/include/freetype/fttrigon.h
+++ b/src/3rdparty/freetype/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
*
* FreeType trigonometric functions (specification).
*
- * Copyright (C) 2001-2020 by
+ * Copyright (C) 2001-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/fttypes.h b/src/3rdparty/freetype/include/freetype/fttypes.h
index aaeb9e8785..5b109f0c73 100644
--- a/src/3rdparty/freetype/include/freetype/fttypes.h
+++ b/src/3rdparty/freetype/include/freetype/fttypes.h
@@ -4,7 +4,7 @@
*
* FreeType simple types definitions (specification only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -45,7 +45,10 @@ FT_BEGIN_HEADER
* @description:
* This section contains the basic data types defined by FreeType~2,
* ranging from simple scalar types to bitmap descriptors. More
- * font-specific structures are defined in a different section.
+ * font-specific structures are defined in a different section. Note
+ * that FreeType does not use floating-point data types. Fractional
+ * values are represented by fixed-point integers, with lower bits
+ * storing the fractional part.
*
* @order:
* FT_Byte
@@ -413,7 +416,7 @@ FT_BEGIN_HEADER
typedef struct FT_Data_
{
const FT_Byte* pointer;
- FT_Int length;
+ FT_UInt length;
} FT_Data;
@@ -479,18 +482,17 @@ FT_BEGIN_HEADER
*
* @description:
* This macro converts four-letter tags that are used to label TrueType
- * tables into an unsigned long, to be used within FreeType.
+ * tables into an `FT_Tag` type, to be used within FreeType.
*
* @note:
* The produced values **must** be 32-bit integers. Don't redefine this
* macro.
*/
-#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
- (FT_Tag) \
- ( ( (FT_ULong)_x1 << 24 ) | \
- ( (FT_ULong)_x2 << 16 ) | \
- ( (FT_ULong)_x3 << 8 ) | \
- (FT_ULong)_x4 )
+#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
+ ( ( FT_STATIC_BYTE_CAST( FT_Tag, _x1 ) << 24 ) | \
+ ( FT_STATIC_BYTE_CAST( FT_Tag, _x2 ) << 16 ) | \
+ ( FT_STATIC_BYTE_CAST( FT_Tag, _x3 ) << 8 ) | \
+ FT_STATIC_BYTE_CAST( FT_Tag, _x4 ) )
/*************************************************************************/
@@ -588,7 +590,7 @@ FT_BEGIN_HEADER
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
-#define FT_BOOL( x ) ( (FT_Bool)( (x) != 0 ) )
+#define FT_BOOL( x ) FT_STATIC_CAST( FT_Bool, (x) != 0 )
/* concatenate C tokens */
#define FT_ERR_XCAT( x, y ) x ## y
diff --git a/src/3rdparty/freetype/include/freetype/ftwinfnt.h b/src/3rdparty/freetype/include/freetype/ftwinfnt.h
index 786528c6ec..7b701ea59b 100644
--- a/src/3rdparty/freetype/include/freetype/ftwinfnt.h
+++ b/src/3rdparty/freetype/include/freetype/ftwinfnt.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing Windows fnt-specific data.
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -55,7 +55,7 @@ FT_BEGIN_HEADER
* FT_WinFNT_ID_XXX
*
* @description:
- * A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
+ * A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
* Exact mapping tables for the various 'cpXXXX' encodings (except for
* 'cp1361') can be found at 'ftp://ftp.unicode.org/Public/' in the
* `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a
diff --git a/src/3rdparty/freetype/include/freetype/internal/autohint.h b/src/3rdparty/freetype/include/freetype/internal/autohint.h
index 2a472e20b9..bf9c8b7cf2 100644
--- a/src/3rdparty/freetype/include/freetype/internal/autohint.h
+++ b/src/3rdparty/freetype/include/freetype/internal/autohint.h
@@ -4,7 +4,7 @@
*
* High-level 'autohint' module-specific interface (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/cffotypes.h b/src/3rdparty/freetype/include/freetype/internal/cffotypes.h
index a316fd1f30..50d5353849 100644
--- a/src/3rdparty/freetype/include/freetype/internal/cffotypes.h
+++ b/src/3rdparty/freetype/include/freetype/internal/cffotypes.h
@@ -4,7 +4,7 @@
*
* Basic OpenType/CFF object type definitions (specification).
*
- * Copyright (C) 2017-2020 by
+ * Copyright (C) 2017-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/cfftypes.h b/src/3rdparty/freetype/include/freetype/internal/cfftypes.h
index f21167b1e5..c2521764ca 100644
--- a/src/3rdparty/freetype/include/freetype/internal/cfftypes.h
+++ b/src/3rdparty/freetype/include/freetype/internal/cfftypes.h
@@ -5,7 +5,7 @@
* Basic OpenType/CFF type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -315,7 +315,7 @@ FT_BEGIN_HEADER
/* The normal stack then points to these values instead of the DICT */
/* because all other operators in Private DICT clear the stack. */
/* `blend_stack' could be cleared at each operator other than blend. */
- /* Blended values are stored as 5-byte fixed point values. */
+ /* Blended values are stored as 5-byte fixed-point values. */
FT_Byte* blend_stack; /* base of stack allocation */
FT_Byte* blend_top; /* first empty slot */
diff --git a/src/3rdparty/freetype/include/freetype/internal/compiler-macros.h b/src/3rdparty/freetype/include/freetype/internal/compiler-macros.h
index 97c18d3a21..6f67650979 100644
--- a/src/3rdparty/freetype/include/freetype/internal/compiler-macros.h
+++ b/src/3rdparty/freetype/include/freetype/internal/compiler-macros.h
@@ -4,7 +4,7 @@
*
* Compiler-specific macro definitions used internally by FreeType.
*
- * Copyright (C) 2020 by
+ * Copyright (C) 2020-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -36,6 +36,22 @@ FT_BEGIN_HEADER
# endif
#endif
+ /* Newer compilers warn for fall-through case statements. */
+#ifndef FALL_THROUGH
+# if ( defined( __STDC_VERSION__ ) && __STDC_VERSION__ > 201710L ) || \
+ ( defined( __cplusplus ) && __cplusplus > 201402L )
+# define FALL_THROUGH [[__fallthrough__]]
+# elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \
+ ( defined( __clang__ ) && \
+ ( defined( __apple_build_version__ ) \
+ ? __apple_build_version__ >= 12000000 \
+ : __clang_major__ >= 10 ) )
+# define FALL_THROUGH __attribute__(( __fallthrough__ ))
+# else
+# define FALL_THROUGH ( (void)0 )
+# endif
+#endif
+
/*
* When defining a macro that expands to a non-trivial C statement, use
* FT_BEGIN_STMNT and FT_END_STMNT to enclose the macro's body. This
@@ -71,12 +87,18 @@ FT_BEGIN_HEADER
*/
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
-#ifdef _WIN64
+#ifdef __UINTPTR_TYPE__
+ /*
+ * GCC and Clang both provide a `__UINTPTR_TYPE__` that can be used to
+ * avoid a dependency on `stdint.h`.
+ */
+# define FT_UINT_TO_POINTER( x ) (void *)(__UINTPTR_TYPE__)(x)
+#elif defined( _WIN64 )
/* only 64bit Windows uses the LLP64 data model, i.e., */
/* 32-bit integers, 64-bit pointers. */
-#define FT_UINT_TO_POINTER( x ) (void *)(unsigned __int64)(x)
+# define FT_UINT_TO_POINTER( x ) (void *)(unsigned __int64)(x)
#else
-#define FT_UINT_TO_POINTER( x ) (void *)(unsigned long)(x)
+# define FT_UINT_TO_POINTER( x ) (void *)(unsigned long)(x)
#endif
/*
@@ -216,79 +238,93 @@ FT_BEGIN_HEADER
#define FT_EXPORT_VAR( x ) FT_FUNCTION_DECLARATION( x )
#endif
- /* When compiling FreeType as a DLL or DSO with hidden visibility, */
- /* some systems/compilers need a special attribute in front OR after */
- /* the return type of function declarations. */
- /* */
- /* Two macros are used within the FreeType source code to define */
- /* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
- /* */
- /* - `FT_EXPORT( return_type )` */
- /* */
- /* is used in a function declaration, as in */
- /* */
- /* ``` */
- /* FT_EXPORT( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ); */
- /* ``` */
- /* */
- /* - `FT_EXPORT_DEF( return_type )` */
- /* */
- /* is used in a function definition, as in */
- /* */
- /* ``` */
- /* FT_EXPORT_DEF( FT_Error ) */
- /* FT_Init_FreeType( FT_Library* alibrary ) */
- /* { */
- /* ... some code ... */
- /* return FT_Err_Ok; */
- /* } */
- /* ``` */
- /* */
- /* You can provide your own implementation of `FT_EXPORT` and */
- /* `FT_EXPORT_DEF` here if you want. */
- /* */
- /* To export a variable, use `FT_EXPORT_VAR`. */
- /* */
-
- /* See `freetype/config/compiler_macros.h` for the `FT_EXPORT` definition */
+ /*
+ * When compiling FreeType as a DLL or DSO with hidden visibility,
+ * some systems/compilers need a special attribute in front OR after
+ * the return type of function declarations.
+ *
+ * Two macros are used within the FreeType source code to define
+ * exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`.
+ *
+ * - `FT_EXPORT( return_type )`
+ *
+ * is used in a function declaration, as in
+ *
+ * ```
+ * FT_EXPORT( FT_Error )
+ * FT_Init_FreeType( FT_Library* alibrary );
+ * ```
+ *
+ * - `FT_EXPORT_DEF( return_type )`
+ *
+ * is used in a function definition, as in
+ *
+ * ```
+ * FT_EXPORT_DEF( FT_Error )
+ * FT_Init_FreeType( FT_Library* alibrary )
+ * {
+ * ... some code ...
+ * return FT_Err_Ok;
+ * }
+ * ```
+ *
+ * You can provide your own implementation of `FT_EXPORT` and
+ * `FT_EXPORT_DEF` here if you want.
+ *
+ * To export a variable, use `FT_EXPORT_VAR`.
+ */
+
+ /* See `freetype/config/public-macros.h` for the `FT_EXPORT` definition */
#define FT_EXPORT_DEF( x ) FT_FUNCTION_DEFINITION( x )
- /* The following macros are needed to compile the library with a */
- /* C++ compiler and with 16bit compilers. */
- /* */
-
- /* This is special. Within C++, you must specify `extern "C"` for */
- /* functions which are used via function pointers, and you also */
- /* must do that for structures which contain function pointers to */
- /* assure C linkage -- it's not possible to have (local) anonymous */
- /* functions which are accessed by (global) function pointers. */
- /* */
- /* */
- /* FT_CALLBACK_DEF is used to _define_ a callback function, */
- /* located in the same source code file as the structure that uses */
- /* it. */
- /* */
- /* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
- /* and define a callback function, respectively, in a similar way */
- /* as FT_BASE and FT_BASE_DEF work. */
- /* */
- /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
- /* contains pointers to callback functions. */
- /* */
- /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
- /* that contains pointers to callback functions. */
- /* */
- /* */
- /* Some 16bit compilers have to redefine these macros to insert */
- /* the infamous `_cdecl` or `__fastcall` declarations. */
- /* */
+ /*
+ * The following macros are needed to compile the library with a
+ * C++ compiler and with 16bit compilers.
+ */
+
+ /*
+ * This is special. Within C++, you must specify `extern "C"` for
+ * functions which are used via function pointers, and you also
+ * must do that for structures which contain function pointers to
+ * assure C linkage -- it's not possible to have (local) anonymous
+ * functions which are accessed by (global) function pointers.
+ *
+ *
+ * FT_CALLBACK_DEF is used to _define_ a callback function,
+ * located in the same source code file as the structure that uses
+ * it. FT_COMPARE_DEF, in addition, ensures the `cdecl` calling
+ * convention on x86, required by the C library function `qsort`.
+ *
+ * FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare
+ * and define a callback function, respectively, in a similar way
+ * as FT_BASE and FT_BASE_DEF work.
+ *
+ * FT_CALLBACK_TABLE is used to _declare_ a constant variable that
+ * contains pointers to callback functions.
+ *
+ * FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable
+ * that contains pointers to callback functions.
+ *
+ *
+ * Some 16bit compilers have to redefine these macros to insert
+ * the infamous `_cdecl` or `__fastcall` declarations.
+ */
#ifdef __cplusplus
#define FT_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_CALLBACK_DEF( x ) static x
#endif
+#if defined( __GNUC__ ) && defined( __i386__ )
+#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __attribute__(( cdecl ))
+#elif defined( _MSC_VER ) && defined( _M_IX86 )
+#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __cdecl
+#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1240
+#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __watcall
+#else
+#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x )
+#endif
+
#define FT_BASE_CALLBACK( x ) FT_FUNCTION_DECLARATION( x )
#define FT_BASE_CALLBACK_DEF( x ) FT_FUNCTION_DEFINITION( x )
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftcalc.h b/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
index c65307472f..d9aea23602 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
*
* Arithmetic computations (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -278,6 +278,40 @@ FT_BEGIN_HEADER
FT_Long c );
+ /**************************************************************************
+ *
+ * @function:
+ * FT_MulAddFix
+ *
+ * @description:
+ * Compute `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`, where `s[n]` is
+ * usually a 16.16 scalar.
+ *
+ * @input:
+ * s ::
+ * The array of scalars.
+ * f ::
+ * The array of factors.
+ * count ::
+ * The number of entries in the array.
+ *
+ * @return:
+ * The result of `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`.
+ *
+ * @note:
+ * This function is currently used for the scaled delta computation of
+ * variation stores. It internally uses 64-bit data types when
+ * available, otherwise it emulates 64-bit math by using 32-bit
+ * operations, which produce a correct result but most likely at a slower
+ * performance in comparison to the implementation base on `int64_t`.
+ *
+ */
+ FT_BASE( FT_Int32 )
+ FT_MulAddFix( FT_Fixed* s,
+ FT_Int32* f,
+ FT_UInt count );
+
+
/*
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
* idea is that both `a' and `b' are scaled by factors of 10 so that the
@@ -298,9 +332,9 @@ FT_BEGIN_HEADER
* Based on geometric considerations we use the following inequality to
* identify a degenerate matrix.
*
- * 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
+ * 32 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
*
- * Value 50 is heuristic.
+ * Value 32 is heuristic.
*/
FT_BASE( FT_Bool )
FT_Matrix_Check( const FT_Matrix* matrix );
@@ -359,8 +393,8 @@ FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
-#if defined( __GNUC__ ) && \
- ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
+#if defined( __clang__ ) || ( defined( __GNUC__ ) && \
+ ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) ) )
#if FT_SIZEOF_INT == 4
@@ -370,12 +404,25 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
-#endif /* __GNUC__ */
+#endif
+#elif defined( _MSC_VER ) && _MSC_VER >= 1400
-#elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
+#if defined( _WIN32_WCE )
-#if FT_SIZEOF_INT == 4
+#include <cmnintrin.h>
+#pragma intrinsic( _CountLeadingZeros )
+
+#define FT_MSB( x ) ( 31 - _CountLeadingZeros( x ) )
+
+#elif defined( _M_ARM64 ) || defined( _M_ARM )
+
+#include <intrin.h>
+#pragma intrinsic( _CountLeadingZeros )
+
+#define FT_MSB( x ) ( 31 - _CountLeadingZeros( x ) )
+
+#elif defined( _M_IX86 ) || defined( _M_AMD64 ) || defined( _M_IA64 )
#include <intrin.h>
#pragma intrinsic( _BitScanReverse )
@@ -391,15 +438,40 @@ FT_BEGIN_HEADER
return (FT_Int32)where;
}
-#define FT_MSB( x ) ( FT_MSB_i386( x ) )
+#define FT_MSB( x ) FT_MSB_i386( x )
#endif
-#endif /* _MSC_VER */
+#elif defined( __WATCOMC__ ) && defined( __386__ )
+
+ extern __inline FT_Int32
+ FT_MSB_i386( FT_UInt32 x );
+#pragma aux FT_MSB_i386 = \
+ "bsr eax, eax" \
+ __parm [__eax] __nomemory \
+ __value [__eax] \
+ __modify __exact [__eax] __nomemory;
+
+#define FT_MSB( x ) FT_MSB_i386( x )
+
+#elif defined( __DECC ) || defined( __DECCXX )
+
+#include <builtins.h>
+
+#define FT_MSB( x ) (FT_Int)( 63 - _leadz( x ) )
+
+#elif defined( _CRAYC )
+
+#include <intrinsics.h>
+
+#define FT_MSB( x ) (FT_Int)( 31 - _leadz32( x ) )
+
+#endif /* FT_MSB macro definitions */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
+
#ifndef FT_MSB
FT_BASE( FT_Int )
@@ -487,7 +559,7 @@ FT_BEGIN_HEADER
#define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
-#ifdef FT_LONG64
+#ifdef FT_INT64
#define ADD_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
@@ -498,7 +570,7 @@ FT_BEGIN_HEADER
#define NEG_INT64( a ) \
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
-#endif /* FT_LONG64 */
+#endif /* FT_INT64 */
FT_END_HEADER
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftdebug.h b/src/3rdparty/freetype/include/freetype/internal/ftdebug.h
index df5357ad55..4e013ba1e2 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftdebug.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftdebug.h
@@ -4,7 +4,7 @@
*
* Debugging and logging component (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -31,9 +31,24 @@
#include "compiler-macros.h"
+#ifdef FT_DEBUG_LOGGING
+#define DLG_STATIC
+#include <dlg/output.h>
+#include <dlg/dlg.h>
+
+#include <freetype/ftlogging.h>
+#endif /* FT_DEBUG_LOGGING */
+
FT_BEGIN_HEADER
+ /* force the definition of FT_DEBUG_LEVEL_TRACE if FT_DEBUG_LOGGING is */
+ /* already defined. */
+ /* */
+#ifdef FT_DEBUG_LOGGING
+#undef FT_DEBUG_LEVEL_TRACE
+#define FT_DEBUG_LEVEL_TRACE
+#endif
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
/* is already defined; this simplifies the following #ifdefs */
@@ -82,21 +97,67 @@ FT_BEGIN_HEADER
* Each component must define the macro FT_COMPONENT to a valid FT_Trace
* value before using any TRACE macro.
*
+ * To get consistent logging output, there should be no newline character
+ * (i.e., '\n') or a single trailing one in the message string of
+ * `FT_TRACEx` and `FT_ERROR`.
*/
-#ifdef FT_DEBUG_LEVEL_TRACE
- /* we need two macros here to make cpp expand `FT_COMPONENT' */
-#define FT_TRACE_COMP( x ) FT_TRACE_COMP_( x )
-#define FT_TRACE_COMP_( x ) trace_ ## x
+ /*************************************************************************
+ *
+ * If FT_DEBUG_LOGGING is enabled, tracing messages are sent to dlg's API.
+ * If FT_DEBUG_LOGGING is disabled, tracing messages are sent to
+ * `FT_Message` (defined in ftdebug.c).
+ */
+#ifdef FT_DEBUG_LOGGING
+
+ /* we need two macros to convert the names of `FT_COMPONENT` to a string */
+#define FT_LOGGING_TAG( x ) FT_LOGGING_TAG_( x )
+#define FT_LOGGING_TAG_( x ) #x
-#define FT_TRACE( level, varformat ) \
+ /* we need two macros to convert the component and the trace level */
+ /* to a string that combines them */
+#define FT_LOGGING_TAGX( x, y ) FT_LOGGING_TAGX_( x, y )
+#define FT_LOGGING_TAGX_( x, y ) #x ":" #y
+
+
+#define FT_LOG( level, varformat ) \
+ do \
+ { \
+ const char* dlg_tag = FT_LOGGING_TAGX( FT_COMPONENT, level ); \
+ \
+ \
+ ft_add_tag( dlg_tag ); \
+ if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
+ { \
+ if ( custom_output_handler != NULL ) \
+ FT_Logging_Callback varformat; \
+ else \
+ dlg_trace varformat; \
+ } \
+ ft_remove_tag( dlg_tag ); \
+ } while( 0 )
+
+#else /* !FT_DEBUG_LOGGING */
+
+#define FT_LOG( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
FT_Message varformat; \
} while ( 0 )
+#endif /* !FT_DEBUG_LOGGING */
+
+
+#ifdef FT_DEBUG_LEVEL_TRACE
+
+ /* we need two macros here to make cpp expand `FT_COMPONENT' */
+#define FT_TRACE_COMP( x ) FT_TRACE_COMP_( x )
+#define FT_TRACE_COMP_( x ) trace_ ## x
+
+#define FT_TRACE( level, varformat ) FT_LOG( level, varformat )
+
#else /* !FT_DEBUG_LEVEL_TRACE */
#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */
@@ -204,7 +265,32 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_LEVEL_ERROR
-#define FT_ERROR( varformat ) FT_Message varformat
+ /**************************************************************************
+ *
+ * If FT_DEBUG_LOGGING is enabled, error messages are sent to dlg's API.
+ * If FT_DEBUG_LOGGING is disabled, error messages are sent to `FT_Message`
+ * (defined in ftdebug.c).
+ *
+ */
+#ifdef FT_DEBUG_LOGGING
+
+#define FT_ERROR( varformat ) \
+ do \
+ { \
+ const char* dlg_tag = FT_LOGGING_TAG( FT_COMPONENT ); \
+ \
+ \
+ ft_add_tag( dlg_tag ); \
+ dlg_trace varformat; \
+ ft_remove_tag( dlg_tag ); \
+ } while ( 0 )
+
+#else /* !FT_DEBUG_LOGGING */
+
+#define FT_ERROR( varformat ) FT_Message varformat
+
+#endif /* !FT_DEBUG_LOGGING */
+
#else /* !FT_DEBUG_LEVEL_ERROR */
@@ -277,6 +363,77 @@ FT_BEGIN_HEADER
FT_BASE( void )
ft_debug_init( void );
+
+#ifdef FT_DEBUG_LOGGING
+
+ /**************************************************************************
+ *
+ * 'dlg' uses output handlers to control how and where log messages are
+ * printed. Therefore we need to define a default output handler for
+ * FreeType.
+ */
+ FT_BASE( void )
+ ft_log_handler( const struct dlg_origin* origin,
+ const char* string,
+ void* data );
+
+
+ /**************************************************************************
+ *
+ * 1. `ft_default_log_handler` stores the function pointer that is used
+ * internally by FreeType to print logs to a file.
+ *
+ * 2. `custom_output_handler` stores the function pointer to the callback
+ * function provided by the user.
+ *
+ * It is defined in `ftdebug.c`.
+ */
+ extern dlg_handler ft_default_log_handler;
+ extern FT_Custom_Log_Handler custom_output_handler;
+
+
+ /**************************************************************************
+ *
+ * If FT_DEBUG_LOGGING macro is enabled, FreeType needs to initialize and
+ * un-initialize `FILE*`.
+ *
+ * These functions are defined in `ftdebug.c`.
+ */
+ FT_BASE( void )
+ ft_logging_init( void );
+
+ FT_BASE( void )
+ ft_logging_deinit( void );
+
+
+ /**************************************************************************
+ *
+ * For printing the name of `FT_COMPONENT` along with the actual log we
+ * need to add a tag with the name of `FT_COMPONENT`.
+ *
+ * These functions are defined in `ftdebug.c`.
+ */
+ FT_BASE( void )
+ ft_add_tag( const char* tag );
+
+ FT_BASE( void )
+ ft_remove_tag( const char* tag );
+
+
+ /**************************************************************************
+ *
+ * A function to print log data using a custom callback logging function
+ * (which is set using `FT_Set_Log_Handler`).
+ *
+ * This function is defined in `ftdebug.c`.
+ */
+ FT_BASE( void )
+ FT_Logging_Callback( const char* fmt,
+ ... );
+
+#endif /* FT_DEBUG_LOGGING */
+
+
FT_END_HEADER
#endif /* FTDEBUG_H_ */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftdrv.h b/src/3rdparty/freetype/include/freetype/internal/ftdrv.h
index 7f22710eae..9001c07ad0 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftdrv.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftdrv.h
@@ -4,7 +4,7 @@
*
* FreeType internal font driver interface (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -157,6 +157,7 @@ FT_BEGIN_HEADER
* A handle to a function used to select a new fixed size. It is used
* only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
* scaling done in the base layer suffices.
+ *
* @note:
* Most function pointers, with the exception of `load_glyph`, can be set
* to 0 to indicate a default behaviour.
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftgloadr.h b/src/3rdparty/freetype/include/freetype/internal/ftgloadr.h
index 27b8659f7c..36e5509f9e 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftgloadr.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftgloadr.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph loader (specification).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
@@ -22,6 +22,7 @@
#include <freetype/freetype.h>
+#include "compiler-macros.h"
FT_BEGIN_HEADER
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftmemory.h b/src/3rdparty/freetype/include/freetype/internal/ftmemory.h
index ddb18b0512..5eb1d21ff6 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftmemory.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftmemory.h
@@ -4,7 +4,7 @@
*
* The FreeType memory management macros (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
@@ -96,15 +96,15 @@ extern "C++"
#ifdef FT_DEBUG_MEMORY
- FT_BASE( const char* ) _ft_debug_file;
- FT_BASE( long ) _ft_debug_lineno;
+ FT_BASE( const char* ) ft_debug_file_;
+ FT_BASE( long ) ft_debug_lineno_;
-#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
- _ft_debug_lineno = __LINE__, \
+#define FT_DEBUG_INNER( exp ) ( ft_debug_file_ = __FILE__, \
+ ft_debug_lineno_ = __LINE__, \
(exp) )
-#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
- _ft_debug_lineno = __LINE__, \
+#define FT_ASSIGNP_INNER( p, exp ) ( ft_debug_file_ = __FILE__, \
+ ft_debug_lineno_ = __LINE__, \
FT_ASSIGNP( p, exp ) )
#else /* !FT_DEBUG_MEMORY */
@@ -344,14 +344,13 @@ extern "C++"
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
-#define FT_QNEW( ptr ) \
- FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
+#define FT_QNEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
-#define FT_QNEW_ARRAY( ptr, count ) \
- FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
+#define FT_QNEW_ARRAY( ptr, count ) \
+ FT_MEM_SET_ERROR( FT_MEM_QNEW_ARRAY( ptr, count ) )
-#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
- FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
+#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
+ FT_MEM_SET_ERROR( FT_MEM_QRENEW_ARRAY( ptr, curcnt, newcnt ) )
FT_BASE( FT_Pointer )
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftmmtypes.h b/src/3rdparty/freetype/include/freetype/internal/ftmmtypes.h
new file mode 100644
index 0000000000..c4b21d6144
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/ftmmtypes.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+ *
+ * ftmmtypes.h
+ *
+ * OpenType Variations type definitions for internal use
+ * with the multi-masters service (specification).
+ *
+ * Copyright (C) 2022-2023 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
+ * Dominik Röttsches.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+#ifndef FTMMTYPES_H_
+#define FTMMTYPES_H_
+
+FT_BEGIN_HEADER
+
+
+ typedef FT_Int32 FT_ItemVarDelta;
+
+ typedef struct GX_ItemVarDataRec_
+ {
+ FT_UInt itemCount; /* Number of delta sets per item. */
+ FT_UInt regionIdxCount; /* Number of region indices. */
+ FT_UInt* regionIndices; /* Array of `regionCount` indices; */
+ /* these index `varRegionList`. */
+ FT_Byte* deltaSet; /* Array of `itemCount` deltas; */
+ /* use `innerIndex` for this array. */
+ FT_UShort wordDeltaCount; /* Number of the first 32-bit ints */
+ /* or 16-bit ints of `deltaSet` */
+ /* depending on `longWords`. */
+ FT_Bool longWords; /* If true, `deltaSet` is a 32-bit */
+ /* array followed by a 16-bit */
+ /* array, otherwise a 16-bit array */
+ /* followed by an 8-bit array. */
+ } GX_ItemVarDataRec, *GX_ItemVarData;
+
+
+ /* contribution of one axis to a region */
+ typedef struct GX_AxisCoordsRec_
+ {
+ FT_Fixed startCoord;
+ FT_Fixed peakCoord; /* zero means no effect (factor = 1) */
+ FT_Fixed endCoord;
+
+ } GX_AxisCoordsRec, *GX_AxisCoords;
+
+
+ typedef struct GX_VarRegionRec_
+ {
+ GX_AxisCoords axisList; /* array of axisCount records */
+
+ } GX_VarRegionRec, *GX_VarRegion;
+
+
+ /* item variation store */
+ typedef struct GX_ItemVarStoreRec_
+ {
+ FT_UInt dataCount;
+ GX_ItemVarData varData; /* array of dataCount records; */
+ /* use `outerIndex' for this array */
+ FT_UShort axisCount;
+ FT_UInt regionCount; /* total number of regions defined */
+ GX_VarRegion varRegionList;
+
+ } GX_ItemVarStoreRec, *GX_ItemVarStore;
+
+
+ typedef struct GX_DeltaSetIdxMapRec_
+ {
+ FT_ULong mapCount;
+ FT_UInt* outerIndex; /* indices to item var data */
+ FT_UInt* innerIndex; /* indices to delta set */
+
+ } GX_DeltaSetIdxMapRec, *GX_DeltaSetIdxMap;
+
+
+FT_END_HEADER
+
+#endif /* FTMMTYPES_H_ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftobjs.h b/src/3rdparty/freetype/include/freetype/internal/ftobjs.h
index 25db2c494f..28bc9b65f0 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftobjs.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftobjs.h
@@ -4,7 +4,7 @@
*
* The FreeType private base classes (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -418,7 +418,8 @@ FT_BEGIN_HEADER
* initializing the glyph slot.
*/
-#define FT_GLYPH_OWN_BITMAP 0x1U
+#define FT_GLYPH_OWN_BITMAP 0x1U
+#define FT_GLYPH_OWN_GZIP_SVG 0x2U
typedef struct FT_Slot_InternalRec_
{
@@ -673,7 +674,7 @@ FT_BEGIN_HEADER
/* Set the metrics according to a size request. */
- FT_BASE( void )
+ FT_BASE( FT_Error )
FT_Request_Metrics( FT_Face face,
FT_Size_Request req );
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftpsprop.h b/src/3rdparty/freetype/include/freetype/internal/ftpsprop.h
index 81ec29151c..1d5b287ad2 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftpsprop.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftpsprop.h
@@ -4,7 +4,7 @@
*
* Get and set properties of PostScript drivers (specification).
*
- * Copyright (C) 2017-2020 by
+ * Copyright (C) 2017-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftrfork.h b/src/3rdparty/freetype/include/freetype/internal/ftrfork.h
index 1b7b25acbe..e96459921e 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftrfork.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftrfork.h
@@ -4,7 +4,7 @@
*
* Embedded resource forks accessor (specification).
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* Masatake YAMATO and Redhat K.K.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftserv.h b/src/3rdparty/freetype/include/freetype/internal/ftserv.h
index 6e1a9472da..1e85d6d385 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftserv.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftserv.h
@@ -4,7 +4,7 @@
*
* The FreeType services (specification only).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftstream.h b/src/3rdparty/freetype/include/freetype/internal/ftstream.h
index e7d922260f..88e19287c8 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftstream.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
*
* Stream handling (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -196,9 +196,9 @@ FT_BEGIN_HEADER
FT_BYTE_U32( p, 2, 8 ) | \
FT_BYTE_U32( p, 3, 0 ) )
-#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 2, 0 ) )
+#define FT_PEEK_OFF3( p ) ( FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
+ FT_BYTE_U32( p, 1, 16 ) | \
+ FT_BYTE_U32( p, 2, 8 ) ) >> 8 )
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
@@ -220,9 +220,9 @@ FT_BEGIN_HEADER
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
-#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
- FT_BYTE_U32( p, 1, 8 ) | \
- FT_BYTE_U32( p, 0, 0 ) )
+#define FT_PEEK_OFF3_LE( p ) ( FT_INT32( FT_BYTE_U32( p, 2, 24 ) | \
+ FT_BYTE_U32( p, 1, 16 ) | \
+ FT_BYTE_U32( p, 0, 8 ) ) >> 8 )
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
@@ -238,42 +238,42 @@ FT_BEGIN_HEADER
#define FT_NEXT_BYTE( buffer ) \
( (unsigned char)*buffer++ )
-#define FT_NEXT_SHORT( buffer ) \
- ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
+#define FT_NEXT_SHORT( buffer ) \
+ ( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) )
-#define FT_NEXT_USHORT( buffer ) \
- ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
+#define FT_NEXT_USHORT( buffer ) \
+ ( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) )
-#define FT_NEXT_OFF3( buffer ) \
- ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
+#define FT_NEXT_OFF3( buffer ) \
+ ( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) )
-#define FT_NEXT_UOFF3( buffer ) \
- ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
+#define FT_NEXT_UOFF3( buffer ) \
+ ( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) )
-#define FT_NEXT_LONG( buffer ) \
- ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
+#define FT_NEXT_LONG( buffer ) \
+ ( buffer += 4, FT_PEEK_LONG( buffer - 4 ) )
-#define FT_NEXT_ULONG( buffer ) \
- ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
+#define FT_NEXT_ULONG( buffer ) \
+ ( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) )
-#define FT_NEXT_SHORT_LE( buffer ) \
- ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
+#define FT_NEXT_SHORT_LE( buffer ) \
+ ( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) )
-#define FT_NEXT_USHORT_LE( buffer ) \
- ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
+#define FT_NEXT_USHORT_LE( buffer ) \
+ ( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) )
-#define FT_NEXT_OFF3_LE( buffer ) \
- ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
+#define FT_NEXT_OFF3_LE( buffer ) \
+ ( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) )
-#define FT_NEXT_UOFF3_LE( buffer ) \
- ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
+#define FT_NEXT_UOFF3_LE( buffer ) \
+ ( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) )
-#define FT_NEXT_LONG_LE( buffer ) \
- ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
+#define FT_NEXT_LONG_LE( buffer ) \
+ ( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) )
-#define FT_NEXT_ULONG_LE( buffer ) \
- ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
+#define FT_NEXT_ULONG_LE( buffer ) \
+ ( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) )
/**************************************************************************
@@ -305,20 +305,19 @@ FT_BEGIN_HEADER
#else
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
-#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
-#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
-#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
-#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
-#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
-#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
-#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
-#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
-#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
-
-#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
-#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
-#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
-#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
+#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetByte, FT_Char )
+#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetByte, FT_Byte )
+#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Int16 )
+#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UInt16 )
+#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_UInt32 )
+#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Int32 )
+#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
+#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
+
+#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Int16 )
+#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UInt16 )
+#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Int32 )
+#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_UInt32 )
#endif
@@ -333,19 +332,18 @@ FT_BEGIN_HEADER
* `FT_STREAM_POS'. They use the full machinery to check whether a read is
* valid.
*/
-#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
-#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
-#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
-#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
-#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
-#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
-#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
-#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
+#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadByte, FT_Byte, var )
+#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadByte, FT_Char, var )
+#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Int16, var )
+#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UInt16, var )
+#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_UInt32, var )
+#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Int32, var )
+#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_UInt32, var )
-#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
-#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
-#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
-#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
+#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Int16, var )
+#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UInt16, var )
+#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Int32, var )
+#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_UInt32, var )
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
@@ -457,37 +455,37 @@ FT_BEGIN_HEADER
/* read a byte from an entered frame */
- FT_BASE( FT_Char )
- FT_Stream_GetChar( FT_Stream stream );
+ FT_BASE( FT_Byte )
+ FT_Stream_GetByte( FT_Stream stream );
/* read a 16-bit big-endian unsigned integer from an entered frame */
- FT_BASE( FT_UShort )
+ FT_BASE( FT_UInt16 )
FT_Stream_GetUShort( FT_Stream stream );
/* read a 24-bit big-endian unsigned integer from an entered frame */
- FT_BASE( FT_ULong )
+ FT_BASE( FT_UInt32 )
FT_Stream_GetUOffset( FT_Stream stream );
/* read a 32-bit big-endian unsigned integer from an entered frame */
- FT_BASE( FT_ULong )
+ FT_BASE( FT_UInt32 )
FT_Stream_GetULong( FT_Stream stream );
/* read a 16-bit little-endian unsigned integer from an entered frame */
- FT_BASE( FT_UShort )
+ FT_BASE( FT_UInt16 )
FT_Stream_GetUShortLE( FT_Stream stream );
/* read a 32-bit little-endian unsigned integer from an entered frame */
- FT_BASE( FT_ULong )
+ FT_BASE( FT_UInt32 )
FT_Stream_GetULongLE( FT_Stream stream );
/* read a byte from a stream */
- FT_BASE( FT_Char )
- FT_Stream_ReadChar( FT_Stream stream,
+ FT_BASE( FT_Byte )
+ FT_Stream_ReadByte( FT_Stream stream,
FT_Error* error );
/* read a 16-bit big-endian unsigned integer from a stream */
- FT_BASE( FT_UShort )
+ FT_BASE( FT_UInt16 )
FT_Stream_ReadUShort( FT_Stream stream,
FT_Error* error );
@@ -497,17 +495,17 @@ FT_BEGIN_HEADER
FT_Error* error );
/* read a 32-bit big-endian integer from a stream */
- FT_BASE( FT_ULong )
+ FT_BASE( FT_UInt32 )
FT_Stream_ReadULong( FT_Stream stream,
FT_Error* error );
/* read a 16-bit little-endian unsigned integer from a stream */
- FT_BASE( FT_UShort )
+ FT_BASE( FT_UInt16 )
FT_Stream_ReadUShortLE( FT_Stream stream,
FT_Error* error );
/* read a 32-bit little-endian unsigned integer from a stream */
- FT_BASE( FT_ULong )
+ FT_BASE( FT_UInt32 )
FT_Stream_ReadULongLE( FT_Stream stream,
FT_Error* error );
diff --git a/src/3rdparty/freetype/include/freetype/internal/fttrace.h b/src/3rdparty/freetype/include/freetype/internal/fttrace.h
index 58bd77413c..319fe56fd2 100644
--- a/src/3rdparty/freetype/include/freetype/internal/fttrace.h
+++ b/src/3rdparty/freetype/include/freetype/internal/fttrace.h
@@ -4,7 +4,7 @@
*
* Tracing handling (specification only).
*
- * Copyright (C) 2002-2020 by
+ * Copyright (C) 2002-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -18,6 +18,11 @@
/* definitions of trace levels for FreeType 2 */
+ /* the maximum string length (if the argument to `FT_TRACE_DEF` */
+ /* gets used as a string) plus one charachter for ':' plus */
+ /* another one for the trace level */
+#define FT_MAX_TRACE_LEVEL_LENGTH (9 + 1 + 1)
+
/* the first level must always be `trace_any' */
FT_TRACE_DEF( any )
@@ -38,12 +43,17 @@ FT_TRACE_DEF( checksum ) /* bitmap checksum (ftobjs.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
+FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
+
+ /* rasterizers */
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
-FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
- /* Cache sub-system */
-FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
+ /* ot-svg module */
+FT_TRACE_DEF( otsvg ) /* OT-SVG renderer (ftsvg.c) */
+
+ /* cache sub-system */
+FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
/* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
@@ -54,6 +64,7 @@ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */
FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
+FT_TRACE_DEF( ttsvg ) /* OpenType SVG table (ttsvg.c) */
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
@@ -77,6 +88,7 @@ FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */
+FT_TRACE_DEF( afmparse )
FT_TRACE_DEF( cffdecode )
FT_TRACE_DEF( psconv )
FT_TRACE_DEF( psobjs )
@@ -151,8 +163,10 @@ FT_TRACE_DEF( afglobal )
FT_TRACE_DEF( afhints )
FT_TRACE_DEF( afmodule )
FT_TRACE_DEF( aflatin )
-FT_TRACE_DEF( aflatin2 )
FT_TRACE_DEF( afshaper )
-FT_TRACE_DEF( afwarp )
+
+ /* SDF components */
+FT_TRACE_DEF( sdf ) /* signed distance raster for outlines (ftsdf.c) */
+FT_TRACE_DEF( bsdf ) /* signed distance raster for bitmaps (ftbsdf.c) */
/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftvalid.h b/src/3rdparty/freetype/include/freetype/internal/ftvalid.h
index a5bc6c9b52..e98ee4e473 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftvalid.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
*
* FreeType validation support (specification).
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/psaux.h b/src/3rdparty/freetype/include/freetype/internal/psaux.h
index 8e0a262fd5..dfb1987f86 100644
--- a/src/3rdparty/freetype/include/freetype/internal/psaux.h
+++ b/src/3rdparty/freetype/include/freetype/internal/psaux.h
@@ -5,7 +5,7 @@
* Auxiliary functions and data structures related to PostScript fonts
* (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -132,9 +132,6 @@ FT_BEGIN_HEADER
* max_elems ::
* The maximum number of elements in table.
*
- * num_elems ::
- * The current number of elements in table.
- *
* elements ::
* A table of element addresses within the block.
*
@@ -155,7 +152,6 @@ FT_BEGIN_HEADER
FT_ULong init;
FT_Int max_elems;
- FT_Int num_elems;
FT_Byte** elements; /* addresses of table elements */
FT_UInt* lengths; /* lengths of table elements */
diff --git a/src/3rdparty/freetype/include/freetype/internal/pshints.h b/src/3rdparty/freetype/include/freetype/internal/pshints.h
index 663e9d3488..ededc4c72e 100644
--- a/src/3rdparty/freetype/include/freetype/internal/pshints.h
+++ b/src/3rdparty/freetype/include/freetype/internal/pshints.h
@@ -6,7 +6,7 @@
* recorders (specification only). These are used to support native
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
*
- * Copyright (C) 2001-2020 by
+ * Copyright (C) 2001-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -294,7 +294,7 @@ FT_BEGIN_HEADER
*
* @note:
* On input, all points within the outline are in font coordinates. On
- * output, they are in 1/64th of pixels.
+ * output, they are in 1/64 of pixels.
*
* The scaling transformation is taken from the 'globals' object which
* must correspond to the same font as the glyph.
@@ -607,7 +607,7 @@ FT_BEGIN_HEADER
*
* @note:
* On input, all points within the outline are in font coordinates. On
- * output, they are in 1/64th of pixels.
+ * output, they are in 1/64 of pixels.
*
* The scaling transformation is taken from the 'globals' object which
* must correspond to the same font than the glyph.
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svbdf.h b/src/3rdparty/freetype/include/freetype/internal/services/svbdf.h
index 81f5a06b62..bf0c1dcc71 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svbdf.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svbdf.h
@@ -4,7 +4,7 @@
*
* The FreeType BDF services (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svcfftl.h b/src/3rdparty/freetype/include/freetype/internal/services/svcfftl.h
index 1d2dbb6a8e..4a20498ee0 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svcfftl.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svcfftl.h
@@ -4,7 +4,7 @@
*
* The FreeType CFF tables loader service (specification).
*
- * Copyright (C) 2017-2020 by
+ * Copyright (C) 2017-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svcid.h b/src/3rdparty/freetype/include/freetype/internal/services/svcid.h
index bd49f3270a..06d0cb8fd6 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svcid.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svcid.h
@@ -4,7 +4,7 @@
*
* The FreeType CID font services (specification).
*
- * Copyright (C) 2007-2020 by
+ * Copyright (C) 2007-2023 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h b/src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h
index 6114d638af..bc45e80568 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svfntfmt.h
@@ -4,7 +4,7 @@
*
* The FreeType font format service (specification only).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svgldict.h b/src/3rdparty/freetype/include/freetype/internal/services/svgldict.h
index f9443e40d6..6437abfbf2 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svgldict.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svgldict.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph dictionary services (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svgxval.h b/src/3rdparty/freetype/include/freetype/internal/services/svgxval.h
index 83c2f26cee..31016afe0d 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svgxval.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svgxval.h
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svkern.h b/src/3rdparty/freetype/include/freetype/internal/services/svkern.h
index 13cfb32722..bcabbc3e68 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svkern.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svkern.h
@@ -4,7 +4,7 @@
*
* The FreeType Kerning service (specification).
*
- * Copyright (C) 2006-2020 by
+ * Copyright (C) 2006-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svmetric.h b/src/3rdparty/freetype/include/freetype/internal/services/svmetric.h
index 2b30edaabe..167617ebb3 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svmetric.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svmetric.h
@@ -4,7 +4,7 @@
*
* The FreeType services for metrics variations (specification).
*
- * Copyright (C) 2016-2020 by
+ * Copyright (C) 2016-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -77,6 +77,9 @@ FT_BEGIN_HEADER
typedef void
(*FT_Metrics_Adjust_Func)( FT_Face face );
+ typedef FT_Error
+ (*FT_Size_Reset_Func)( FT_Size size );
+
FT_DEFINE_SERVICE( MetricsVariations )
{
@@ -90,6 +93,7 @@ FT_BEGIN_HEADER
FT_VOrg_Adjust_Func vorg_adjust;
FT_Metrics_Adjust_Func metrics_adjust;
+ FT_Size_Reset_Func size_reset;
};
@@ -101,7 +105,8 @@ FT_BEGIN_HEADER
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
- metrics_adjust_ ) \
+ metrics_adjust_, \
+ size_reset_ ) \
static const FT_Service_MetricsVariationsRec class_ = \
{ \
hadvance_adjust_, \
@@ -111,7 +116,8 @@ FT_BEGIN_HEADER
tsb_adjust_, \
bsb_adjust_, \
vorg_adjust_, \
- metrics_adjust_ \
+ metrics_adjust_, \
+ size_reset_ \
};
/* */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svmm.h b/src/3rdparty/freetype/include/freetype/internal/services/svmm.h
index 5a807636a6..7e76ab8324 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svmm.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svmm.h
@@ -4,8 +4,8 @@
*
* The FreeType Multiple Masters and GX var services (specification).
*
- * Copyright (C) 2003-2020 by
- * David Turner, Robert Wilhelm, and Werner Lemberg.
+ * Copyright (C) 2003-2023 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
@@ -19,7 +19,9 @@
#ifndef SVMM_H_
#define SVMM_H_
+#include <freetype/ftmm.h>
#include <freetype/internal/ftserv.h>
+#include <freetype/internal/ftmmtypes.h>
FT_BEGIN_HEADER
@@ -58,9 +60,9 @@ FT_BEGIN_HEADER
/* use return value -1 to indicate that the new coordinates */
/* are equal to the current ones; no changes are thus needed */
typedef FT_Error
- (*FT_Set_MM_Blend_Func)( FT_Face face,
- FT_UInt num_coords,
- FT_Long* coords );
+ (*FT_Set_MM_Blend_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
typedef FT_Error
(*FT_Get_Var_Design_Func)( FT_Face face,
@@ -68,13 +70,17 @@ FT_BEGIN_HEADER
FT_Fixed* coords );
typedef FT_Error
- (*FT_Set_Instance_Func)( FT_Face face,
- FT_UInt instance_index );
+ (*FT_Set_Named_Instance_Func)( FT_Face face,
+ FT_UInt instance_index );
typedef FT_Error
- (*FT_Get_MM_Blend_Func)( FT_Face face,
- FT_UInt num_coords,
- FT_Long* coords );
+ (*FT_Get_Default_Named_Instance_Func)( FT_Face face,
+ FT_UInt *instance_index );
+
+ typedef FT_Error
+ (*FT_Get_MM_Blend_Func)( FT_Face face,
+ FT_UInt num_coords,
+ FT_Fixed* coords );
typedef FT_Error
(*FT_Get_Var_Blend_Func)( FT_Face face,
@@ -84,7 +90,7 @@ FT_BEGIN_HEADER
FT_MM_Var* *mm_var );
typedef void
- (*FT_Done_Blend_Func)( FT_Face );
+ (*FT_Done_Blend_Func)( FT_Face face );
typedef FT_Error
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
@@ -96,53 +102,105 @@ FT_BEGIN_HEADER
FT_UInt* len,
FT_Fixed* weight_vector );
+ typedef void
+ (*FT_Construct_PS_Name_Func)( FT_Face face );
+
+ typedef FT_Error
+ (*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face,
+ FT_ULong offset,
+ GX_DeltaSetIdxMap map,
+ GX_ItemVarStore itemStore,
+ FT_ULong table_len );
+
+ typedef FT_Error
+ (*FT_Var_Load_Item_Var_Store_Func)( FT_Face face,
+ FT_ULong offset,
+ GX_ItemVarStore itemStore );
+
+ typedef FT_ItemVarDelta
+ (*FT_Var_Get_Item_Delta_Func)( FT_Face face,
+ GX_ItemVarStore itemStore,
+ FT_UInt outerIndex,
+ FT_UInt innerIndex );
+
+ typedef void
+ (*FT_Var_Done_Item_Var_Store_Func)( FT_Face face,
+ GX_ItemVarStore itemStore );
+
+ typedef void
+ (*FT_Var_Done_Delta_Set_Idx_Map_Func)( FT_Face face,
+ GX_DeltaSetIdxMap deltaSetIdxMap );
+
FT_DEFINE_SERVICE( MultiMasters )
{
- FT_Get_MM_Func get_mm;
- FT_Set_MM_Design_Func set_mm_design;
- FT_Set_MM_Blend_Func set_mm_blend;
- FT_Get_MM_Blend_Func get_mm_blend;
- FT_Get_MM_Var_Func get_mm_var;
- FT_Set_Var_Design_Func set_var_design;
- FT_Get_Var_Design_Func get_var_design;
- FT_Set_Instance_Func set_instance;
- FT_Set_MM_WeightVector_Func set_mm_weightvector;
- FT_Get_MM_WeightVector_Func get_mm_weightvector;
+ FT_Get_MM_Func get_mm;
+ FT_Set_MM_Design_Func set_mm_design;
+ FT_Set_MM_Blend_Func set_mm_blend;
+ FT_Get_MM_Blend_Func get_mm_blend;
+ FT_Get_MM_Var_Func get_mm_var;
+ FT_Set_Var_Design_Func set_var_design;
+ FT_Get_Var_Design_Func get_var_design;
+ FT_Set_Named_Instance_Func set_named_instance;
+ FT_Get_Default_Named_Instance_Func get_default_named_instance;
+ FT_Set_MM_WeightVector_Func set_mm_weightvector;
+ FT_Get_MM_WeightVector_Func get_mm_weightvector;
/* for internal use; only needed for code sharing between modules */
- FT_Get_Var_Blend_Func get_var_blend;
- FT_Done_Blend_Func done_blend;
+ FT_Construct_PS_Name_Func construct_ps_name;
+ FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map;
+ FT_Var_Load_Item_Var_Store_Func load_item_var_store;
+ FT_Var_Get_Item_Delta_Func get_item_delta;
+ FT_Var_Done_Item_Var_Store_Func done_item_var_store;
+ FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_idx_map;
+ FT_Get_Var_Blend_Func get_var_blend;
+ FT_Done_Blend_Func done_blend;
};
-#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_blend_, \
- get_mm_var_, \
- set_var_design_, \
- get_var_design_, \
- set_instance_, \
- set_weightvector_, \
- get_weightvector_, \
- get_var_blend_, \
- done_blend_ ) \
- static const FT_Service_MultiMastersRec class_ = \
- { \
- get_mm_, \
- set_mm_design_, \
- set_mm_blend_, \
- get_mm_blend_, \
- get_mm_var_, \
- set_var_design_, \
- get_var_design_, \
- set_instance_, \
- set_weightvector_, \
- get_weightvector_, \
- get_var_blend_, \
- done_blend_ \
+#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ set_named_instance_, \
+ get_default_named_instance_, \
+ set_mm_weightvector_, \
+ get_mm_weightvector_, \
+ \
+ construct_ps_name_, \
+ load_delta_set_idx_map_, \
+ load_item_var_store_, \
+ get_item_delta_, \
+ done_item_var_store_, \
+ done_delta_set_idx_map_, \
+ get_var_blend_, \
+ done_blend_ ) \
+ static const FT_Service_MultiMastersRec class_ = \
+ { \
+ get_mm_, \
+ set_mm_design_, \
+ set_mm_blend_, \
+ get_mm_blend_, \
+ get_mm_var_, \
+ set_var_design_, \
+ get_var_design_, \
+ set_named_instance_, \
+ get_default_named_instance_, \
+ set_mm_weightvector_, \
+ get_mm_weightvector_, \
+ \
+ construct_ps_name_, \
+ load_delta_set_idx_map_, \
+ load_item_var_store_, \
+ get_item_delta_, \
+ done_item_var_store_, \
+ done_delta_set_idx_map_, \
+ get_var_blend_, \
+ done_blend_ \
};
/* */
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svotval.h b/src/3rdparty/freetype/include/freetype/internal/services/svotval.h
index 763fb2efbe..a4683cd5fb 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svotval.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svotval.h
@@ -4,7 +4,7 @@
*
* The FreeType OpenType validation service (specification).
*
- * Copyright (C) 2004-2020 by
+ * Copyright (C) 2004-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpfr.h b/src/3rdparty/freetype/include/freetype/internal/services/svpfr.h
index bdeba0785c..fd189c7de7 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svpfr.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpfr.h
@@ -4,7 +4,7 @@
*
* Internal PFR service functions (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h b/src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h
index 8ef62c5f92..2b8f6dfecf 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpostnm.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript name services (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svprop.h b/src/3rdparty/freetype/include/freetype/internal/services/svprop.h
index 8f755436a1..932ce32e03 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svprop.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svprop.h
@@ -4,7 +4,7 @@
*
* The FreeType property service (specification).
*
- * Copyright (C) 2012-2020 by
+ * Copyright (C) 2012-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h b/src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h
index b4dcd80759..6e599f3aab 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpscmap.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript charmap service (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -97,7 +97,7 @@ FT_BEGIN_HEADER
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
FT_UInt32 unicode );
- typedef FT_UInt32
+ typedef FT_UInt
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
FT_UInt32 *unicode );
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h b/src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h
index 1e7276ff43..09c4cdccc5 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript info service (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h b/src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h
index 39c8b5e19d..f98df2ef5f 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svsfnt.h
@@ -4,7 +4,7 @@
*
* The FreeType SFNT table loading service (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h b/src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h
index c18bb2336f..5f9eb02d66 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svttcmap.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType/sfnt cmap extra information service.
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* Masatake YAMATO, Redhat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svtteng.h b/src/3rdparty/freetype/include/freetype/internal/services/svtteng.h
index 7a17e4a755..ad577cb290 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svtteng.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svtteng.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType engine query service (specification).
*
- * Copyright (C) 2006-2020 by
+ * Copyright (C) 2006-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h b/src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h
index 90a81dd40e..ca6fff7444 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svttglyf.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType glyph service.
*
- * Copyright (C) 2007-2020 by
+ * Copyright (C) 2007-2023 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h b/src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h
index 8c915f5257..002923f8c9 100644
--- a/src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h
+++ b/src/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h
@@ -4,7 +4,7 @@
*
* The FreeType Windows FNT/FONT service (specification).
*
- * Copyright (C) 2003-2020 by
+ * Copyright (C) 2003-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/src/3rdparty/freetype/include/freetype/internal/sfnt.h b/src/3rdparty/freetype/include/freetype/internal/sfnt.h
index b4c12dbb26..a2d4e15baa 100644
--- a/src/3rdparty/freetype/include/freetype/internal/sfnt.h
+++ b/src/3rdparty/freetype/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
*
* High-level 'sfnt' driver interface (specification).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -314,6 +314,33 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @functype:
+ * TT_Load_Svg_Doc_Func
+ *
+ * @description:
+ * Scan the SVG document list to find the document containing the glyph
+ * that has the ID 'glyph*XXX*', where *XXX* is the value of
+ * `glyph_index` as a decimal integer.
+ *
+ * @inout:
+ * glyph ::
+ * The glyph slot from which pointers to the SVG document list is to be
+ * grabbed. The results are stored back in the slot.
+ *
+ * @input:
+ * glyph_index ::
+ * The index of the glyph that is to be looked up.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ */
+ typedef FT_Error
+ (*TT_Load_Svg_Doc_Func)( FT_GlyphSlot glyph,
+ FT_UInt glyph_index );
+
+
+ /**************************************************************************
+ *
+ * @functype:
* TT_Set_SBit_Strike_Func
*
* @description:
@@ -527,6 +554,170 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @functype:
+ * TT_Get_Color_Glyph_Paint_Func
+ *
+ * @description:
+ * Find the root @FT_OpaquePaint object for a given glyph ID.
+ *
+ * @input:
+ * face ::
+ * The target face object.
+ *
+ * base_glyph ::
+ * The glyph index the colored glyph layers are associated with.
+ *
+ * @output:
+ * paint ::
+ * The root @FT_OpaquePaint object.
+ *
+ * @return:
+ * Value~1 if everything is OK. If no color glyph is found, or the root
+ * paint could not be retrieved, value~0 gets returned. In case of an
+ * error, value~0 is returned also.
+ */
+ typedef FT_Bool
+ ( *TT_Get_Color_Glyph_Paint_Func )( TT_Face face,
+ FT_UInt base_glyph,
+ FT_Color_Root_Transform root_transform,
+ FT_OpaquePaint *paint );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * TT_Get_Color_Glyph_ClipBox_Func
+ *
+ * @description:
+ * Search for a 'COLR' v1 clip box for the specified `base_glyph` and
+ * fill the `clip_box` parameter with the 'COLR' v1 'ClipBox' information
+ * if one is found.
+ *
+ * @input:
+ * face ::
+ * A handle to the parent face object.
+ *
+ * base_glyph ::
+ * The glyph index for which to retrieve the clip box.
+ *
+ * @output:
+ * clip_box ::
+ * The clip box for the requested `base_glyph` if one is found. The
+ * clip box is computed taking scale and transformations configured on
+ * the @FT_Face into account. @FT_ClipBox contains @FT_Vector values
+ * in 26.6 format.
+ *
+ * @note:
+ * To retrieve the clip box in font units, reset scale to units-per-em
+ * and remove transforms configured using @FT_Set_Transform.
+ *
+ * @return:
+ * Value~1 if a ClipBox is found. If no clip box is found or an
+ * error occured, value~0 is returned.
+ */
+ typedef FT_Bool
+ ( *TT_Get_Color_Glyph_ClipBox_Func )( TT_Face face,
+ FT_UInt base_glyph,
+ FT_ClipBox* clip_box );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * TT_Get_Paint_Layers_Func
+ *
+ * @description:
+ * Access the layers of a `PaintColrLayers` table.
+ *
+ * @input:
+ * face ::
+ * The target face object.
+ *
+ * @inout:
+ * iterator ::
+ * The @FT_LayerIterator from an @FT_PaintColrLayers object, for which
+ * the layers are to be retrieved. The internal state of the iterator
+ * is incremented after one call to this function for retrieving one
+ * layer.
+ *
+ * @output:
+ * paint ::
+ * The root @FT_OpaquePaint object referencing the actual paint table.
+ *
+ * @return:
+ * Value~1 if everything is OK. Value~0 gets returned when the paint
+ * object can not be retrieved or any other error occurs.
+ */
+ typedef FT_Bool
+ ( *TT_Get_Paint_Layers_Func )( TT_Face face,
+ FT_LayerIterator* iterator,
+ FT_OpaquePaint *paint );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * TT_Get_Colorline_Stops_Func
+ *
+ * @description:
+ * Get the gradient and solid fill information for a given glyph.
+ *
+ * @input:
+ * face ::
+ * The target face object.
+ *
+ * @inout:
+ * iterator ::
+ * An @FT_ColorStopIterator object. For the first call you should set
+ * `iterator->p` to `NULL`. For all following calls, simply use the
+ * same object again.
+ *
+ * @output:
+ * color_stop ::
+ * Color index and alpha value for the retrieved color stop.
+ *
+ * @return:
+ * Value~1 if everything is OK. If there are no more color stops,
+ * value~0 gets returned. In case of an error, value~0 is returned
+ * also.
+ */
+ typedef FT_Bool
+ ( *TT_Get_Colorline_Stops_Func )( TT_Face face,
+ FT_ColorStop *color_stop,
+ FT_ColorStopIterator* iterator );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * TT_Get_Paint_Func
+ *
+ * @description:
+ * Get the paint details for a given @FT_OpaquePaint object.
+ *
+ * @input:
+ * face ::
+ * The target face object.
+ *
+ * opaque_paint ::
+ * The @FT_OpaquePaint object.
+ *
+ * @output:
+ * paint ::
+ * An @FT_COLR_Paint object holding the details on `opaque_paint`.
+ *
+ * @return:
+ * Value~1 if everything is OK. Value~0 if no details can be found for
+ * this paint or any other error occured.
+ */
+ typedef FT_Bool
+ ( *TT_Get_Paint_Func )( TT_Face face,
+ FT_OpaquePaint opaque_paint,
+ FT_COLR_Paint *paint );
+
+
+ /**************************************************************************
+ *
+ * @functype:
* TT_Blend_Colr_Func
*
* @description:
@@ -709,73 +900,83 @@ FT_BEGIN_HEADER
*/
typedef struct SFNT_Interface_
{
- TT_Loader_GotoTableFunc goto_table;
+ TT_Loader_GotoTableFunc goto_table;
- TT_Init_Face_Func init_face;
- TT_Load_Face_Func load_face;
- TT_Done_Face_Func done_face;
- FT_Module_Requester get_interface;
+ TT_Init_Face_Func init_face;
+ TT_Load_Face_Func load_face;
+ TT_Done_Face_Func done_face;
+ FT_Module_Requester get_interface;
- TT_Load_Any_Func load_any;
+ TT_Load_Any_Func load_any;
/* these functions are called by `load_face' but they can also */
/* be called from external modules, if there is a need to do so */
- TT_Load_Table_Func load_head;
- TT_Load_Metrics_Func load_hhea;
- TT_Load_Table_Func load_cmap;
- TT_Load_Table_Func load_maxp;
- TT_Load_Table_Func load_os2;
- TT_Load_Table_Func load_post;
+ TT_Load_Table_Func load_head;
+ TT_Load_Metrics_Func load_hhea;
+ TT_Load_Table_Func load_cmap;
+ TT_Load_Table_Func load_maxp;
+ TT_Load_Table_Func load_os2;
+ TT_Load_Table_Func load_post;
- TT_Load_Table_Func load_name;
- TT_Free_Table_Func free_name;
+ TT_Load_Table_Func load_name;
+ TT_Free_Table_Func free_name;
/* this field was called `load_kerning' up to version 2.1.10 */
- TT_Load_Table_Func load_kern;
+ TT_Load_Table_Func load_kern;
- TT_Load_Table_Func load_gasp;
- TT_Load_Table_Func load_pclt;
+ TT_Load_Table_Func load_gasp;
+ TT_Load_Table_Func load_pclt;
/* see `ttload.h'; this field was called `load_bitmap_header' up to */
/* version 2.1.10 */
- TT_Load_Table_Func load_bhed;
+ TT_Load_Table_Func load_bhed;
- TT_Load_SBit_Image_Func load_sbit_image;
+ TT_Load_SBit_Image_Func load_sbit_image;
/* see `ttpost.h' */
- TT_Get_PS_Name_Func get_psname;
- TT_Free_Table_Func free_psnames;
+ TT_Get_PS_Name_Func get_psname;
+ TT_Free_Table_Func free_psnames;
/* starting here, the structure differs from version 2.1.7 */
/* this field was introduced in version 2.1.8, named `get_psname' */
- TT_Face_GetKerningFunc get_kerning;
+ TT_Face_GetKerningFunc get_kerning;
/* new elements introduced after version 2.1.10 */
/* load the font directory, i.e., the offset table and */
/* the table directory */
- TT_Load_Table_Func load_font_dir;
- TT_Load_Metrics_Func load_hmtx;
+ TT_Load_Table_Func load_font_dir;
+ TT_Load_Metrics_Func load_hmtx;
- TT_Load_Table_Func load_eblc;
- TT_Free_Table_Func free_eblc;
+ TT_Load_Table_Func load_eblc;
+ TT_Free_Table_Func free_eblc;
TT_Set_SBit_Strike_Func set_sbit_strike;
TT_Load_Strike_Metrics_Func load_strike_metrics;
- TT_Load_Table_Func load_cpal;
- TT_Load_Table_Func load_colr;
- TT_Free_Table_Func free_cpal;
- TT_Free_Table_Func free_colr;
- TT_Set_Palette_Func set_palette;
- TT_Get_Colr_Layer_Func get_colr_layer;
- TT_Blend_Colr_Func colr_blend;
-
- TT_Get_Metrics_Func get_metrics;
-
- TT_Get_Name_Func get_name;
- TT_Get_Name_ID_Func get_name_id;
+ TT_Load_Table_Func load_cpal;
+ TT_Load_Table_Func load_colr;
+ TT_Free_Table_Func free_cpal;
+ TT_Free_Table_Func free_colr;
+ TT_Set_Palette_Func set_palette;
+ TT_Get_Colr_Layer_Func get_colr_layer;
+ TT_Get_Color_Glyph_Paint_Func get_colr_glyph_paint;
+ TT_Get_Color_Glyph_ClipBox_Func get_color_glyph_clipbox;
+ TT_Get_Paint_Layers_Func get_paint_layers;
+ TT_Get_Colorline_Stops_Func get_colorline_stops;
+ TT_Get_Paint_Func get_paint;
+ TT_Blend_Colr_Func colr_blend;
+
+ TT_Get_Metrics_Func get_metrics;
+
+ TT_Get_Name_Func get_name;
+ TT_Get_Name_ID_Func get_name_id;
+
+ /* OpenType SVG Support */
+ TT_Load_Table_Func load_svg;
+ TT_Free_Table_Func free_svg;
+ TT_Load_Svg_Doc_Func load_svg_doc;
} SFNT_Interface;
@@ -820,10 +1021,18 @@ FT_BEGIN_HEADER
free_colr_, \
set_palette_, \
get_colr_layer_, \
+ get_colr_glyph_paint_, \
+ get_color_glyph_clipbox, \
+ get_paint_layers_, \
+ get_colorline_stops_, \
+ get_paint_, \
colr_blend_, \
get_metrics_, \
get_name_, \
- get_name_id_ ) \
+ get_name_id_, \
+ load_svg_, \
+ free_svg_, \
+ load_svg_doc_ ) \
static const SFNT_Interface class_ = \
{ \
goto_table_, \
@@ -860,10 +1069,18 @@ FT_BEGIN_HEADER
free_colr_, \
set_palette_, \
get_colr_layer_, \
+ get_colr_glyph_paint_, \
+ get_color_glyph_clipbox, \
+ get_paint_layers_, \
+ get_colorline_stops_, \
+ get_paint_, \
colr_blend_, \
get_metrics_, \
get_name_, \
- get_name_id_ \
+ get_name_id_, \
+ load_svg_, \
+ free_svg_, \
+ load_svg_doc_ \
};
diff --git a/src/3rdparty/freetype/include/freetype/internal/svginterface.h b/src/3rdparty/freetype/include/freetype/internal/svginterface.h
new file mode 100644
index 0000000000..f464b2c058
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/internal/svginterface.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ *
+ * svginterface.h
+ *
+ * Interface of ot-svg module (specification only).
+ *
+ * Copyright (C) 2022-2023 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+#ifndef SVGINTERFACE_H_
+#define SVGINTERFACE_H_
+
+#include <ft2build.h>
+#include <freetype/otsvg.h>
+
+
+FT_BEGIN_HEADER
+
+ typedef FT_Error
+ (*Preset_Bitmap_Func)( FT_Module module,
+ FT_GlyphSlot slot,
+ FT_Bool cache );
+
+ typedef struct SVG_Interface_
+ {
+ Preset_Bitmap_Func preset_slot;
+
+ } SVG_Interface;
+
+ typedef SVG_Interface* SVG_Service;
+
+FT_END_HEADER
+
+#endif /* SVGINTERFACE_H_ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/internal/t1types.h b/src/3rdparty/freetype/include/freetype/internal/t1types.h
index 6a0fe5e97d..b9c94398fd 100644
--- a/src/3rdparty/freetype/include/freetype/internal/t1types.h
+++ b/src/3rdparty/freetype/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
* Basic Type1/Type2 type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -172,8 +172,8 @@ FT_BEGIN_HEADER
{
FT_Bool IsCIDFont;
FT_BBox FontBBox;
- FT_Fixed Ascender;
- FT_Fixed Descender;
+ FT_Fixed Ascender; /* optional, mind the zero */
+ FT_Fixed Descender; /* optional, mind the zero */
AFM_TrackKern TrackKerns; /* free if non-NULL */
FT_UInt NumTrackKern;
AFM_KernPair KernPairs; /* free if non-NULL */
@@ -201,30 +201,30 @@ FT_BEGIN_HEADER
typedef struct T1_FaceRec_
{
- FT_FaceRec root;
- T1_FontRec type1;
- const void* psnames;
- const void* psaux;
- const void* afm_data;
- FT_CharMapRec charmaprecs[2];
- FT_CharMap charmaps[2];
+ FT_FaceRec root;
+ T1_FontRec type1;
+ const void* psnames;
+ const void* psaux;
+ const void* afm_data;
+ FT_CharMapRec charmaprecs[2];
+ FT_CharMap charmaps[2];
/* support for Multiple Masters fonts */
- PS_Blend blend;
+ PS_Blend blend;
/* undocumented, optional: indices of subroutines that express */
/* the NormalizeDesignVector and the ConvertDesignVector procedure, */
/* respectively, as Type 2 charstrings; -1 if keywords not present */
- FT_Int ndv_idx;
- FT_Int cdv_idx;
+ FT_Int ndv_idx;
+ FT_Int cdv_idx;
/* undocumented, optional: has the same meaning as len_buildchar */
/* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
- FT_UInt len_buildchar;
- FT_Long* buildchar;
+ FT_UInt len_buildchar;
+ FT_Long* buildchar;
/* since version 2.1 - interface to PostScript hinter */
- const void* pshinter;
+ const void* pshinter;
} T1_FaceRec;
diff --git a/src/3rdparty/freetype/include/freetype/internal/tttypes.h b/src/3rdparty/freetype/include/freetype/internal/tttypes.h
index c36342c93a..b9788c7831 100644
--- a/src/3rdparty/freetype/include/freetype/internal/tttypes.h
+++ b/src/3rdparty/freetype/include/freetype/internal/tttypes.h
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -779,13 +779,15 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @struct:
- * TT_Post_20Rec
+ * TT_Post_NamesRec
*
* @description:
- * Postscript names sub-table, format 2.0. Stores the PS name of each
- * glyph in the font face.
+ * Postscript names table, either format 2.0 or 2.5.
*
* @fields:
+ * loaded ::
+ * A flag to indicate whether the PS names are loaded.
+ *
* num_glyphs ::
* The number of named glyphs in the table.
*
@@ -798,68 +800,13 @@ FT_BEGIN_HEADER
* glyph_names ::
* The PS names not in Mac Encoding.
*/
- typedef struct TT_Post_20Rec_
+ typedef struct TT_Post_NamesRec_
{
+ FT_Bool loaded;
FT_UShort num_glyphs;
FT_UShort num_names;
FT_UShort* glyph_indices;
- FT_Char** glyph_names;
-
- } TT_Post_20Rec, *TT_Post_20;
-
-
- /**************************************************************************
- *
- * @struct:
- * TT_Post_25Rec
- *
- * @description:
- * Postscript names sub-table, format 2.5. Stores the PS name of each
- * glyph in the font face.
- *
- * @fields:
- * num_glyphs ::
- * The number of glyphs in the table.
- *
- * offsets ::
- * An array of signed offsets in a normal Mac Postscript name encoding.
- */
- typedef struct TT_Post_25_
- {
- FT_UShort num_glyphs;
- FT_Char* offsets;
-
- } TT_Post_25Rec, *TT_Post_25;
-
-
- /**************************************************************************
- *
- * @struct:
- * TT_Post_NamesRec
- *
- * @description:
- * Postscript names table, either format 2.0 or 2.5.
- *
- * @fields:
- * loaded ::
- * A flag to indicate whether the PS names are loaded.
- *
- * format_20 ::
- * The sub-table used for format 2.0.
- *
- * format_25 ::
- * The sub-table used for format 2.5.
- */
- typedef struct TT_Post_NamesRec_
- {
- FT_Bool loaded;
-
- union
- {
- TT_Post_20Rec format_20;
- TT_Post_25Rec format_25;
-
- } names;
+ FT_Byte** glyph_names;
} TT_Post_NamesRec, *TT_Post_Names;
@@ -1253,12 +1200,16 @@ FT_BEGIN_HEADER
* mm ::
* A pointer to the Multiple Masters service.
*
- * var ::
- * A pointer to the Metrics Variations service.
+ * tt_var ::
+ * A pointer to the Metrics Variations service for the "truetype"
+ * driver.
+ *
+ * face_var ::
+ * A pointer to the Metrics Variations service for this `TT_Face`'s
+ * driver.
*
- * hdmx ::
- * The face's horizontal device metrics ('hdmx' table). This table is
- * optional in TrueType/OpenType fonts.
+ * psaux ::
+ * A pointer to the PostScript Auxiliary service.
*
* gasp ::
* The grid-fitting and scaling properties table ('gasp'). This table
@@ -1364,6 +1315,12 @@ FT_BEGIN_HEADER
* var_postscript_prefix_len ::
* The length of the `var_postscript_prefix` string.
*
+ * var_default_named_instance ::
+ * The index of the default named instance.
+ *
+ * non_var_style_name ::
+ * The non-variation style name, used as a backup.
+ *
* horz_metrics_size ::
* The size of the 'hmtx' table.
*
@@ -1372,7 +1329,7 @@ FT_BEGIN_HEADER
*
* num_locations ::
* The number of glyph locations in this TrueType file. This should be
- * identical to the number of glyphs. Ignored for Type 2 fonts.
+ * one more than the number of glyphs. Ignored for Type 2 fonts.
*
* glyph_locations ::
* An array of longs. These are offsets to glyph data within the
@@ -1390,8 +1347,8 @@ FT_BEGIN_HEADER
* hdmx_record_size ::
* The size of a single hdmx record.
*
- * hdmx_record_sizes ::
- * An array holding the ppem sizes available in the 'hdmx' table.
+ * hdmx_records ::
+ * A array of pointers to the 'hdmx' table records sorted by ppem.
*
* sbit_table ::
* A pointer to the font's embedded bitmap location table.
@@ -1410,14 +1367,6 @@ FT_BEGIN_HEADER
* A mapping between the strike indices exposed by the API and the
* indices used in the font's sbit table.
*
- * cpal ::
- * A pointer to data related to the 'CPAL' table. `NULL` if the table
- * is not available.
- *
- * colr ::
- * A pointer to data related to the 'COLR' table. `NULL` if the table
- * is not available.
- *
* kern_table ::
* A pointer to the 'kern' table.
*
@@ -1445,19 +1394,23 @@ FT_BEGIN_HEADER
* vert_metrics_offset ::
* The file offset of the 'vmtx' table.
*
- * sph_found_func_flags ::
- * Flags identifying special bytecode functions (used by the v38
- * implementation of the bytecode interpreter).
- *
- * sph_compatibility_mode ::
- * This flag is set if we are in ClearType backward compatibility mode
- * (used by the v38 implementation of the bytecode interpreter).
- *
* ebdt_start ::
* The file offset of the sbit data table (CBDT, bdat, etc.).
*
* ebdt_size ::
* The size of the sbit data table.
+ *
+ * cpal ::
+ * A pointer to data related to the 'CPAL' table. `NULL` if the table
+ * is not available.
+ *
+ * colr ::
+ * A pointer to data related to the 'COLR' table. `NULL` if the table
+ * is not available.
+ *
+ * svg ::
+ * A pointer to data related to the 'SVG' table. `NULL` if the table
+ * is not available.
*/
typedef struct TT_FaceRec_
{
@@ -1508,8 +1461,14 @@ FT_BEGIN_HEADER
void* mm;
/* a typeless pointer to the FT_Service_MetricsVariationsRec table */
- /* used to handle the HVAR, VVAR, and MVAR OpenType tables */
- void* var;
+ /* used to handle the HVAR, VVAR, and MVAR OpenType tables by the */
+ /* "truetype" driver */
+ void* tt_var;
+
+ /* a typeless pointer to the FT_Service_MetricsVariationsRec table */
+ /* used to handle the HVAR, VVAR, and MVAR OpenType tables by this */
+ /* TT_Face's driver */
+ void* face_var; /* since 2.13.1 */
#endif
/* a typeless pointer to the PostScript Aux service */
@@ -1591,6 +1550,9 @@ FT_BEGIN_HEADER
const char* var_postscript_prefix; /* since 2.7.2 */
FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
+ FT_UInt var_default_named_instance; /* since 2.13.1 */
+
+ const char* non_var_style_name; /* since 2.13.1 */
#endif
/* since version 2.2 */
@@ -1598,14 +1560,14 @@ FT_BEGIN_HEADER
FT_ULong horz_metrics_size;
FT_ULong vert_metrics_size;
- FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
+ FT_ULong num_locations; /* up to 0xFFFF + 1 */
FT_Byte* glyph_locations;
FT_Byte* hdmx_table;
FT_ULong hdmx_table_size;
FT_UInt hdmx_record_count;
FT_ULong hdmx_record_size;
- FT_Byte* hdmx_record_sizes;
+ FT_Byte** hdmx_records;
FT_Byte* sbit_table;
FT_ULong sbit_table_size;
@@ -1627,13 +1589,6 @@ FT_BEGIN_HEADER
FT_ULong horz_metrics_offset;
FT_ULong vert_metrics_offset;
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
- /* since 2.4.12 */
- FT_ULong sph_found_func_flags; /* special functions found */
- /* for this face */
- FT_Bool sph_compatibility_mode;
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
-
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
/* since 2.7 */
FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
@@ -1644,6 +1599,9 @@ FT_BEGIN_HEADER
void* cpal;
void* colr;
+ /* since 2.12 */
+ void* svg;
+
} TT_FaceRec;
@@ -1734,7 +1692,7 @@ FT_BEGIN_HEADER
FT_UInt glyph_index;
FT_Stream stream;
- FT_Int byte_len;
+ FT_UInt byte_len;
FT_Short n_contours;
FT_BBox bbox;
@@ -1769,6 +1727,9 @@ FT_BEGIN_HEADER
/* since version 2.6.2 */
FT_ListRec composites;
+ /* since version 2.11.2 */
+ FT_Byte* widthp;
+
} TT_LoaderRec;
diff --git a/src/3rdparty/freetype/include/freetype/internal/wofftypes.h b/src/3rdparty/freetype/include/freetype/internal/wofftypes.h
index 1874a138a0..0c1d8eeaf8 100644
--- a/src/3rdparty/freetype/include/freetype/internal/wofftypes.h
+++ b/src/3rdparty/freetype/include/freetype/internal/wofftypes.h
@@ -5,7 +5,7 @@
* Basic WOFF/WOFF2 type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
*/
typedef struct WOFF_TableRec_
{
- FT_ULong Tag; /* table ID */
+ FT_Tag Tag; /* table ID */
FT_ULong Offset; /* table file offset */
FT_ULong CompLength; /* compressed table length */
FT_ULong OrigLength; /* uncompressed table length */
@@ -191,7 +191,7 @@ FT_BEGIN_HEADER
typedef struct WOFF2_TableRec_
{
FT_Byte FlagByte; /* table type and flags */
- FT_ULong Tag; /* table file offset */
+ FT_Tag Tag; /* table file offset */
FT_ULong dst_length; /* uncompressed table length */
FT_ULong TransformLength; /* transformed length */
diff --git a/src/3rdparty/freetype/include/freetype/otsvg.h b/src/3rdparty/freetype/include/freetype/otsvg.h
new file mode 100644
index 0000000000..bfe9a6ab74
--- /dev/null
+++ b/src/3rdparty/freetype/include/freetype/otsvg.h
@@ -0,0 +1,336 @@
+/****************************************************************************
+ *
+ * otsvg.h
+ *
+ * Interface for OT-SVG support related things (specification).
+ *
+ * Copyright (C) 2022-2023 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * This file is part of the FreeType project, and may only be used,
+ * modified, and distributed under the terms of the FreeType project
+ * license, LICENSE.TXT. By continuing to use, modify, or distribute
+ * this file you indicate that you have read the license and
+ * understand and accept it fully.
+ *
+ */
+
+
+#ifndef OTSVG_H_
+#define OTSVG_H_
+
+#include <freetype/freetype.h>
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * svg_fonts
+ *
+ * @title:
+ * OpenType SVG Fonts
+ *
+ * @abstract:
+ * OT-SVG API between FreeType and an external SVG rendering library.
+ *
+ * @description:
+ * This section describes the four hooks necessary to render SVG
+ * 'documents' that are contained in an OpenType font's 'SVG~' table.
+ *
+ * For more information on the implementation, see our standard hooks
+ * based on 'librsvg' in the [FreeType Demo
+ * Programs](https://gitlab.freedesktop.org/freetype/freetype-demos)
+ * repository.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Init_Func
+ *
+ * @description:
+ * A callback that is called when the first OT-SVG glyph is rendered in
+ * the lifetime of an @FT_Library object. In a typical implementation,
+ * one would want to allocate a structure and point the `data_pointer`
+ * to it and perform any library initializations that might be needed.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef FT_Error
+ (*SVG_Lib_Init_Func)( FT_Pointer *data_pointer );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Free_Func
+ *
+ * @description:
+ * A callback that is called when the `ot-svg` module is being freed.
+ * It is only called if the init hook was called earlier. This means
+ * that neither the init nor the free hook is called if no OT-SVG glyph
+ * is rendered.
+ *
+ * In a typical implementation, one would want to free any state
+ * structure that was allocated in the init hook and perform any
+ * library-related closure that might be needed.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef void
+ (*SVG_Lib_Free_Func)( FT_Pointer *data_pointer );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Render_Func
+ *
+ * @description:
+ * A callback that is called to render an OT-SVG glyph. This callback
+ * hook is called right after the preset hook @SVG_Lib_Preset_Slot_Func
+ * has been called with `cache` set to `TRUE`. The data necessary to
+ * render is available through the handle @FT_SVG_Document, which is set
+ * in the `other` field of @FT_GlyphSlotRec.
+ *
+ * The render hook is expected to render the SVG glyph to the bitmap
+ * buffer that is allocated already at `slot->bitmap.buffer`. It also
+ * sets the `num_grays` value as well as `slot->format`.
+ *
+ * @input:
+ * slot ::
+ * The slot to render.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef FT_Error
+ (*SVG_Lib_Render_Func)( FT_GlyphSlot slot,
+ FT_Pointer *data_pointer );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Preset_Slot_Func
+ *
+ * @description:
+ * A callback that is called to preset the glyph slot. It is called from
+ * two places.
+ *
+ * 1. When `FT_Load_Glyph` needs to preset the glyph slot.
+ *
+ * 2. Right before the `svg` module calls the render callback hook.
+ *
+ * When it is the former, the argument `cache` is set to `FALSE`. When
+ * it is the latter, the argument `cache` is set to `TRUE`. This
+ * distinction has been made because many calculations that are necessary
+ * for presetting a glyph slot are the same needed later for the render
+ * callback hook. Thus, if `cache` is `TRUE`, the hook can _cache_ those
+ * calculations in a memory block referenced by the state pointer.
+ *
+ * This hook is expected to preset the slot by setting parameters such as
+ * `bitmap_left`, `bitmap_top`, `width`, `rows`, `pitch`, and
+ * `pixel_mode`. It is also expected to set all the metrics for the slot
+ * including the vertical advance if it is not already set. Typically,
+ * fonts have horizontal advances but not vertical ones. If those are
+ * available, they had already been set, otherwise they have to be
+ * estimated and set manually. The hook must take into account the
+ * transformations that have been set, and translate the transformation
+ * matrices into the SVG coordinate system, as the original matrix is
+ * intended for the TTF/CFF coordinate system.
+ *
+ * @input:
+ * slot ::
+ * The glyph slot that has the SVG document loaded.
+ *
+ * cache ::
+ * See description.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef FT_Error
+ (*SVG_Lib_Preset_Slot_Func)( FT_GlyphSlot slot,
+ FT_Bool cache,
+ FT_Pointer *state );
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * SVG_RendererHooks
+ *
+ * @description:
+ * A structure that stores the four hooks needed to render OT-SVG glyphs
+ * properly. The structure is publicly used to set the hooks via the
+ * @svg-hooks driver property.
+ *
+ * The behavior of each hook is described in its documentation. One
+ * thing to note is that the preset hook and the render hook often need
+ * to do the same operations; therefore, it's better to cache the
+ * intermediate data in a state structure to avoid calculating it twice.
+ * For example, in the preset hook one can draw the glyph on a recorder
+ * surface and later create a bitmap surface from it in the render hook.
+ *
+ * All four hooks must be non-NULL.
+ *
+ * @fields:
+ * init_svg ::
+ * The initialization hook.
+ *
+ * free_svg ::
+ * The cleanup hook.
+ *
+ * render_hook ::
+ * The render hook.
+ *
+ * preset_slot ::
+ * The preset hook.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct SVG_RendererHooks_
+ {
+ SVG_Lib_Init_Func init_svg;
+ SVG_Lib_Free_Func free_svg;
+ SVG_Lib_Render_Func render_svg;
+
+ SVG_Lib_Preset_Slot_Func preset_slot;
+
+ } SVG_RendererHooks;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_SVG_DocumentRec
+ *
+ * @description:
+ * A structure that models one SVG document.
+ *
+ * @fields:
+ * svg_document ::
+ * A pointer to the SVG document.
+ *
+ * svg_document_length ::
+ * The length of `svg_document`.
+ *
+ * metrics ::
+ * A metrics object storing the size information.
+ *
+ * units_per_EM ::
+ * The size of the EM square.
+ *
+ * start_glyph_id ::
+ * The first glyph ID in the glyph range covered by this document.
+ *
+ * end_glyph_id ::
+ * The last glyph ID in the glyph range covered by this document.
+ *
+ * transform ::
+ * A 2x2 transformation matrix to apply to the glyph while rendering
+ * it.
+ *
+ * delta ::
+ * The translation to apply to the glyph while rendering.
+ *
+ * @note:
+ * When an @FT_GlyphSlot object `slot` is passed down to a renderer, the
+ * renderer can only access the `metrics` and `units_per_EM` fields via
+ * `slot->face`. However, when @FT_Glyph_To_Bitmap sets up a dummy
+ * object, it has no way to set a `face` object. Thus, metrics
+ * information and `units_per_EM` (which is necessary for OT-SVG) has to
+ * be stored separately.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct FT_SVG_DocumentRec_
+ {
+ FT_Byte* svg_document;
+ FT_ULong svg_document_length;
+
+ FT_Size_Metrics metrics;
+ FT_UShort units_per_EM;
+
+ FT_UShort start_glyph_id;
+ FT_UShort end_glyph_id;
+
+ FT_Matrix transform;
+ FT_Vector delta;
+
+ } FT_SVG_DocumentRec;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_SVG_Document
+ *
+ * @description:
+ * A handle to an @FT_SVG_DocumentRec object.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct FT_SVG_DocumentRec_* FT_SVG_Document;
+
+
+FT_END_HEADER
+
+#endif /* OTSVG_H_ */
+
+
+/* END */
diff --git a/src/3rdparty/freetype/include/freetype/t1tables.h b/src/3rdparty/freetype/include/freetype/t1tables.h
index 426e14024e..1aecfbbd90 100644
--- a/src/3rdparty/freetype/include/freetype/t1tables.h
+++ b/src/3rdparty/freetype/include/freetype/t1tables.h
@@ -5,7 +5,7 @@
* Basic Type 1/Type 2 tables definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -360,7 +360,7 @@ FT_BEGIN_HEADER
FT_UInt num_subrs;
FT_ULong subrmap_offset;
- FT_Int sd_bytes;
+ FT_UInt sd_bytes;
} CID_FaceDictRec;
@@ -415,11 +415,11 @@ FT_BEGIN_HEADER
FT_ULong xuid[16];
FT_ULong cidmap_offset;
- FT_Int fd_bytes;
- FT_Int gd_bytes;
+ FT_UInt fd_bytes;
+ FT_UInt gd_bytes;
FT_ULong cid_count;
- FT_Int num_dicts;
+ FT_UInt num_dicts;
CID_FaceDict font_dicts;
FT_ULong data_offset;
@@ -453,22 +453,22 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Has_PS_Glyph_Names
+ * FT_Has_PS_Glyph_Names
*
* @description:
- * Return true if a given face provides reliable PostScript glyph names.
- * This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
- * certain fonts (mostly TrueType) contain incorrect glyph name tables.
+ * Return true if a given face provides reliable PostScript glyph names.
+ * This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
+ * certain fonts (mostly TrueType) contain incorrect glyph name tables.
*
- * When this function returns true, the caller is sure that the glyph
- * names returned by @FT_Get_Glyph_Name are reliable.
+ * When this function returns true, the caller is sure that the glyph
+ * names returned by @FT_Get_Glyph_Name are reliable.
*
* @input:
- * face ::
- * face handle
+ * face ::
+ * face handle
*
* @return:
- * Boolean. True if glyph names are reliable.
+ * Boolean. True if glyph names are reliable.
*
*/
FT_EXPORT( FT_Int )
@@ -478,30 +478,40 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Get_PS_Font_Info
+ * FT_Get_PS_Font_Info
*
* @description:
- * Retrieve the @PS_FontInfoRec structure corresponding to a given
- * PostScript font.
+ * Retrieve the @PS_FontInfoRec structure corresponding to a given
+ * PostScript font.
*
* @input:
- * face ::
- * PostScript face handle.
+ * face ::
+ * PostScript face handle.
*
* @output:
- * afont_info ::
- * Output font info structure pointer.
+ * afont_info ::
+ * A pointer to a @PS_FontInfoRec object.
*
* @return:
- * FreeType error code. 0~means success.
+ * FreeType error code. 0~means success.
*
* @note:
- * String pointers within the @PS_FontInfoRec structure are owned by the
- * face and don't need to be freed by the caller. Missing entries in
- * the font's FontInfo dictionary are represented by `NULL` pointers.
+ * String pointers within the @PS_FontInfoRec structure are owned by the
+ * face and don't need to be freed by the caller. Missing entries in the
+ * font's FontInfo dictionary are represented by `NULL` pointers.
+ *
+ * The following font formats support this feature: 'Type~1', 'Type~42',
+ * 'CFF', 'CID~Type~1'. For other font formats this function returns the
+ * `FT_Err_Invalid_Argument` error code.
*
- * If the font's format is not PostScript-based, this function will
- * return the `FT_Err_Invalid_Argument` error code.
+ * @example:
+ * ```
+ * PS_FontInfoRec font_info;
+ *
+ *
+ * error = FT_Get_PS_Font_Info( face, &font_info );
+ * ...
+ * ```
*
*/
FT_EXPORT( FT_Error )
@@ -512,29 +522,39 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Get_PS_Font_Private
+ * FT_Get_PS_Font_Private
*
* @description:
- * Retrieve the @PS_PrivateRec structure corresponding to a given
- * PostScript font.
+ * Retrieve the @PS_PrivateRec structure corresponding to a given
+ * PostScript font.
*
* @input:
- * face ::
- * PostScript face handle.
+ * face ::
+ * PostScript face handle.
*
* @output:
- * afont_private ::
- * Output private dictionary structure pointer.
+ * afont_private ::
+ * A pointer to a @PS_PrivateRec object.
*
* @return:
- * FreeType error code. 0~means success.
+ * FreeType error code. 0~means success.
*
* @note:
- * The string pointers within the @PS_PrivateRec structure are owned by
- * the face and don't need to be freed by the caller.
+ * The string pointers within the @PS_PrivateRec structure are owned by
+ * the face and don't need to be freed by the caller.
*
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument` error code.
+ * Only the 'Type~1' font format supports this feature. For other font
+ * formats this function returns the `FT_Err_Invalid_Argument` error
+ * code.
+ *
+ * @example:
+ * ```
+ * PS_PrivateRec font_private;
+ *
+ *
+ * error = FT_Get_PS_Font_Private( face, &font_private );
+ * ...
+ * ```
*
*/
FT_EXPORT( FT_Error )
@@ -693,67 +713,67 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Get_PS_Font_Value
+ * FT_Get_PS_Font_Value
*
* @description:
- * Retrieve the value for the supplied key from a PostScript font.
+ * Retrieve the value for the supplied key from a PostScript font.
*
* @input:
- * face ::
- * PostScript face handle.
+ * face ::
+ * PostScript face handle.
*
- * key ::
- * An enumeration value representing the dictionary key to retrieve.
+ * key ::
+ * An enumeration value representing the dictionary key to retrieve.
*
- * idx ::
- * For array values, this specifies the index to be returned.
+ * idx ::
+ * For array values, this specifies the index to be returned.
*
- * value ::
- * A pointer to memory into which to write the value.
+ * value ::
+ * A pointer to memory into which to write the value.
*
- * valen_len ::
- * The size, in bytes, of the memory supplied for the value.
+ * valen_len ::
+ * The size, in bytes, of the memory supplied for the value.
*
* @output:
- * value ::
- * The value matching the above key, if it exists.
+ * value ::
+ * The value matching the above key, if it exists.
*
* @return:
- * The amount of memory (in bytes) required to hold the requested value
- * (if it exists, -1 otherwise).
+ * The amount of memory (in bytes) required to hold the requested value
+ * (if it exists, -1 otherwise).
*
* @note:
- * The values returned are not pointers into the internal structures of
- * the face, but are 'fresh' copies, so that the memory containing them
- * belongs to the calling application. This also enforces the
- * 'read-only' nature of these values, i.e., this function cannot be
- * used to manipulate the face.
+ * The values returned are not pointers into the internal structures of
+ * the face, but are 'fresh' copies, so that the memory containing them
+ * belongs to the calling application. This also enforces the
+ * 'read-only' nature of these values, i.e., this function cannot be
+ * used to manipulate the face.
*
- * `value` is a void pointer because the values returned can be of
- * various types.
+ * `value` is a void pointer because the values returned can be of
+ * various types.
*
- * If either `value` is `NULL` or `value_len` is too small, just the
- * required memory size for the requested entry is returned.
+ * If either `value` is `NULL` or `value_len` is too small, just the
+ * required memory size for the requested entry is returned.
*
- * The `idx` parameter is used, not only to retrieve elements of, for
- * example, the FontMatrix or FontBBox, but also to retrieve name keys
- * from the CharStrings dictionary, and the charstrings themselves. It
- * is ignored for atomic values.
+ * The `idx` parameter is used, not only to retrieve elements of, for
+ * example, the FontMatrix or FontBBox, but also to retrieve name keys
+ * from the CharStrings dictionary, and the charstrings themselves. It
+ * is ignored for atomic values.
*
- * `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
- * get the value as in the font stream, you need to divide by 65536000.0
- * (to remove the FT_Fixed scale, and the x1000 scale).
+ * `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
+ * get the value as in the font stream, you need to divide by 65536000.0
+ * (to remove the FT_Fixed scale, and the x1000 scale).
*
- * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
- * be retrieved. So, for example, PostScript procedures such as NP, ND,
- * and RD are not available. Arbitrary keys are, obviously, not be
- * available either.
+ * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
+ * be retrieved. So, for example, PostScript procedures such as NP, ND,
+ * and RD are not available. Arbitrary keys are, obviously, not be
+ * available either.
*
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument` error code.
+ * If the font's format is not PostScript-based, this function returns
+ * the `FT_Err_Invalid_Argument` error code.
*
* @since:
- * 2.4.8
+ * 2.4.8
*
*/
FT_EXPORT( FT_Long )
diff --git a/src/3rdparty/freetype/include/freetype/ttnameid.h b/src/3rdparty/freetype/include/freetype/ttnameid.h
index 2b2ed4c613..e31c68b9ba 100644
--- a/src/3rdparty/freetype/include/freetype/ttnameid.h
+++ b/src/3rdparty/freetype/include/freetype/ttnameid.h
@@ -4,7 +4,7 @@
*
* TrueType name ID definitions (specification only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -591,7 +591,7 @@ FT_BEGIN_HEADER
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
#define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F
-#define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic*/ 0x0440
+#define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic */ 0x0440
#define TT_MS_LANGID_KISWAHILI_KENYA 0x0441
#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
diff --git a/src/3rdparty/freetype/include/freetype/tttables.h b/src/3rdparty/freetype/include/freetype/tttables.h
index c8fa35ef8e..a9f60e7620 100644
--- a/src/3rdparty/freetype/include/freetype/tttables.h
+++ b/src/3rdparty/freetype/include/freetype/tttables.h
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType tables definitions and interface
* (specification only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -424,8 +424,8 @@ FT_BEGIN_HEADER
/* only version 5 and higher: */
- FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
- FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
+ FT_UShort usLowerOpticalPointSize; /* in twips (1/20 points) */
+ FT_UShort usUpperOpticalPointSize; /* in twips (1/20 points) */
} TT_OS2;
diff --git a/src/3rdparty/freetype/include/freetype/tttags.h b/src/3rdparty/freetype/include/freetype/tttags.h
index 3c9fbd59d7..9bf4fca23f 100644
--- a/src/3rdparty/freetype/include/freetype/tttags.h
+++ b/src/3rdparty/freetype/include/freetype/tttags.h
@@ -4,7 +4,7 @@
*
* Tags for TrueType and OpenType tables (specification only).
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -95,6 +95,7 @@ FT_BEGIN_HEADER
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
+#define TTAG_SVG FT_MAKE_TAG( 'S', 'V', 'G', ' ' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
diff --git a/src/3rdparty/freetype/include/ft2build.h b/src/3rdparty/freetype/include/ft2build.h
index b4fd1f8c3e..58491ceea1 100644
--- a/src/3rdparty/freetype/include/ft2build.h
+++ b/src/3rdparty/freetype/include/ft2build.h
@@ -4,7 +4,7 @@
*
* FreeType 2 build and setup macros.
*
- * Copyright (C) 1996-2020 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,