score = 0;
for (i = 0; i < face->num_charmaps; ++i) {
FT_Encoding enc_entry = face->charmaps[i]->encoding;
- mm_log((2, "i_ft2_new, encoding %lX platform %u encoding %u\n",
- enc_entry, face->charmaps[i]->platform_id,
+ mm_log((2, "i_ft2_new, encoding %X platform %u encoding %u\n",
+ (unsigned)enc_entry, face->charmaps[i]->platform_id,
face->charmaps[i]->encoding_id));
for (j = 0; j < sizeof(enc_scores) / sizeof(*enc_scores); ++j) {
if (enc_scores[j].encoding == enc_entry && enc_scores[j].score > score) {
}
}
FT_Select_Charmap(face, encoding);
- mm_log((2, "i_ft2_new, selected encoding %lX\n", encoding));
+ mm_log((2, "i_ft2_new, selected encoding %X\n", (unsigned)encoding));
result = mymalloc(sizeof(FT2_Fonthandle));
result->face = face;
int loadFlags = FT_LOAD_DEFAULT;
int rightb = 0;
- mm_log((1, "i_ft2_bbox(handle %p, cheight %f, cwidth %f, text %p, len %d, bbox %p)\n",
- handle, cheight, cwidth, text, len, bbox));
+ mm_log((1, "i_ft2_bbox(handle %p, cheight %f, cwidth %f, text %p, len %u, bbox %p)\n",
+ handle, cheight, cwidth, text, (unsigned)len, bbox));
error = FT_Set_Char_Size(handle->face, cwidth*64, cheight*64,
handle->xdpi, handle->ydpi);
error = FT_Load_Glyph(handle->face, index, loadFlags);
if (error) {
ft2_push_message(error);
- i_push_errorf(0, "loading glyph for character \\x%02x (glyph 0x%04X)",
+ i_push_errorf(0, "loading glyph for character \\x%02lx (glyph 0x%04X)",
c, index);
return 0;
}
bbox[BBOX_ASCENT] = ascent;
bbox[BBOX_ADVANCE_WIDTH] = width;
bbox[BBOX_RIGHT_BEARING] = rightb;
- mm_log((1, " bbox=> negw=%d glob_desc=%d pos_wid=%d glob_asc=%d desc=%d asc=%d adv_width=%d rightb=%d\n", bbox[0], bbox[1], bbox[2], bbox[3], bbox[4], bbox[5], bbox[6], bbox[7]));
+ mm_log((1, " bbox=> negw=%" i_DF " glob_desc=%" i_DF " pos_wid=%" i_DF
+ " glob_asc=%" i_DF " desc=%" i_DF " asc=%" i_DF " adv_width=%" i_DF
+ " rightb=%" i_DF "\n",
+ bbox[0], bbox[1], bbox[2], bbox[3], bbox[4], bbox[5], bbox[6],
+ bbox[7]));
return BBOX_RIGHT_BEARING + 1;
}
error = FT_Load_Glyph(handle->face, index, loadFlags);
if (error) {
ft2_push_message(error);
- i_push_errorf(0, "loading glyph for character \\x%02x (glyph 0x%04X)",
+ i_push_errorf(0, "loading glyph for character \\x%02lx (glyph 0x%04X)",
c, index);
return 0;
}
int loadFlags = FT_LOAD_DEFAULT;
i_render *render;
- mm_log((1, "i_ft2_text(handle %p, im %p, tx %d, ty %d, cl %p, cheight %f, cwidth %f, text %p, len %d, align %d, aa %d)\n",
- handle, im, tx, ty, cl, cheight, cwidth, text, align, aa));
+ mm_log((1, "i_ft2_text(handle %p, im %p, (tx,ty) (" i_DFp "), cl %p, cheight %f, cwidth %f, text %p, len %u, align %d, aa %d, vlayout %d, utf8 %d)\n",
+ handle, im, i_DFcp(tx, ty), cl, cheight, cwidth, text, (unsigned)len, align, aa, vlayout, utf8));
if (vlayout) {
if (!FT_HAS_VERTICAL(handle->face)) {
error = FT_Load_Glyph(handle->face, index, loadFlags);
if (error) {
ft2_push_message(error);
- i_push_errorf(0, "loading glyph for character \\x%02x (glyph 0x%04X)",
+ i_push_errorf(0, "loading glyph for character \\x%02lx (glyph 0x%04X)",
c, index);
if (aa)
i_render_delete(render);
error = FT_Render_Glyph(slot, aa ? ft_render_mode_normal : ft_render_mode_mono);
if (error) {
ft2_push_message(error);
- i_push_errorf(0, "rendering glyph 0x%04X (character \\x%02X)");
+ i_push_errorf(0, "rendering glyph 0x%04lX (character \\x%02X)", c, index);
if (aa)
i_render_delete(render);
return 0;
}
/*
-=item i_ft2_cp(FT2_Fonthandle *handle, i_img *im, int tx, int ty, int channel, double cheight, double cwidth, char *text, size_t len, int align, int aa)
+=item i_ft2_cp(FT2_Fonthandle *handle, i_img *im, int tx, int ty, int channel, double cheight, double cwidth, char *text, size_t len, int align, int aa, int vlayout, int utf8)
Renders I<text> to (I<tx>, I<ty>) in I<im> to I<channel> at the given
I<cheight> and I<cwidth>.
is rendered with (I<tx>, I<ty>) aligned with the base-line of the
characters.
-If aa is non-zero then the text is anti-aliased.
+If C<utf8> is non-zero the text is treated as UTF-8 encoded
+
+If C<aa> is non-zero then the text is drawn anti-aliased.
Returns non-zero on success.
i_color cl, cl2;
int x, y;
- mm_log((1, "i_ft2_cp(handle %p, im %p, tx %d, ty %d, channel %d, cheight %f, cwidth %f, text %p, len %d, ...)\n",
- handle, im, tx, ty, channel, cheight, cwidth, text, len));
+ mm_log((1, "i_ft2_cp(handle %p, im %p, (tx, ty) (" i_DFp "), channel %d, cheight %f, cwidth %f, text %p, len %u, align %d, aa %d, vlayout %d, utf8 %d)\n",
+ handle, im, i_DFcp(tx, ty), channel, cheight, cwidth, text, (unsigned)len, align, aa, vlayout, utf8));
if (vlayout && !FT_HAS_VERTICAL(handle->face)) {
i_push_error(0, "face has no vertical metrics");
i_ft2_has_chars(FT2_Fonthandle *handle, char const *text, size_t len,
int utf8, char *out) {
int count = 0;
- mm_log((1, "i_ft2_has_chars(handle %p, text %p, len %d, utf8 %d)\n",
- handle, text, len, utf8));
+ mm_log((1, "i_ft2_has_chars(handle %p, text %p, len %u, utf8 %d)\n",
+ handle, text, (unsigned)len, utf8));
while (len) {
unsigned long c;
/* rough check count + 1 entry + next offset */
if (offset + (2+12+4) > tiff->size) {
- mm_log((2, "offset %uld beyond end off Exif block"));
+ mm_log((2, "offset %lu beyond end off Exif block", offset));
return 0;
}
/* check we can fit the whole thing */
ifd_size = 2 + count * 12 + 4; /* count + count entries + next offset */
if (offset + ifd_size > tiff->size) {
- mm_log((2, "offset %uld beyond end off Exif block"));
+ mm_log((2, "offset %lu beyond end off Exif block", offset));
return 0;
}
static unsigned
tiff_get16(imtiff *tiff, unsigned long offset) {
if (offset + 2 > tiff->size) {
- mm_log((3, "attempt to get16 at %uld in %uld image", offset, tiff->size));
+ mm_log((3, "attempt to get16 at %lu in %lu image", offset,
+ (unsigned long)tiff->size));
return 0;
}
static unsigned
tiff_get32(imtiff *tiff, unsigned long offset) {
if (offset + 4 > tiff->size) {
- mm_log((3, "attempt to get16 at %uld in %uld image", offset, tiff->size));
+ mm_log((3, "attempt to get16 at %lu in %lu image", offset,
+ (unsigned long)tiff->size));
return 0;
}
int result;
if (offset + 2 > tiff->size) {
- mm_log((3, "attempt to get16 at %uld in %uld image", offset, tiff->size));
+ mm_log((3, "attempt to get16 at %lu in %lu image", offset, tiff->size));
return 0;
}
unsigned work;
if (offset + 4 > tiff->size) {
- mm_log((3, "attempt to get16 at %uld in %uld image", offset, tiff->size));
+ mm_log((3, "attempt to get16 at %lu in %lu image", offset, tiff->size));
return 0;
}
if (rc != JPGS) { /* XXX: Should raise some jpeg error */
myfree(dest->buffer);
- mm_log((1, "wiol_empty_output_buffer: Error: nbytes = %d != rc = %d\n", JPGS, rc));
+ mm_log((1, "wiol_empty_output_buffer: Error: nbytes = %d != rc = %d\n", JPGS, (int)rc));
ERREXIT(cinfo, JERR_FILE_WRITE);
}
dest->pub.free_in_buffer = JPGS;
i_tags_set(&im->tags, "i_format", "jpeg", 4);
- mm_log((1,"i_readjpeg_wiol -> (0x%x)\n",im));
+ mm_log((1,"i_readjpeg_wiol -> (%p)\n",im));
return im;
}
png_read_info(png_ptr, info_ptr);
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
- mm_log((1,
- "png_get_IHDR results: width %d, height %d, bit_depth %d, color_type %d, interlace_type %d\n",
- width,height,bit_depth,color_type,interlace_type));
+ mm_log((1, "png_get_IHDR results: width %u, height %u, bit_depth %d, color_type %d, interlace_type %d\n",
+ (unsigned)width, (unsigned)height, bit_depth,color_type,interlace_type));
CC2C[PNG_COLOR_TYPE_GRAY]=1;
CC2C[PNG_COLOR_TYPE_PALETTE]=3;
i_tags_set(&im->tags, "i_format", "png", -1);
if (png_get_pHYs(png_ptr, info_ptr, &xres, &yres, &unit_type)) {
- mm_log((1,"pHYs (%d, %d) %d\n", xres, yres, unit_type));
+ mm_log((1,"pHYs (%u, %u) %d\n", (unsigned)xres, (unsigned)yres, unit_type));
if (unit_type == PNG_RESOLUTION_METER) {
i_tags_set_float2(&im->tags, "i_xres", 0, xres * 0.0254, 5);
i_tags_set_float2(&im->tags, "i_yres", 0, yres * 0.0254, 5);
mm_log((3, "Offset/length table:\n"));
for(i=0; i < height * channels; i++)
- mm_log((3, "%d: %d/%d\n", i, start_tab[i], length_tab[i]));
+ mm_log((3, "%d: %lu/%lu\n", i, start_tab[i], length_tab[i]));
*pstart_tab = start_tab;
*plength_tab = length_tab;
return NULL;
}
- mm_log((1, "maxlen for an rle buffer: %d\n", max_length));
+ mm_log((1, "maxlen for an rle buffer: %lu\n", max_length));
if (max_length > (img->xsize + 1) * 2) {
i_push_errorf(0, "SGI image: ridiculous RLE line length %lu", max_length);
/* RLE run */
if (count > pixels_left) {
i_push_error(0, "SGI image: RLE run overflows scanline");
- mm_log((2, "RLE run overflows scanline (y %d chan %d offset %ld len %ld)\n", y, c, start_tab[ci], length_tab[ci]));
+ mm_log((2, "RLE run overflows scanline (y %" i_DF " chan %d offset %lu len %lu)\n", i_DFc(y), c, start_tab[ci], length_tab[ci]));
goto ErrorReturn;
}
if (data_left < 1) {
mm_log((1,"metrics: ascent: %d descent: %d\n",glyph->metrics.ascent,glyph->metrics.descent));
mm_log((1," leftSideBearing: %d rightSideBearing: %d\n",glyph->metrics.leftSideBearing,glyph->metrics.rightSideBearing));
mm_log((1," advanceX: %d advanceY: %d\n",glyph->metrics.advanceX,glyph->metrics.advanceY));
- mm_log((1,"bpp: %d\n",glyph->bpp));
+ mm_log((1,"bpp: %lu\n", (unsigned long)glyph->bpp));
xsize=glyph->metrics.rightSideBearing-glyph->metrics.leftSideBearing;
ysize=glyph->metrics.ascent-glyph->metrics.descent;
space_position = T1_GetEncodingIndex(fontnum, "space");
- mm_log((1,"i_t1_bbox(font %p (%d),points %.2f,str '%.*s', len %d)\n",font, fontnum,points,len,str,len));
+ mm_log((1,"i_t1_bbox(font %p (%d),points %.2f,str '%.*s', len %u)\n",
+ font, fontnum,points,(int)len,str,(unsigned)len));
T1_LoadFont(fontnum); /* FIXME: Here a return code is ignored - haw haw haw */
if (len == 0) {
}
gbbox = T1_GetFontBBox(fontnum);
- mm_log((1,"bbox: (%d,%d,%d,%d)\n",
+ mm_log((1,"bbox: (%d, %d, %d, %d, %d, %d)\n",
(int)(bbox.llx*points/1000),
(int)(gbbox.lly*points/1000),
(int)(bbox.urx*points/1000),
mm_log((1,"metrics: ascent: %d descent: %d\n",glyph->metrics.ascent,glyph->metrics.descent));
mm_log((1," leftSideBearing: %d rightSideBearing: %d\n",glyph->metrics.leftSideBearing,glyph->metrics.rightSideBearing));
mm_log((1," advanceX: %d advanceY: %d\n",glyph->metrics.advanceX,glyph->metrics.advanceY));
- mm_log((1,"bpp: %d\n",glyph->bpp));
+ mm_log((1,"bpp: %lu\n",(unsigned long)glyph->bpp));
xsize=glyph->metrics.rightSideBearing-glyph->metrics.leftSideBearing;
ysize=glyph->metrics.ascent-glyph->metrics.descent;
i_mutex_lock(mutex);
- mm_log((1, "i_t1_has_chars(font_num %d, text %p, len %d, utf8 %d)\n",
- font_num, text, len, utf8));
+ mm_log((1, "i_t1_has_chars(font_num %d, text %p, len %u, utf8 %d)\n",
+ font_num, text, (unsigned)len, utf8));
i_clear_error();
if (T1_LoadFont(font_num)) {
/* Add code to get the filename info from the iolayer */
/* Also add code to check for mmapped code */
- mm_log((1, "i_readtiff_wiol(ig %p, length %d)\n", ig));
+ mm_log((1, "i_readtiff_wiol(ig %p)\n", ig));
tif = TIFFClientOpen("(Iolayer)",
"rm",
uint16 *p = state->raster;
int out_chan = state->img->channels;
- mm_log((4, "putter_cmyk16(%p, %d, %d, %d, %d, %d)\n", x, y, width, height, row_extras));
+ mm_log((4, "putter_cmyk16(%p, %" i_DF ", %" i_DF ", %" i_DF
+ ", %" i_DF ", %d)\n", state, x, y, width, height, row_extras));
state->pixels_read += width * height;
while (height > 0) {
void (*f_i_clear_error)(void); /* SKIP */
void (*f_i_push_error)(int code, char const *msg); /* SKIP */
- void (*f_i_push_errorf)(int code, char const *fmt, ...);
+ void (*f_i_push_errorf)(int code, char const *fmt, ...) I_FORMAT_ATTR(2,3);
void (*f_i_push_errorvf)(int code, char const *fmt, va_list); /* SKIP */
void (*f_i_tags_new)(i_img_tags *tags);
i_img_dim (*f_i_img_get_width)(i_img *im);
i_img_dim (*f_i_img_get_height)(i_img *im);
void (*f_i_lhead)(const char *file, int line_number);
- void (*f_i_loog)(int level, const char *msg, ...);
+ void (*f_i_loog)(int level, const char *msg, ...) I_FORMAT_ATTR(2,3);
/* IMAGER_API_LEVEL 4 functions will be added here */
i_img *(*f_i_img_alloc)(void); /* SKIP */
void (*f_im_clear_error)(im_context_t ctx);
void (*f_im_push_error)(im_context_t ctx, int code, char const *msg);
void (*f_im_push_errorvf)(im_context_t ctx, int code, char const *fmt, va_list);
- void (*f_im_push_errorf)(im_context_t , int code, char const *fmt, ...);
+ void (*f_im_push_errorf)(im_context_t , int code, char const *fmt, ...) I_FORMAT_ATTR(3,4);
int (*f_im_set_image_file_limits)(im_context_t ctx, i_img_dim width, i_img_dim height, size_t bytes);
int (*f_im_get_image_file_limits)(im_context_t ctx, i_img_dim *width, i_img_dim *height, size_t *bytes);