From: Jim Evins Date: Sat, 31 Jan 2004 05:15:08 +0000 (+0000) Subject: 2004-01-31 Jim Evins X-Git-Tag: glabels-2_3_0~488 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=66a83b58e4427fffbb7181528d6754a31513de07;p=glabels 2004-01-31 Jim Evins * AUTHORS: * data/avery-us-templates.xml: Added entries for "LSK-3," "LSK-5," and "LSK-8." Submitted by JBadger. * libglabels/template.c: (read_template_files_from_dir): Corrected problem with testing for extensions. * src/object-editor.glade: Corrected grouping of radio buttons in barcode data page. * src/print.c: (draw_barcode_object): * src/view-barcode.c: (draw_barcode): Corrected problem with calculation of y_offset for locating characters. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@408 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/AUTHORS b/glabels2/AUTHORS index f0f93f86..f18f0913 100644 --- a/glabels2/AUTHORS +++ b/glabels2/AUTHORS @@ -127,5 +127,6 @@ particular products (I apologize if I have missed anybody): Wayne Schuller Thomas Vill Fred Bacon + JBadger And many others for their many helpful suggestions and bug reports -- thanks. diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 35c172f6..829ba633 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,19 @@ +2004-01-31 Jim Evins + + * AUTHORS: + * data/avery-us-templates.xml: + Added entries for "LSK-3," "LSK-5," and "LSK-8." Submitted by JBadger. + + * libglabels/template.c: (read_template_files_from_dir): + Corrected problem with testing for extensions. + + * src/object-editor.glade: + Corrected grouping of radio buttons in barcode data page. + + * src/print.c: (draw_barcode_object): + * src/view-barcode.c: (draw_barcode): + Corrected problem with calculation of y_offset for locating characters. + 2004-01-24 Jim Evins * AUTHORS: diff --git a/glabels2/data/avery-us-templates.xml b/glabels2/data/avery-us-templates.xml index 12154dc9..b83e1bee 100644 --- a/glabels2/data/avery-us-templates.xml +++ b/glabels2/data/avery-us-templates.xml @@ -457,6 +457,49 @@ + + + + + + + + + + + + + diff --git a/glabels2/libglabels/template.c b/glabels2/libglabels/template.c index 248d7854..21cbfced 100644 --- a/glabels2/libglabels/template.c +++ b/glabels2/libglabels/template.c @@ -927,21 +927,16 @@ read_template_files_from_dir (GList *templates, extension = strrchr (filename, '.'); extension2 = strrchr (filename, '-'); - if (extension != NULL) { + if ( (extension && (g_strcasecmp (extension, ".template") == 0)) || + (extension2 && (g_strcasecmp (extension2, "-templates.xml") == 0)) ) { - if ( (g_strcasecmp (extension, ".template") == 0) - || (g_strcasecmp (extension2, "-templates.xml") == 0) ) { - - full_filename = - g_build_filename (dirname, filename, NULL); - new_templates = - gl_xml_template_read_templates_from_file (full_filename); - g_free (full_filename); - - templates = g_list_concat (templates, new_templates); - new_templates = NULL; - } + full_filename = g_build_filename (dirname, filename, NULL); + new_templates = + gl_xml_template_read_templates_from_file (full_filename); + g_free (full_filename); + templates = g_list_concat (templates, new_templates); + new_templates = NULL; } } diff --git a/glabels2/src/object-editor.glade b/glabels2/src/object-editor.glade index d2ed9164..e167c6ea 100644 --- a/glabels2/src/object-editor.glade +++ b/glabels2/src/object-editor.glade @@ -1298,6 +1298,7 @@ False False True + data_literal_radio 0 diff --git a/glabels2/src/print.c b/glabels2/src/print.c index a45ce8ef..769cac6b 100644 --- a/glabels2/src/print.c +++ b/glabels2/src/print.c @@ -1034,12 +1034,12 @@ draw_barcode_object (PrintInfo *pi, gnome_print_setopacity (pi->pc, GL_COLOR_F_ALPHA (color)); - y_offset = 12.0 - gnome_font_get_descender (font); + y_offset = 12.0 - fabs (gnome_font_get_descender (font)); gnome_print_moveto (pi->pc, 0.0, y_offset); gnome_print_gsave (pi->pc); gnome_print_scale (pi->pc, 1.0, -1.0); - gnome_print_show (pi->pc, _("Invalid barcode")); + gnome_print_show (pi->pc, _("Invalid barcode data")); gnome_print_grestore (pi->pc); } else { @@ -1076,9 +1076,9 @@ draw_barcode_object (PrintInfo *pi, GL_COLOR_F_ALPHA (color)); y_offset = - bchar->y + bchar->fsize - - gnome_font_get_descender (font); - gnome_print_moveto (pi->pc, bchar->x, y_offset); + bchar->fsize - fabs (gnome_font_get_descender (font)); + + gnome_print_moveto (pi->pc, bchar->x, bchar->y+y_offset); cstring = g_strdup_printf ("%c", bchar->c); gnome_print_gsave (pi->pc); diff --git a/glabels2/src/view-barcode.c b/glabels2/src/view-barcode.c index 8726eb65..6b5dc852 100644 --- a/glabels2/src/view-barcode.c +++ b/glabels2/src/view-barcode.c @@ -568,14 +568,14 @@ draw_barcode (glViewBarcode *view_barcode) gbc = gl_barcode_new (style, text_flag, checksum_flag, w, h, digits); if (gbc == NULL) { - cstring = _("Invalid barcode"); + cstring = _("Invalid barcode data"); glyphlist = gnome_glyphlist_from_text_sized_dumb (font, color, 0.0, 0.0, cstring, strlen (cstring)); - y_offset = 10.0 - gnome_font_get_descender (font); + y_offset = 10.0 - fabs (gnome_font_get_descender (font)); item = gl_view_object_item_new (GL_VIEW_OBJECT(view_barcode), gl_canvas_hacktext_get_type (), "x", 0.0, @@ -622,7 +622,8 @@ draw_barcode (glViewBarcode *view_barcode) c), 1); y_offset = - bchar->fsize - gnome_font_get_descender (font); + bchar->fsize - fabs (gnome_font_get_descender (font)); + item = gl_view_object_item_new (GL_VIEW_OBJECT(view_barcode), gl_canvas_hacktext_get_type (), "x", bchar->x,