← Back to team overview

sikuli-driver team mailing list archive

[Question #246176]: Making an image from text

 

New question #246176 on Sikuli:
https://answers.launchpad.net/sikuli/+question/246176

First of all, Raimund, thank you for the great product. 

Now, this is my question.

I was trying to run the same Sikuli tests with the same application on different Linux machines, and they failed too often, because fonts, used in menus of tested aplications, were different. It was quite tricky to set the same fonts on the machines, because in different Linux there are different ways, and I couldn't make a common script to do it automatically.
Usage of OCR is too slow and buggy, every third menu item is not recognized, and small fonts are not recognized at all.

Therefore I started trying to write a function to generate on-the-fly little png images containing known text with known font, in order to use them  like click(text2img(text,font, background, foreground))  . I expected that such images would be found more quickly and reliably, not needing OCR, and it would be possible to configure the font only once at the beginning of the test run.

But...

- PIL python image library refuses to be installed on my machine with Sikuli, because it doesn't recognize Jython as Python, it just interrupts the installation;

- When I put ImageJ on the machine tried, like here http://imagej.nih.gov/ij/plugins/jython/ (tried on Windows) ,
          sys.path.append("d:/ImageJ/")
          from ij import IJ
Then Sikuli writes: [error] ImportError ( No module named ij )

Now I was forced to come to an idea to write an independent exe with OpenCV, returning such images, but I still feel that I missed some simpler way.

Dear colleagues, could you please help: is there a simple way to make images from a text and a font with existing configuration of Sikuli?

Thank you in advance!


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.