Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!uunet!mcsun!ukc!acorn!john From: john@acorn.co.uk (John Bowler) Newsgroups: comp.windows.x Subject: Re: A wish for R5 Summary: XDrawBitmap -> XCopyPlane Keywords: XCopyPlane Message-ID: <6922@acorn.co.uk> Date: 9 May 91 15:13:07 GMT References: <1991May8.234851.576@agate.berkeley.edu> Organization: Acorn Computers Ltd, Cambridge, UK Lines: 41 In article <1991May8.234851.576@agate.berkeley.edu> vojta@powdermilk.berkeley.edu (Paul Vojta) writes: >I hope it's not too late to suggest something, but it would be very helpful >(at least for xdvi and the like) to have another X call for putting bitmaps. >Quoting from the man page for XDrawString, > > "the drawable is only modified where the font character > has a bit set to 1." > >What I am suggesting would be an XDrawBitmap() call to provide the same >functionality for drawing bitmaps. Use XCopyPlane twice with the bitmap as the source. The first time use the raster op GXandInverted (sp?) with a foreground pixel value of ~0 (all bits set) and a background of 0 to clear destination pixels (effectively using the bitmap as an inverted mask). The second time use GXor and set the foreground to the desired pixel value, leave the background as 1. If the foreground value is 0 (no bits set) omit the second step. If the foreground value is ~0 (all bits set) omit the first step. If using a plane mask just consider the set bits in the plane mask when working out this optimisation. >Or, allowing clients to download fonts would also suffice for this purpose. And be more efficient when the operation really does correspond to a set of glyphs... as in xdvi. IMHO it would also be better than using font servers; part of the problem for an application installing a font is dealing with the services which do the installation (currently a font compiler and a font path set operation, but possibly in the future a font server). A protocol extension is probably no more complex than the extensions to handle the font server (in both the X server and for a new font server ``protocol''), and could be very easy to use:- fontid = CreateFont(name,type) for-all-characters DefineCharacter(fontid,index,size_etc,bits) CompleteFont(fontid) DestroyFont(fontid) John Bowler (jbowler@acorn.co.uk)