As Garry correctly pointed out, those two flags cannot coexist, and its 
REALLY frustrating. (antialiasing and outline)

Interestingly, AA will work with dropshadow, so perhaps that can work 
for you?  To the pirate/viking guy, increase the size of that custom 
font down there by a single digit, it may resolve it for you.

I will tell you one method I have found to work around the issue that 
may be of use to someone.  Its not very optimized, BUT it may work for 
people.

What you do is make TWO instances of that font in the .RES file, one 
white like you want, and one black.  Make them exactly identical in 
size, with the AA flag, NO outline.

In code, make 2 pointers for the 2 fonts, call one like m_hFont and the 
other m_hFontBG.  Store off the X/Y positions into two ints.

First draw the white one as you normally would, then draw the black one 
4 times BEFORE that each offset by a single pixel in all four 
directions.  I'll show you a snippet of some code I was playing with to 
actually have AA working on this netgraph experiment I was working on.

g_pMatSystemSurface->DrawColoredText( m_hFontBG, x-1, y-1, 0, 0, 0, 200, 
sz );
g_pMatSystemSurface->DrawColoredText( m_hFontBG, x-1, y+1, 0, 0, 0, 200, 
sz );
g_pMatSystemSurface->DrawColoredText( m_hFontBG, x+1, y-1, 0, 0, 0, 200, 
sz );
g_pMatSystemSurface->DrawColoredText( m_hFontBG, x+1, y+1, 0, 0, 0, 200, 
sz );
g_pMatSystemSurface->DrawColoredText( m_hFont, x, y, 255 255, 255, 255, 
sz );

I don't know how well this will work on thin fonts however, so no 
guarantees, but its worth a shot right?

The other thing I was going to experiment with my 2d artist when I have 
the time is making a strict, centered, fixed width font.  Making two 
instances, of the font, one at 12pt, then other at 13, and then try to 
come up with a portable, reuasable method for rendering them both that 
accounts for the offsets involved automatically.

But what would be REALLY nice is if valve fixed this issue and made a 
new flag for us... ::does puppy eyes::

If optimization was the concern when the engine was first released, many 
of us would gladly lose an FPS for this.  Just put a warning comment in 
there about optimization.  My fear though, is that the font rendering is 
a 3rd party thing that even they cannot modify.  But there is little 
doubt in my mind that there is an early return or specific if/else code 
that makes the outline flag overwrite AA, and it isn't a bug.  The only 
question is can they do anything about it.

-Mke

Garry Newman wrote:
> Yeah antialiasing ruins shadowing/outline for some reason :(
>
> garry
>
> On Sun, Dec 13, 2009 at 5:06 PM, Jonas 'Sortie' Termansen <[email protected]
>   
>> wrote:
>>     
>
>   
>> To me it looks like a bug in the antialiasing code/functions.
>>     
>>> I took a picture to explain the issue better what I mean, it is not ideal
>>> being a jpeg, but I zoomed in on a tga of the text and noted that you
>>>       
>> have
>>     
>>> outline then a blurred edge of the text which is causing the background
>>>       
>> to
>>     
>>> bleed in a little. It happens more extremely when we are displaying red
>>>       
>> text
>>     
>>> with our game timer it seems to be a slightly larger gap then. Oddly it
>>> isn't noticeable unless you have a color behind it that is similar to the
>>> text or if you have really bright color values behind it, like on our
>>>       
>> timer
>>     
>>> when players look at the bright areas of the skybox.
>>>
>>> http://img51.imageshack.us/img51/8326/weirdtext.jpg
>>>
>>> Chris
>>>
>>>       
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list archives,
>> please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>
>>
>>     
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please 
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
>   


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to