How to turn antialiasing off


#1

How can I turn off antialiasing.
I need to draw text which is not antialiased.

Thanks


#2

Don’t be silly, nobody’s genuinely needed to draw text that wasn’t anti-aliased since about 1995!


#3

same problem here, i need to accurately render a bitmap font and it does not seem possible ‘out of the box’ with juce.

btw the txt you are reading now is not anti-aliased and that is just one example that there is plenty of reasons to render fonts without anti-aliasing!


#4

[quote=“auspuff”]same problem here, i need to accurately render a bitmap font and it does not seem possible ‘out of the box’ with juce.

btw the txt you are reading now is not anti-aliased and that is just one example that there is plenty of reasons to render fonts without anti-aliasing![/quote]

Wrong!

Viewing this page on a LCD monitor with Cleartype turned on.

:wink:


#5

Don’t know what browser you’re using, but it’s certainly anti-aliased on my screen!

Someone asked for this before, but it’s not really on my agenda after all the effort I took to make the font rendering look really good. It could be done by hacking the Typeface code around, or I guess you could also render the font as a path and draw the path with anti-aliasing turned off, but it might still try to use sub-pixel positioning.

Here’s why I think aliased text is bad: If you need to fit so much text on the screen that you need fonts smaller than 7pt, then your app is just all wrong and needs redesigning. But if you’re making the fonts small because you like the look of them, then you’re going to piss-off people like me, who won’t be able to read them on hi-res screens (e.g. my laptop does 1600x1050 so a 6pt font is < 2mm high and looks ridiculous)


#6

perfectly valid points there jules. i quite like the look of some of those small bitmapped fonts but they piss me off a treat when it comes to actually using something plastered in them.


#7

I’m really, really impressed of Juce’s possibilitis but, I’m sorry, I have to be able to draw not antialiased.
( It’s not my decision )

So my question:
Will there be ever a “native” Juce solution for drawing not antialiased?

Thanks


#8

Well, I don’t fancy spending a day of my life sweating over this just to help a couple of people to create interfaces that I’d consider to be ugly and old-fashioned…

Of course, feel free to try to convince me otherwise!


#9

whether you like or dislike anti-alliased text is an endless discussion that will probably boil down to personal preference and i think we all have better things to do with our time.

i prefer non-anti-alliased txt for point sizes below 12/14 and i think it would be great to have that option in juce especially if it only a days work for you :wink:


#10

In fact thinking about it, it’d be harder than it sounds as I’d have to deal with hinting too - and that’d involve a lot of messy platform-specific code, so don’t think it’s something I’ll be doing anytime soon…


#11

Okay,

If you are really curious, you can simply render aliased text by adding a drawAliasedText() method to the Graphic class, and adding a drawNativeText method under the Windowing Code. Then you’ll have to specialized that method for each platform (Windows, Linux, MacOSX), to draw a text calling the native OS method.

Under Windows, the drawNativeText method will have to create a memory Bitmap and a memory DC, draw the text using any of the DrawText functions, and then access the DIB section of the bitmap to copy the data on the Image internal data (performing on the fly colorspace conversion if required)…

Of course this implies much work for a not really needed feature.

Another simpler possibility (this is a hack but might work for you) is to add an array of (Text, Position) pair to the native windowing code, and then, after the final painting, paint all the texts in the array (quick and dirty code), by calling the specified functions (ExtTextOut or DrawText under Windows, etc…)

Good luck


#12

I don‘t understand.
Specifically how to do it?


#13

This post is 5 years old! I’m going to close it, please discuss elsewhere on a more up-to-date thread…


#14