Changeset 6
- Timestamp:
- 01/01/07 06:16:56 (4 days ago)
- Files:
-
- people/ping/pcfdump/README (added)
- people/ping/pcfdump/libfont.c (modified) (4 diffs)
- people/ping/pcfdump/pcfdump.c (modified) (1 diff)
- people/ping/pcfdump/wenquanyi_12pt.pcf (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
people/ping/pcfdump/libfont.c
r5 r6 60 60 register unsigned char * pglyph; 61 61 register char * p, * pImage; 62 int ret; 62 63 63 64 if (handle >= last_font || handle < 0) { /* out of boundary */ … … 69 70 70 71 /* get the glyph from the font */ 71 __get_glyph(used_fonts[handle], ch, &nglyphs, &pci); 72 ret = __get_glyph(used_fonts[handle], ch, &nglyphs, &pci); 73 if (ret != 0) { return ret; } 72 74 73 75 /* convert to the padded format */ 74 76 mtc = &(pci->metrics); 77 /* 75 78 printf("metric: left = %d, right = %d, characterWidth = %d, ascent = %d, descent = %d\n", 76 79 mtc->leftSideBearing, mtc->rightSideBearing, mtc->characterWidth, 77 mtc->ascent, mtc->descent); 80 mtc->ascent, mtc->descent); */ 78 81 79 82 glyph->left = mtc->leftSideBearing; … … 192 195 193 196 194 __get_glyph(FontPtr pFont, unsigned char * chs, unsigned long * pnglyphs,197 int __get_glyph(FontPtr pFont, unsigned char * chs, unsigned long * pnglyphs, 195 198 CharInfoPtr * ppci) 196 199 { … … 213 216 /* printf(" encoding = %d\n", encoding); */ 214 217 (*pFont->get_glyphs) (pFont, 1, chs, encoding, pnglyphs, ppci); 215 printf("nglyphs = %d, pci = %x\n", *pnglyphs, *ppci); 216 218 /* printf("nglyphs = %d, pci = %x\n", *pnglyphs, *ppci); */ 219 if (*pnglyphs == 0) { 220 return -1; 221 } 222 return 0; 217 223 } 218 224 people/ping/pcfdump/pcfdump.c
r5 r6 55 55 } 56 56 ret = font_get_glyph(handle, chs, &glyph); 57 /* printf("ret = %d\n", ret); */ 58 if (ret != 0) { 59 fprintf(stderr, "failed to get glyph from font\n"); 60 exit(2); 61 } 57 62 font_show_glyph(&glyph); 58 63 font_close(handle);