From: Sam Lown Date: Wed, 7 Jul 2010 19:58:48 +0000 (+0200) Subject: Freeing memory in xml and adding poor mans kerning to bc-zint X-Git-Tag: glabels-2_3_1~213^2~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8b662f5b767bb4172e4b1911ecb304bd0b4c5b40;p=glabels Freeing memory in xml and adding poor mans kerning to bc-zint --- diff --git a/src/bc-zint.c b/src/bc-zint.c index c50160fc..3ee26acb 100644 --- a/src/bc-zint.c +++ b/src/bc-zint.c @@ -182,7 +182,7 @@ gl_barcode_zint_new (const gchar *id, static glBarcode *render_zint(struct zint_symbol *symbol, gboolean text_flag) { int i; - double string_offset; + double string_offset, x; glBarcode *gbc; glBarcodeShapeLine *line; @@ -215,8 +215,11 @@ static glBarcode *render_zint(struct zint_symbol *symbol, gboolean text_flag) { for ( zstring = render->strings; zstring != NULL; zstring = zstring->next ) { string_offset = (double) zstring->x - (((6.0 / 9.0) * zstring->length * zstring->fsize) / 2); for(i = 0; i < zstring->length; i++) { + x = 0.0; + // Poor man's kerning + if (zstring->text[i] == '(') { x = 0.18; } bchar = gl_barcode_shape_alpha_new(); - bchar->x = (double) string_offset + ((6.0 / 9.0) * i * zstring->fsize); + bchar->x = (double) string_offset + ((((6.0 / 9.0) * i) + x) * zstring->fsize); bchar->y = (double) zstring->y; bchar->fsize = (double) zstring->fsize; bchar->c = (char) zstring->text[i]; diff --git a/src/xml-label.c b/src/xml-label.c index 578a1a09..a0d9c4fe 100644 --- a/src/xml-label.c +++ b/src/xml-label.c @@ -1053,6 +1053,7 @@ xml_parse_toplevel_span (xmlNodePtr node, } } + g_free (strip_regex); if ( text_nodes ) { /* Store last line. */ lines = g_list_append (lines, text_nodes);