summaryrefslogtreecommitdiff
path: root/include/libcss/font_face.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-12-04 21:06:24 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-12-04 21:06:24 +0000
commitd5a183e14d42560632a6aa270aede226215bb3d3 (patch)
tree31d7c6692a8267237ff3caa34fa5958e280ead24 /include/libcss/font_face.h
parentd153cb125a6a69e08a49c93f9774f86705aa9898 (diff)
downloadlibcss-d5a183e14d42560632a6aa270aede226215bb3d3.tar.gz
libcss-d5a183e14d42560632a6aa270aede226215bb3d3.tar.bz2
@font-face support. Credit: James Montgomerie
Things missing: parser tests; the following descriptors: font-feature-settings, font-stretch, font-variant, unicode-range. svn path=/trunk/libcss/; revision=13244
Diffstat (limited to 'include/libcss/font_face.h')
-rw-r--r--include/libcss/font_face.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/libcss/font_face.h b/include/libcss/font_face.h
new file mode 100644
index 0000000..6b18433
--- /dev/null
+++ b/include/libcss/font_face.h
@@ -0,0 +1,79 @@
+/*
+ * This file is part of LibCSS.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2011 Things Made Out Of Other Things Ltd.
+ * Written by James Montgomerie <jamie@th.ingsmadeoutofotherthin.gs>
+ */
+
+#ifndef libcss_font_face_h_
+#define libcss_font_face_h_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <libwapcaplet/libwapcaplet.h>
+
+#include <libcss/errors.h>
+#include <libcss/functypes.h>
+#include <libcss/properties.h>
+#include <libcss/types.h>
+
+typedef enum css_font_face_format {
+ CSS_FONT_FACE_FORMAT_UNSPECIFIED = 0x00,
+
+ CSS_FONT_FACE_FORMAT_WOFF = 0x01,
+ /* WOFF (Web Open Font Format); .woff */
+ CSS_FONT_FACE_FORMAT_OPENTYPE = 0x02,
+ /* TrueType or OpenType; .ttf, .otf */
+ CSS_FONT_FACE_FORMAT_EMBEDDED_OPENTYPE = 0x04,
+ /* Embedded OpenType; .eot */
+ CSS_FONT_FACE_FORMAT_SVG = 0x08,
+ /* SVG Font; .svg, .svgz */
+
+ CSS_FONT_FACE_FORMAT_UNKNOWN = 0x10,
+ /* Format specified, but not recognised */
+
+ /* We don't define CSS_FONT_FACE_SRC_FORMAT_TRUETYPE as might be
+ * expected, because the CSS3 specification
+ * (http://www.w3.org/TR/css3-fonts/, ยง4.3) says:
+ * "Given the overlap in common usage between TrueType and
+ * OpenType, the format hints "truetype" and "opentype" must be
+ * considered as synonymous"
+ * so we compute a hint of 'truetype' to css_font_face_format_opentype.
+ */
+} css_font_face_format;
+
+typedef enum css_font_face_location_type {
+ CSS_FONT_FACE_LOCATION_TYPE_UNSPECIFIED = 0,
+ CSS_FONT_FACE_LOCATION_TYPE_LOCAL = 1,
+ CSS_FONT_FACE_LOCATION_TYPE_URI = 2,
+} css_font_face_location_type;
+
+
+css_error css_font_face_get_font_family(
+ const css_font_face *font_face,
+ lwc_string **font_family);
+
+css_error css_font_face_count_srcs(const css_font_face *font_face,
+ uint32_t *count);
+css_error css_font_face_get_src(const css_font_face *font_face, uint32_t index,
+ const css_font_face_src **src);
+
+css_error css_font_face_src_get_location(const css_font_face_src *src,
+ lwc_string **location);
+
+css_font_face_location_type css_font_face_src_location_type(
+ const css_font_face_src *src);
+css_font_face_format css_font_face_src_format(const css_font_face_src *src);
+
+uint8_t css_font_face_font_style(const css_font_face *font_face);
+uint8_t css_font_face_font_weight(const css_font_face *font_face);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif