1 #ifdef HAVE_CONFIG_H
2 # include <config.h>
3 #endif
5 #ifdef ENABLE_SVG_FONTS
6 #ifndef __SP_FONTFACE_H__
7 #define __SP_FONTFACE_H__
9 /*
10 * SVG <font-face> element implementation
11 *
12 * Section 20.8.3 of the W3C SVG 1.1 spec
13 * available at:
14 * http://www.w3.org/TR/SVG/fonts.html#FontFaceElement
15 *
16 * Authors:
17 * Felipe C. da S. Sanches <felipe.sanches@gmail.com>
18 *
19 * Copyright (C) 2008 Felipe C. da S. Sanches
20 *
21 * Released under GNU GPL, read the file 'COPYING' for more information
22 */
24 #include "sp-object.h"
26 #define SP_TYPE_FONTFACE (sp_fontface_get_type ())
27 #define SP_FONTFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_FONTFACE, SPFontFace))
28 #define SP_FONTFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_FONTFACE, SPFontFaceClass))
29 #define SP_IS_FONTFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_FONTFACE))
30 #define SP_IS_FONTFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SP_TYPE_FONTFACE))
32 enum FontFaceStyleType{
33 SP_FONTFACE_STYLE_ALL,
34 SP_FONTFACE_STYLE_NORMAL,
35 SP_FONTFACE_STYLE_ITALIC,
36 SP_FONTFACE_STYLE_OBLIQUE
37 };
39 enum FontFaceVariantType{
40 SP_FONTFACE_VARIANT_NORMAL,
41 SP_FONTFACE_VARIANT_SMALL_CAPS
42 };
44 enum FontFaceWeightType{
45 SP_FONTFACE_WEIGHT_ALL,
46 SP_FONTFACE_WEIGHT_NORMAL,
47 SP_FONTFACE_WEIGHT_BOLD,
48 SP_FONTFACE_WEIGHT_100,
49 SP_FONTFACE_WEIGHT_200,
50 SP_FONTFACE_WEIGHT_300,
51 SP_FONTFACE_WEIGHT_400,
52 SP_FONTFACE_WEIGHT_500,
53 SP_FONTFACE_WEIGHT_600,
54 SP_FONTFACE_WEIGHT_700,
55 SP_FONTFACE_WEIGHT_800,
56 SP_FONTFACE_WEIGHT_900
57 };
59 enum FontFaceStretchType{
60 SP_FONTFACE_STRETCH_ALL,
61 SP_FONTFACE_STRETCH_NORMAL,
62 SP_FONTFACE_STRETCH_ULTRA_CONDENSED,
63 SP_FONTFACE_STRETCH_EXTRA_CONDENSED,
64 SP_FONTFACE_STRETCH_CONDENSED,
65 SP_FONTFACE_STRETCH_SEMI_CONDENSED,
66 SP_FONTFACE_STRETCH_SEMI_EXPANDED,
67 SP_FONTFACE_STRETCH_EXPANDED,
68 SP_FONTFACE_STRETCH_EXTRA_EXPANDED,
69 SP_FONTFACE_STRETCH_ULTRA_EXPANDED
70 };
72 enum FontFaceUnicodeRangeType{
73 FONTFACE_UNICODERANGE_FIXME_HERE,
74 };
76 struct SPFontFace : public SPObject {
77 char* font_family;
78 std::vector<FontFaceStyleType> font_style;
79 std::vector<FontFaceVariantType> font_variant;
80 std::vector<FontFaceWeightType> font_weight;
81 std::vector<FontFaceStretchType> font_stretch;
82 char* font_size;
83 std::vector<FontFaceUnicodeRangeType> unicode_range;
84 double units_per_em;
85 std::vector<int> panose_1;
86 double stemv;
87 double stemh;
88 double slope;
89 double cap_height;
90 double x_height;
91 double accent_height;
92 double ascent;
93 double descent;
94 char* widths;
95 char* bbox;
96 double ideographic;
97 double alphabetic;
98 double mathematical;
99 double hanging;
100 double v_ideographic;
101 double v_alphabetic;
102 double v_mathematical;
103 double v_hanging;
104 double underline_position;
105 double underline_thickness;
106 double strikethrough_position;
107 double strikethrough_thickness;
108 double overline_position;
109 double overline_thickness;
110 };
112 struct SPFontFaceClass {
113 SPObjectClass parent_class;
114 };
116 GType sp_fontface_get_type (void);
118 #endif //#ifndef __SP_FONTFACE_H__
119 #endif //#ifdef ENABLE_SVG_FONTS