this is what i am actually dowing, but the result is not good in quality because it relies only on the gray values and not on the form of the character. the result is isolated dots and uneven thickness of the lines and uneven thickness of the same character depending on its position (OSX draws with subpixel precision). the font renderers have specific routines to optimize this, because they know the points of the path. if i had to do this myself, it would be an overkill because i would have to draw it very oversampled and then vectorize the image!

matthias

On 22 sept. 06, at 17:26, Phil M wrote:

On Sep 22, 2006, at 5:32 AM, Matthias Buercher wrote:

on OSX the g.drawstring is generally antialiased.
i have an application where it should not be.
i know that OSX is capable to render it not antialiased perfectly when it has to print it on paper. drawing to an 1bit picture is not an option (does not support unicode characters). drawing to a 32bit picture and then drawpicture to a 1bit picture is not an option (text is ugly, because the hints of the font rendering are not used and because letters do not always begin at a pixel frontier). is there some system call i can stop antialiasing for the current graphics?

There may be a system call, but it would probably be pretty hard to implement. I doubt that you could hook it up directly into the Graphics class, which means that you would need to create a picture with the text and then draw that picture.

You can fake or limit the affect of the anti-aliasing. You had the right idea about drawing it to a 1-bit picture. You can instead draw it to a 32-bit picture and then apply an RGBSurface.Transform (). You create an array of Integers which is 255 elements in size, and then loop through each value... the array index is the original value and the stored value is the new value. For example, if you want everything to be black-and-white:

   Dim a(255) As Integer
   For k As Integer = 0 To 255
     If (k < 128) Then a(k) = 0 Else a(k) = 255
   Next

But you can also set it up so that there are some levels of gray:

   Dim a(255) As Integer
   For k As Integer = 0 To 255
     If (k < 100) Then
       a(k) = 0
     Elseif (k < 150) Then
       a(k) = 100
     Elseif (k < 200) Then
       a(k) = 180
     Else
       a(k) = 255
     End If
   Next

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to