Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to write a program such that it can capture the data from an X Client to X server and extract only the Text data inside it?

I have to port a legacy application to android and the application only has text data.

There is an X-Server developed in android but it does not have a window manager and link Here he declared fonts for displaying text data .

libX11 documentation XDrawString & XDrawText . How does these draw the text ? ASCII ?

share|improve this question

While you can intercept X data through the use of a simple proxy and redirecting the X Client to the server, the chances of intercepting text data is rather small. For a long time applications,i.e., toolkits, have been using their own rendering and only send pixmaps to the X server to display.

share|improve this answer
I got this idea because an X-Server is developed in android but it does not have a window manager and link Here he declared fonts for displaying text data . So , if you can just skim through that code and tell your opinion . That would be great . – Pradyumna Sharma Nov 13 '13 at 8:56
Yes, the X server can do that and if your program actually uses XDrawText() you can catch it on the wire. The question is not whether the X Server can draw text, the question is whether your application does draw text using X or other means of rendering. Window managers also have nothing to do with this. – Bananguin Nov 13 '13 at 9:33
IMG .I hope you understand it . – Pradyumna Sharma Nov 13 '13 at 9:50
The image says you do not understand what I told you. The X Client rendering text does not imply it is using Xlib for this purpose. If (!!!) it is, the text will be transmitted as a sequence of bytes on the wire and you can extract them relatively easy by making X use a tcp connection for client/server interaction and intercepting the data at the network layer. If your application does not use XDrawText(), you need to figure out another way. BTW: your image says you are developing an X server ... – Bananguin Nov 13 '13 at 10:07
I am assuming that it cannot be done . So , what other options are there for me apart from implementing a Xserver on android . – Pradyumna Sharma Nov 13 '13 at 11:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.