]> git.sur5r.net Git - glabels/commitdiff
Freeing memory in xml and adding poor mans kerning to bc-zint
authorSam Lown <me@samlown.com>
Wed, 7 Jul 2010 19:58:48 +0000 (21:58 +0200)
committerJim Evins <evins@snaught.com>
Sat, 10 Jul 2010 04:17:46 +0000 (00:17 -0400)
src/bc-zint.c
src/xml-label.c

index c50160fc6b57ba5fafd29d04ceaba7dd420fb63a..3ee26acb5e271189c39b4ddb3a9995fee8414c60 100644 (file)
@@ -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];
index 578a1a09a5b9ba03b9fff794f6274105fc5bd481..a0d9c4fe58a8410d40aba2a59337b5ca861ba925 100644 (file)
@@ -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);