Mercurial > hg > dmlib
comparison tools/fontconv.c @ 1968:868e39741d26
Only check glyphs that will be saved.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 30 Jun 2018 06:31:57 +0300 |
parents | 8a98d1517460 |
children | 5f9e8dd62c70 |
comparison
equal
deleted
inserted
replaced
1967:8a98d1517460 | 1968:868e39741d26 |
---|---|
399 font->nglyphs = 0; | 399 font->nglyphs = 0; |
400 for (int n = 0; n < font->maxglyph; n++) | 400 for (int n = 0; n < font->maxglyph; n++) |
401 { | 401 { |
402 DMBitmapGlyph *glyph = &font->glyphMap[n]; | 402 DMBitmapGlyph *glyph = &font->glyphMap[n]; |
403 | 403 |
404 if (glyph->width < DMFONT_MIN_WIDTH || | |
405 glyph->height < DMFONT_MIN_HEIGHT || | |
406 glyph->width > DMFONT_MAX_WIDTH || | |
407 glyph->height > DMFONT_MAX_HEIGHT || | |
408 glyph->width > font->width || | |
409 glyph->height > font->height) | |
410 { | |
411 dmErrorMsg("Invalid glyph #%d: %d x %d (font %d x %d)\n", | |
412 n, | |
413 glyph->width, glyph->height, | |
414 font->width, font->height); | |
415 goto out; | |
416 } | |
417 | |
418 if (glyph->index >= 0) | 404 if (glyph->index >= 0) |
405 { | |
419 font->nglyphs++; | 406 font->nglyphs++; |
407 if (glyph->width < DMFONT_MIN_WIDTH || | |
408 glyph->height < DMFONT_MIN_HEIGHT || | |
409 glyph->width > DMFONT_MAX_WIDTH || | |
410 glyph->height > DMFONT_MAX_HEIGHT || | |
411 glyph->width > font->width || | |
412 glyph->height > font->height) | |
413 { | |
414 dmErrorMsg("Invalid glyph #%d: %d x %d (font %d x %d)\n", | |
415 n, | |
416 glyph->width, glyph->height, | |
417 font->width, font->height); | |
418 goto out; | |
419 } | |
420 } | |
420 } | 421 } |
421 | 422 |
422 dmMsg(1, "Outputting a DMFONT format bitmap font, %d x %d with %d glyphs (%d max), %d bpp.\n", | 423 dmMsg(1, "Outputting a DMFONT format bitmap font, %d x %d with %d glyphs (%d max), %d bpp.\n", |
423 font->width, font->height, | 424 font->width, font->height, |
424 font->nglyphs, font->maxglyph, | 425 font->nglyphs, font->maxglyph, |