Testing Xft and screen scraping

Glynn Clements glynn at gclements.plus.com
Sat Sep 16 05:48:30 PDT 2006


Fujinaka, Todd wrote:

> I am a total newbie and I need to do some X programming to test for the
> operational presence of Xft. This is for the Linux Standard Base
> project.
> 
> So I was told by Keith that I should "paint 'em and scrape 'em." So does
> that mean that I just render some text into a pixmap and then compare
> the memory contents to something I've stored?

Yes.

> How does the actual screen
> setting affect that as far as bit depth and resolution are concerned?

The depth and visual will affect the format of the raster data. The
resolution shouldn't have any impact; Xft works in pixels.

> Do I need to start up a virtual server to set the bit depth and resolution?

Yes.

> Would I need to have different comparisons for different processor
> architectures?

No.

> Also, I don't know the standard workflow for this. Would I need to have
> an event handler if I'm just writing into a pixmap (if that's even
> correct in the first place)?

No.

A minimal test program would open the display, create a Pixmap, do
whatever setup Xft requires, draw onto the pixmap with Xft, then grab
its contents with XGetImage().

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the xorg mailing list