[comp.soft-sys.andrew] transfer mode graphic_COPY

dgross@rchland.iinus1.ibm.com (Dave Gross) (11/07/90)

Has anyone tried to use the transfer mode graphic_COPY tooverwrite
characters in a view without having to first "white out"the old
characters?  For example:

    myview_SetTransferMode(self, graphic_COPY);
    myview_SetFont(self, myFont); /* a fixed width font */
    myview_MoveTo(self, x, y);
    myview_DrawString(self, "LAST",graphic_ATTOP | graphic_ATLEFT);
    myview_DrawString(self, "F",graphic_ATTOP | graphic_ATLEFT);

What I would expect as a result would be "FAST", but what I getis
"EAST".  It seems that graphic_COPY is workinglike OR.  Is this a bug?

Also, can anyone respond to my last post of Oct. 30 on key bindings?  I
wouldappreciate any input you can give me.

Thanks,
-- Dave Gross
507/286-6785

gk5g+@ANDREW.CMU.EDU (Gary Keim) (11/07/90)

Excerpts from misc: 6-Nov-90 transfer mode graphic_COPY Dave
Gross@rchland.iinus (704+0)

>     myview_SetTransferMode(self, graphic_COPY);
>     myview_SetFont(self, myFont); /* a fixed width font */
>     myview_MoveTo(self, x, y);
>     myview_DrawString(self, "LAST",graphic_ATTOP | graphic_ATLEFT);
>     myview_DrawString(self, "F",graphic_ATTOP | graphic_ATLEFT);

> What I would expect as a result would be "FAST", but what I get is
> "EAST".  It seems that graphic_COPY is working like OR.  Is this a bug?


DrawString makes use of the X call XDrawString.  Here is a blurb about
what XDrawString does:

    XDrawString and XDrawString16 draw a string into a drawable. 
    They require only the string, its length, and the position of
    the baseline origin.  The font in the GC (GraphicsContext) is
    used both as a source for the graphics operation and as a clip
    mask, so that pixels in the destination drawable that are not in
    each font character are not drawn.

So, there is no bug in the graphic layer.  There may be a bug in the
documentation.

Excerpts from misc: 6-Nov-90 transfer mode graphic_COPY Dave
Gross@rchland.iinus (704+0)

> Also, can anyone respond to my last post of Oct. 30 on key bindings?  I
> would appreciate any input you can give me.

I'm hoping that someone else will answer this question.