[Sikuli-driver] [Question #246176]: Making an image from text

2014-03-28 Thread Eugene Maslov
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.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #246176]: Making an image from text

2014-03-28 Thread RaiMan
Question #246176 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/246176

Status: Open => Answered

RaiMan proposed the following answer:
Hey, you stumbled upon one of the things missing in Sikuli from the
beginning ;-)

It is on the list, and the implementation will simply use buffered images and 
the corresponding Swing/AWT features to paint something into the buffered 
image.  Everything is available, no need to import anything.
And all Java is simply accessible in Jython as long, as it is on the class path.

So if you find a solution, I will happily accept your contribution.

The somehow feature compatible but not API compatible spin off "Sikuli
Java API" (https://code.google.com/p/sikuli-api/) contains an approach
in this direction, to implement some text find feature. May be it helps
to look into that code first.

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

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp