aboutsummaryrefslogtreecommitdiffstats
path: root/libfonts_parse_aa__.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-08 21:40:02 +0100
committerMattias Andrée <maandree@kth.se>2023-01-08 21:40:02 +0100
commit17a93f72f3343e6839f625972ba743ec61441c49 (patch)
tree7fc53e253e9e2aefad0f9a8d10edff0524198c75 /libfonts_parse_aa__.c
parentFix error handling (diff)
downloadlibfonts-17a93f72f3343e6839f625972ba743ec61441c49.tar.gz
libfonts-17a93f72f3343e6839f625972ba743ec61441c49.tar.bz2
libfonts-17a93f72f3343e6839f625972ba743ec61441c49.tar.xz
Partially implement libfonts_get_default_font, libfonts_get_{default,output}_rendering_settings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libfonts_parse_aa__.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/libfonts_parse_aa__.c b/libfonts_parse_aa__.c
new file mode 100644
index 0000000..5946b1c
--- /dev/null
+++ b/libfonts_parse_aa__.c
@@ -0,0 +1,51 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+#ifndef TEST
+
+
+#define LIST_ANTIALIASINGS(X)\
+ X(LIBFONTS_ANTIALIASING_UNSPECIFIED, "unspecified")\
+ X(LIBFONTS_ANTIALIASING_NONE, "none")\
+ X(LIBFONTS_ANTIALIASING_NONE, "aliased")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE, "greyscale")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE, "grayscale")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE, "grey")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE, "gray")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE, "antialiased")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "greyscale!")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "grayscale!")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "grey!")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "gray!")\
+ X(LIBFONTS_ANTIALIASING_GREYSCALE_FORCED, "antialiased!")\
+ X(LIBFONTS_ANTIALIASING_SUBPIXEL, "subpixel")\
+ X(LIBFONTS_ANTIALIASING_SUBPIXEL, "glitter")\
+ X(LIBFONTS_ANTIALIASING_SUBPIXEL_FORCED, "subpixel!")\
+ X(LIBFONTS_ANTIALIASING_SUBPIXEL_FORCED, "glitter!")
+
+int
+libfonts_parse_aa__(enum libfonts_antialiasing *outp, const char *value)
+{
+#define X(C, S)\
+ if (!strcasecmp(value, S)) {\
+ *outp = C;\
+ } else
+ LIST_ANTIALIASINGS(X) {
+ return 0;
+ }
+#undef X
+ return 1;
+
+}
+
+
+#else
+
+
+int
+main(void)
+{
+ return 0; /* TODO add test */
+}
+
+
+#endif