emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing


From: YAMAMOTO Mitsuharu
Subject: Re: Printing
Date: Tue, 07 Apr 2009 18:46:01 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Sat, 04 Apr 2009 11:44:27 +0900, YAMAMOTO Mitsuharu <address@hidden> 
>>>>> 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
                                address@hidden

Attachment: emacs-23.0.92-cairo.patch.gz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]