summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2018-06-10 09:12:24 +0200
committerWerner Lemberg <wl@gnu.org>2018-06-10 09:13:13 +0200
commit6732f05593930621081092c7e2c2ec8ec043cc2d (patch)
treeaf32ffde9c04a22e6a300bd1648c9396f50701bc
parent56be5f721b46a9cc5fc043e5ad4eca57398fb37d (diff)
downloadfreetype2-6732f05593930621081092c7e2c2ec8ec043cc2d.tar.gz
Implement `FT_Palette_Get'.
* src/base/ftcolor.c: New file. * src/base/Jamefile (_sources), src/base/rules.mk (BASE_SRC), src/base/ftbase.c: Add `ftcolor.c'.
-rw-r--r--ChangeLog9
-rw-r--r--src/base/Jamfile1
-rw-r--r--src/base/ftbase.c1
-rw-r--r--src/base/ftcolor.c66
-rw-r--r--src/base/rules.mk1
5 files changed, 78 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d295c25c1..eadba3971 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2018-06-10 Werner Lemberg <wl@gnu.org>
+ Implement `FT_Palette_Get'.
+
+ * src/base/ftcolor.c: New file.
+
+ * src/base/Jamefile (_sources), src/base/rules.mk (BASE_SRC),
+ src/base/ftbase.c: Add `ftcolor.c'.
+
+2018-06-10 Werner Lemberg <wl@gnu.org>
+
* src/sfnt/ttcolr.c (tt_face_load_colr): Improve overflow checks.
2018-06-09 Alexei Podtelezhnikov <apodtele@gmail.com>
diff --git a/src/base/Jamfile b/src/base/Jamfile
index 4994c1b4c..5bee6e2fc 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -20,6 +20,7 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
_sources = basepic
ftadvanc
ftcalc
+ ftcolor
ftdbgmem
ftfntfmt
ftgloadr
diff --git a/src/base/ftbase.c b/src/base/ftbase.c
index 47412fc55..5f7d818aa 100644
--- a/src/base/ftbase.c
+++ b/src/base/ftbase.c
@@ -21,6 +21,7 @@
#include "ftadvanc.c"
#include "ftcalc.c"
+#include "ftcolor.c"
#include "ftdbgmem.c"
#include "ftfntfmt.c"
#include "ftgloadr.c"
diff --git a/src/base/ftcolor.c b/src/base/ftcolor.c
new file mode 100644
index 000000000..441eda3dc
--- /dev/null
+++ b/src/base/ftcolor.c
@@ -0,0 +1,66 @@
+/****************************************************************************
+ *
+ * ftcolor.c
+ *
+ * FreeType's glyph color management (body).
+ *
+ * Copyright 2018 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.
+ *
+ */
+
+
+#include <ft2build.h>
+#include FT_INTERNAL_DEBUG_H
+#include FT_INTERNAL_TRUETYPE_TYPES_H
+#include FT_COLOR_H
+
+
+#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
+
+ static
+ const FT_Palette null_palette = { 0, NULL, NULL, 0, NULL };
+
+
+ /* documentation is in ftcolor.h */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Get( FT_Face face,
+ FT_Palette *apalette )
+ {
+ if ( !face )
+ return FT_THROW( Invalid_Face_Handle );
+ if ( !apalette)
+ return FT_THROW( Invalid_Argument );
+
+ if ( FT_IS_SFNT( face ) )
+ *apalette = ( (TT_Face)face )->palette;
+ else
+ *apalette = null_palette;
+
+ return FT_Err_Ok;
+ }
+
+#else /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+ FT_EXPORT_DEF( FT_Error )
+ FT_Palette_Get( FT_Face face,
+ FT_Palette *apalette )
+ {
+ FT_UNUSED( face );
+ FT_UNUSED( apalette );
+
+
+ return FT_THROW( Unimplemented_Feature );
+ }
+
+#endif /* !TT_CONFIG_OPTION_COLOR_LAYERS */
+
+
+/* END */
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 3bd2b889b..214fd778f 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -38,6 +38,7 @@ BASE_COMPILE := $(CC) $(ANSIFLAGS) \
#
BASE_SRC := $(BASE_DIR)/ftadvanc.c \
$(BASE_DIR)/ftcalc.c \
+ $(BASE_DIR)/ftcolor.c \
$(BASE_DIR)/ftdbgmem.c \
$(BASE_DIR)/ftfntfmt.c \
$(BASE_DIR)/ftgloadr.c \