Re: diff for libgnomeprint2



Hello!

No problem about making units case-independent.
But the other changes involve incompatible API change, and so I have to 
get permission for that ;-)

I am all for changing this. If not, I can define existing methods, as
implicitly creating/referencing/using hidden pangoft2 context, and add
new methods named ..._with_context...

Lauris

On Tue, 2001-12-11 at 04:32, Jody Goldberg wrote:
> - uses g_strcasecmp to avoid some warnings
> - Adds a pango context to some of the font apis to match pango.
> ----
> 

> ? print2.diff
> ? po/po2tbl.sed
> ? po/po2tbl.sed.in
> Index: libgnomeprint/gnome-font.c
> ===================================================================
> RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-font.c,v
> retrieving revision 1.78
> diff -u -w -r1.78 gnome-font.c
> --- libgnomeprint/gnome-font.c	2001/11/28 09:56:54	1.78
> +++ libgnomeprint/gnome-font.c	2001/12/11 02:30:53
> @@ -623,7 +623,9 @@
>   */
>  
>  PangoFont *
> -gnome_font_get_closest_pango_font (const GnomeFont *font, PangoFontMap *map, gdouble dpi)
> +gnome_font_get_closest_pango_font (const GnomeFont *font,
> +				   PangoFontMap *map, PangoContext *context,
> +				   gdouble dpi)
>  {
>  	PangoFontDescription *desc;
>  	PangoFont *pfont;
> @@ -637,7 +639,7 @@
>  	desc = gnome_font_get_pango_description (font, dpi);
>  	g_return_val_if_fail (desc != NULL, NULL);
>  
> -	pfont = pango_font_map_load_font (map, NULL, desc);
> +	pfont = pango_font_map_load_font (map, context, desc);
>  
>  	pango_font_description_free (desc);
>  
> Index: libgnomeprint/gnome-font.h
> ===================================================================
> RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-font.h,v
> retrieving revision 1.40
> diff -u -w -r1.40 gnome-font.h
> --- libgnomeprint/gnome-font.h	2001/08/13 16:01:10	1.40
> +++ libgnomeprint/gnome-font.h	2001/12/11 02:30:54
> @@ -151,7 +151,9 @@
>   * solution.
>   */
>  
> -PangoFont *gnome_font_get_closest_pango_font (const GnomeFont *font, PangoFontMap *map, gdouble dpi);
> +PangoFont *gnome_font_get_closest_pango_font (const GnomeFont *font,
> +					      PangoFontMap *map, PangoContext *context,
> +					      gdouble dpi);
>  PangoFontDescription *gnome_font_get_pango_description (const GnomeFont *font, gdouble dpi);
>  
>  /*
> Index: libgnomeprint/gnome-print-paper.c
> ===================================================================
> RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-print-paper.c,v
> retrieving revision 1.22
> diff -u -w -r1.22 gnome-print-paper.c
> --- libgnomeprint/gnome-print-paper.c	2001/12/09 02:31:31	1.22
> +++ libgnomeprint/gnome-print-paper.c	2001/12/11 02:30:54
> @@ -119,7 +119,7 @@
>  	if (!gp_papers) gnome_print_papers_load ();
>  
>  	for (l = gp_papers; l != NULL; l = l->next) {
> -		if (!strcasecmp (name, ((GnomePrintPaper *) l->data)->name)) return l->data;
> +		if (!g_strcasecmp (name, ((GnomePrintPaper *) l->data)->name)) return l->data;
>  	}
>  
>  	return NULL;
> @@ -242,7 +242,7 @@
>  	g_return_val_if_fail (name != NULL, NULL);
>  
>  	for (i = 0; i < gp_num_units; i++) {
> -		if (!strcasecmp (name, gp_units[i].name)) return &gp_units[i];
> +		if (!g_strcasecmp (name, gp_units[i].name)) return &gp_units[i];
>  	}
>  
>  	return NULL;
> @@ -256,7 +256,7 @@
>  	g_return_val_if_fail (abbreviation != NULL, NULL);
>  
>  	for (i = 0; i < gp_num_units; i++) {
> -		if (!strcasecmp (abbreviation, gp_units[i].abbr)) return &gp_units[i];
> +		if (!g_strcasecmp (abbreviation, gp_units[i].abbr)) return &gp_units[i];
>  	}
>  
>  	return NULL;
> Index: libgnomeprint/gnome-rfont.c
> ===================================================================
> RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-rfont.c,v
> retrieving revision 1.27
> diff -u -w -r1.27 gnome-rfont.c
> --- libgnomeprint/gnome-rfont.c	2001/08/13 16:01:11	1.27
> +++ libgnomeprint/gnome-rfont.c	2001/12/11 02:30:55
> @@ -531,7 +531,8 @@
>   */
>  
>  PangoFont *
> -gnome_rfont_get_closest_pango_font (const GnomeRFont *rfont, PangoFontMap *map)
> +gnome_rfont_get_closest_pango_font (const GnomeRFont *rfont,
> +				    PangoContext *context, PangoFontMap *map)
>  {
>  	gdouble dx, dy, dpi;
>  
> @@ -547,7 +548,7 @@
>  
>  	dpi = sqrt (dx * dy * 0.5);
>  
> -	return gnome_font_get_closest_pango_font (rfont->font, map, dpi);
> +	return gnome_font_get_closest_pango_font (rfont->font, map, context, dpi);
>  }
>  
>  PangoFontDescription *
> Index: libgnomeprint/gnome-rfont.h
> ===================================================================
> RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/gnome-rfont.h,v
> retrieving revision 1.9
> diff -u -w -r1.9 gnome-rfont.h
> --- libgnomeprint/gnome-rfont.h	2001/08/13 16:01:11	1.9
> +++ libgnomeprint/gnome-rfont.h	2001/12/11 02:30:55
> @@ -111,7 +111,9 @@
>   * solution.
>   */
>  
> -PangoFont *gnome_rfont_get_closest_pango_font (const GnomeRFont *rfont, PangoFontMap *map);
> +PangoFont *gnome_rfont_get_closest_pango_font (const GnomeRFont *rfont,
> +					       PangoContext *context,
> +					       PangoFontMap *map);
>  PangoFontDescription *gnome_rfont_get_pango_description (const GnomeRFont *rfont);
>  
>  G_END_DECLS





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]