views:

166

answers:

3

I'm using Qt (embedded) to make a GUI on a black and white screen. The problem is Qt renders text with shades of grey so it is unreadable on the black and white screen. Does anyone have any idea how to make the text just use 1 bit per pixel, or purely black and white? Thanks, Mark

A: 

I know Qt has a lot of code in their embedded stuff to handle different bit depths. The best suggestion is to find out if there is a flag for a 1bpp configuration, and reconfigure/compile the Qt libraries with that option. That should force all of their drawing into a black/white mode.

Caleb Huitt - cjhuitt
+1  A: 

I believe what you want is QFont::setStyleStrategy(QFont::NoAntialias).

But I am not very familiar with the embedded parts of Qt.

Adam W
thanks, unfortunately I had already tried that "font1.setStyleStrategy ( QFont::NoAntialias );" and it doesn't help. Also when configuring I set it so the only supported depth was 1.
Mark
A: 

Incase anyone sees this trying to do the same thing - Turning off AA and setting the supported bit depths to only 1 will not work, virtually all fonts just have grey in them, and if so you can't use them. Best solution is to just create your own purely black and white fonts as a bdf with a 96 resolution (fontforge is good) use something to convert it to a pfa then give that to qt to use and set the pixel size to the same height as the bdfs.

Mark