gdImagePtr image;
int bg_color;
unsigned char *title;
- int allocated, len;
+ int title_len;
+ int allocated;
MSymbol utf8;
char *family_names = NULL;
utf8 = msymbol ("utf-8");
allocated = nchars * 4; /* Usually this is enough. */
title = malloc (allocated);
- len = mconv_encode_buffer (utf8, mt, title, allocated);
- while (len < 0 && merror_code == MCONVERSION_RESULT_INSUFFICIENT_DST)
+ title_len = mconv_encode_buffer (utf8, mt, title, allocated);
+ while (title_len < 0 && merror_code == MCONVERSION_RESULT_INSUFFICIENT_DST)
{
allocated += allocated;
title = realloc (title, allocated);
- len = mconv_encode_buffer (utf8, mt, title, allocated);
+ title_len = mconv_encode_buffer (utf8, mt, title, allocated);
}
- if (len < 0)
+ if (title_len < 0)
{
fprintf (stderr, "Encoding of native language name failed.");
exit (1);
}
- title[len] = '\0';
+ title[title_len] = '\0';
{
MPlist *param = mplist ();
mplist_add (param, Mdevice, msymbol ("gd"));
mplist_add (param, Mface, face);
frame = mframe (param);
+ m17n_object_unref (fontset);
m17n_object_unref (face);
m17n_object_unref (param);
guchar *pixels, *p;
int x, y;
PangoAttrList *attr_list;
- PangoAttribute *attr_size, *attr_family;
+ PangoAttribute *attr_size;
gtk_init (&argc, &argv);
attr_list = pango_attr_list_new ();
attr_size = pango_attr_size_new (FONT_PT_SIZE * PANGO_SCALE);
- attr_family = family_names ? pango_attr_family_new (family_names) : NULL;
-#if 0
- if (attr_family)
- pango_attr_list_change (attr_list, attr_family);
-#endif
- pango_attr_list_change (attr_list, attr_size);
+ attr_size->start_index = 0, attr_size->end_index = title_len;
+ pango_attr_list_insert (attr_list, attr_size);
+ if (family_names)
+ {
+ PangoAttribute *attr_family;
+
+ attr_family = pango_attr_family_new (family_names);
+ attr_family->start_index = 0, attr_family->end_index = title_len;
+ pango_attr_list_insert (attr_list, attr_family);
+ }
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, 0, 8,
metric.width, metric.height);