>>>>> On Sat, 04 Apr 2009 11:44:27 +0900, YAMAMOTO Mitsuharu said: >> I tried making a really preliminary proof-of-concept cairo port. :-) >> It's still rough and has several glitches/limitations, but at least >> it can generate a "resolution-independent screenshot" PDF as >> attached. Maybe I'll clean up the code this weekend and hopefully >> post a patch. > Here's the patch for the Emacs 23.0.92 pretest (not the trunk HEAD). > * Currently, texts, rectangles (filling and stroking), and trapezoids > for reliefs are drawn using cairo by hooking the corresponding > drawing routine calls in xterm.c. They use X11 GC (with extension > data) for colors and clipping rectangles, but operations on them can > easily be ported to non-X11 (e.g., terminal-only) environments just > like the Carbon port. > * Images could also be drawn with cairo, but I didn't do that because > the image drawing in xterm.c depends on X-specific data structures. > As a result, you can't see any images in the exported screenshot as > of now. I added fringe bitmap drawing with cairo because it can be added without using X-specific data structures. Handa-san, could you check if the following change to ftfont.c is correct? It is also included in the revised patch below. *************** ftfont_text_extents (font, code, nglyphs *** 1255,1261 **** metrics->lbearing = m->horiBearingX >> 6; metrics->rbearing = (m->horiBearingX + m->width) >> 6; metrics->ascent = m->horiBearingY >> 6; ! metrics->descent = (m->horiBearingY + m->height) >> 6; } first = 0; } --- 1255,1261 ---- metrics->lbearing = m->horiBearingX >> 6; metrics->rbearing = (m->horiBearingX + m->width) >> 6; metrics->ascent = m->horiBearingY >> 6; ! metrics->descent = (m->height - m->horiBearingY) >> 6; } first = 0; } *************** ftfont_text_extents (font, code, nglyphs *** 1269,1276 **** = width + ((m->horiBearingX + m->width) >> 6); if (metrics->ascent < (m->horiBearingY >> 6)) metrics->ascent = m->horiBearingY >> 6; ! if (metrics->descent > ((m->horiBearingY + m->height) >> 6)) ! metrics->descent = (m->horiBearingY + m->height) >> 6; } width += m->horiAdvance >> 6; } --- 1269,1276 ---- = width + ((m->horiBearingX + m->width) >> 6); if (metrics->ascent < (m->horiBearingY >> 6)) metrics->ascent = m->horiBearingY >> 6; ! if (metrics->descent < ((m->height - m->horiBearingY) >> 6)) ! metrics->descent = (m->height - m->horiBearingY) >> 6; } width += m->horiAdvance >> 6; } YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp