Changeset View
Changeset View
Standalone View
Standalone View
files/0003-truetype-Only-enable-subpixel-rendering-when-a-speci.patch
| Show All 12 Lines | |||||
| minimal TTF driver. | minimal TTF driver. | ||||
| Signed-off-by: Ikey Doherty <ikey@solus-project.com> | Signed-off-by: Ikey Doherty <ikey@solus-project.com> | ||||
| --- | --- | ||||
| src/truetype/ttobjs.c | 18 ++++++++++++++++-- | src/truetype/ttobjs.c | 18 ++++++++++++++++-- | ||||
| 1 file changed, 16 insertions(+), 2 deletions(-) | 1 file changed, 16 insertions(+), 2 deletions(-) | ||||
| diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c | diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c | ||||
| index ed3be2d..fbd86a9 100644 | index e4775a5..dad7769 100644 | ||||
| --- a/src/truetype/ttobjs.c | --- a/src/truetype/ttobjs.c | ||||
| +++ b/src/truetype/ttobjs.c | +++ b/src/truetype/ttobjs.c | ||||
| @@ -36,6 +36,8 @@ | @@ -36,6 +36,8 @@ | ||||
| #include "ttgxvar.h" | #include "ttgxvar.h" | ||||
| #endif | #endif | ||||
| +#include <unistd.h> | +#include <unistd.h> | ||||
| + | + | ||||
| /*************************************************************************/ | /************************************************************************** | ||||
| /* */ | * | ||||
| /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ | * The macro FT_COMPONENT is used in trace mode. It is an implicit | ||||
| @@ -1287,12 +1289,24 @@ | @@ -1415,12 +1417,24 @@ | ||||
| TT_Driver driver = (TT_Driver)ttdriver; | TT_Driver driver = (TT_Driver)ttdriver; | ||||
| + FT_Bool enable_subpixel = FALSE; | + FT_Bool enable_subpixel = FALSE; | ||||
| + | + | ||||
| + /* If the file path exists, allow the use of subpixel rendering. This | + /* If the file path exists, allow the use of subpixel rendering. This | ||||
| + * allows the library to be built with the functionality, but also to | + * allows the library to be built with the functionality, but also to | ||||
| + * disable the functionality with the removal of the package. | + * disable the functionality with the removal of the package. | ||||
| + */ | + */ | ||||
| +#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING | +#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING | ||||
| + if (access("/usr/share/fonts/enable_subpixel_rendering", F_OK) == 0) { | + if (access("/usr/share/fonts/enable_subpixel_rendering", F_OK) == 0) { | ||||
| + enable_subpixel = TRUE; | + enable_subpixel = TRUE; | ||||
| + } | + } | ||||
| +#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ | +#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ | ||||
| + | + | ||||
| driver->interpreter_version = TT_INTERPRETER_VERSION_35; | driver->interpreter_version = TT_INTERPRETER_VERSION_35; | ||||
| #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY | #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY | ||||
| - driver->interpreter_version = TT_INTERPRETER_VERSION_38; | - driver->interpreter_version = TT_INTERPRETER_VERSION_38; | ||||
| + driver->interpreter_version = enable_subpixel == TRUE ? TT_INTERPRETER_VERSION_38 : TT_INTERPRETER_VERSION_35; | + driver->interpreter_version = enable_subpixel == TRUE ? TT_INTERPRETER_VERSION_38 : TT_INTERPRETER_VERSION_35; | ||||
| #endif | #endif | ||||
| #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL | #ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL | ||||
| - driver->interpreter_version = TT_INTERPRETER_VERSION_40; | - driver->interpreter_version = TT_INTERPRETER_VERSION_40; | ||||
| + driver->interpreter_version = enable_subpixel == TRUE ? TT_INTERPRETER_VERSION_40 : TT_INTERPRETER_VERSION_35; | + driver->interpreter_version = enable_subpixel == TRUE ? TT_INTERPRETER_VERSION_40 : TT_INTERPRETER_VERSION_35; | ||||
| #endif | #endif | ||||
| #else /* !TT_USE_BYTECODE_INTERPRETER */ | #else /* !TT_USE_BYTECODE_INTERPRETER */ | ||||
| -- | -- | ||||
| 2.11.0 | 2.24.1 | ||||
Copyright © 2015-2021 Solus Project. The Solus logo is Copyright © 2016-2021 Solus Project. All Rights Reserved.