146
145
static void sp_glyph_set(SPObject *object, unsigned int key, const gchar *value)
148
147
SPGlyph *glyph = SP_GLYPH(object);
150
glyphOrientation orient;
151
glyphArabicForm form;
154
150
case SP_ATTR_UNICODE:
155
152
glyph->unicode.clear();
156
153
if (value) glyph->unicode.append(value);
157
154
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
159
157
case SP_ATTR_GLYPH_NAME:
160
159
glyph->glyph_name.clear();
161
160
if (value) glyph->glyph_name.append(value);
162
161
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
165
166
if (glyph->d) g_free(glyph->d);
166
167
glyph->d = g_strdup(value);
167
168
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
169
171
case SP_ATTR_ORIENTATION:
170
orient = sp_glyph_read_orientation(value);
173
glyphOrientation orient = sp_glyph_read_orientation(value);
171
174
if (glyph->orientation != orient){
172
175
glyph->orientation = orient;
173
176
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
176
180
case SP_ATTR_ARABIC_FORM:
177
form = sp_glyph_read_arabic_form(value);
182
glyphArabicForm form = sp_glyph_read_arabic_form(value);
178
183
if (glyph->arabic_form != form){
179
184
glyph->arabic_form = form;
180
185
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
183
189
case SP_ATTR_LANG:
184
191
if (glyph->lang) g_free(glyph->lang);
185
192
glyph->lang = g_strdup(value);
186
193
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
188
case SP_ATTR_HORIZ_ADV_X:
189
number = helperfns_read_number(value);
196
case SP_ATTR_HORIZ_ADV_X:
198
double number = value ? g_ascii_strtod(value, 0) : 0;
190
199
if (number != glyph->horiz_adv_x){
191
200
glyph->horiz_adv_x = number;
192
201
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
195
case SP_ATTR_VERT_ORIGIN_X:
196
number = helperfns_read_number(value);
205
case SP_ATTR_VERT_ORIGIN_X:
207
double number = value ? g_ascii_strtod(value, 0) : 0;
197
208
if (number != glyph->vert_origin_x){
198
209
glyph->vert_origin_x = number;
199
210
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
202
case SP_ATTR_VERT_ORIGIN_Y:
203
number = helperfns_read_number(value);
214
case SP_ATTR_VERT_ORIGIN_Y:
216
double number = value ? g_ascii_strtod(value, 0) : 0;
204
217
if (number != glyph->vert_origin_y){
205
218
glyph->vert_origin_y = number;
206
219
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
209
case SP_ATTR_VERT_ADV_Y:
210
number = helperfns_read_number(value);
223
case SP_ATTR_VERT_ADV_Y:
225
double number = value ? g_ascii_strtod(value, 0) : 0;
211
226
if (number != glyph->vert_adv_y){
212
227
glyph->vert_adv_y = number;
213
228
object->requestModified(SP_OBJECT_MODIFIED_FLAG);
217
234
if (((SPObjectClass *) (parent_class))->set) {
218
235
((SPObjectClass *) (parent_class))->set(object, key, value);