From 8b662f5b767bb4172e4b1911ecb304bd0b4c5b40 Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Wed, 7 Jul 2010 21:58:48 +0200 Subject: [PATCH] Freeing memory in xml and adding poor mans kerning to bc-zint --- src/bc-zint.c | 7 +++++-- src/xml-label.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) 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); -- 2.39.5