<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Jul 23, 2007, at 4:57, Sikamikaniboots wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <FONT face="Bitstream Vera Sans">Hi<BR> I'm trying to use gtk printing in my app. It uses cairo to draw.<BR> I'd like to fill paths with different hatches. I'm using the code below to create a little part of the hatch and to repeat it to fill the path.<BR> The problem is that when I do it, there's a little space (a thin and transparent line) between each repeat. For example, if I want to repeat a completely black square (see the code below), it gives me this result : <A class="moz-txt-link-freetext" href="http://img96.imageshack.us/img96/8747/cairopblmcw6.png">http://img96.imageshack.us/img96/8747/cairopblmcw6.png</A><BR> I expected it to draw a completely black area. If I draw a line or anything else instead of a black square, I get the same type of result.<BR> This result is displayed in the preview window of gtk printing (in fact in evince).<BR> Is there any way to suppress this line ?<BR> Thanks.<BR> <BR> The code :<BR> <BR> cairo_t * cr;<BR> cairo_surface_t *surface;<BR> surface = cairo_surface_create_similar(cairo_get_target(m_cairo),CAIRO_CONTENT_COLOR_ALPHA,5,5);<BR> cr = cairo_create(surface);<BR> cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);<BR> cairo_set_line_width(cr, 1);<BR> cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);<BR> cairo_set_source_rgba(cr, redPS, greenPS, bluePS, alphaPS); //these values give black color<BR> cairo_paint(cr);<BR> cairo_stroke (cr);<BR> cairo_destroy(cr);<BR> cairo_pattern_t * pattern = cairo_pattern_create_for_surface (surface);<BR> cairo_surface_destroy(surface);<BR> cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);<BR> cairo_set_source(m_cairo, pattern);<BR> //here i create a path in another cairo context (m_cairo)<BR> //and i fill it with the pattern:<BR> cairo_fill( m_cairo );<BR><BR class="khtml-block-placeholder"></FONT></BLOCKQUOTE><BR></DIV><DIV>I just replicated this code (I used a simple rectangle for the path), using the VW/ST binding for Cairo running on Quartz. It looks fine. So that'd point at possible X issues, rather than Cairo issues?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Couple thoughts. You don't need the cairo_stroke, or even the linewidth/cap, since you're using paint which fills the whole clip area.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>What happens if you turn ANTIALIAS back on? I would guess most/many of the Cairo cases leave AA on, so you may be in an area that doesn't get used much?</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>--</DIV><DIV>Travis Griggs</DIV><DIV>Objologist</DIV><DIV>"I choose. Therefore, I Am"</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>