diff options
| author | Markus Engel <markus.engel@tum.de> | 2013-04-01 23:41:30 +0000 |
|---|---|---|
| committer | Markus Engel <markus.engel@tum.de> | 2013-04-01 23:41:30 +0000 |
| commit | 69f3b6f1abb2bb422935d43262e1e99aab359954 (patch) | |
| tree | e1e2d2b0504d22e81b04501155995f5694a4cd7b /src/sp-font-face.cpp | |
| parent | Added experimental constructor to SPRect. Memory leaks because of non-virtual... (diff) | |
| download | inkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.tar.gz inkscape-69f3b6f1abb2bb422935d43262e1e99aab359954.zip | |
Added constructors to SP classes.
(bzr r11608.1.67)
Diffstat (limited to 'src/sp-font-face.cpp')
| -rw-r--r-- | src/sp-font-face.cpp | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/src/sp-font-face.cpp b/src/sp-font-face.cpp index 5baff2751..d946c4f20 100644 --- a/src/sp-font-face.cpp +++ b/src/sp-font-face.cpp @@ -259,7 +259,7 @@ static std::vector<FontFaceStretchType> sp_read_fontFaceStretchType(gchar const return v; } -G_DEFINE_TYPE(SPFontFace, sp_fontface, SP_TYPE_OBJECT); +G_DEFINE_TYPE(SPFontFace, sp_fontface, G_TYPE_OBJECT); static void sp_fontface_class_init(SPFontFaceClass *fc) { @@ -272,8 +272,9 @@ CFontFace::CFontFace(SPFontFace* face) : CObject(face) { CFontFace::~CFontFace() { } -static void sp_fontface_init(SPFontFace *face) -{ +SPFontFace::SPFontFace() : SPObject() { + SPFontFace* face = this; + face->cfontface = new CFontFace(face); face->typeHierarchy.insert(typeid(SPFontFace)); @@ -296,7 +297,7 @@ static void sp_fontface_init(SPFontFace *face) stretch.push_back(SP_FONTFACE_STRETCH_NORMAL); face->font_stretch = stretch; face->font_family = NULL; - /* + //face->font_style = ; //face->font_variant = ; //face->font_weight = ; @@ -305,31 +306,36 @@ static void sp_fontface_init(SPFontFace *face) //face->unicode_range = ; face->units_per_em = 1000; //face->panose_1 = ; - face->stem_v = ; - face->stem_h = ; + face->stemv = 0; + face->stemh = 0; face->slope = 0; - face->cap_height = ; - face->x_height = ; - face->accent_height = ; - face->ascent = ; - face->descent = ; + face->cap_height = 0; + face->x_height = 0; + face->accent_height = 0; + face->ascent = 0; + face->descent = 0; face->widths = NULL; face->bbox = NULL; - face->ideographic = ; - face->alphabetic = ; - face->mathematical = ; - face->hanging = ; - face->v_ideographic = ; - face->v_alphabetic = ; - face->v_mathematical = ; - face->v_hanging = ; - face->underline_position = ; - face->underline_thickness = ; - face->strikethrough_position = ; - face->strikethrough_thickness = ; - face->overline_position = ; - face->overline_thickness = ; -*/ + face->ideographic = 0; + face->alphabetic = 0; + face->mathematical = 0; + face->hanging = 0; + face->v_ideographic = 0; + face->v_alphabetic = 0; + face->v_mathematical = 0; + face->v_hanging = 0; + face->underline_position = 0; + face->underline_thickness = 0; + face->strikethrough_position = 0; + face->strikethrough_thickness = 0; + face->overline_position = 0; + face->overline_thickness = 0; + +} + +static void sp_fontface_init(SPFontFace *face) +{ + new (face) SPFontFace(); } |
