Author Topic: Fix for font rendering at high resolutions  (Read 2268 times)

0 Members and 1 Guest are viewing this topic.

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Fix for font rendering at high resolutions
annoying white lines from font rendering  :mad: couldnt stand them anymore, wrote fix

Code: [Select]
Index: code/graphics/gropengldraw.cpp
===================================================================
--- code/graphics/gropengldraw.cpp (revision 8115)
+++ code/graphics/gropengldraw.cpp (working copy)
@@ -477,10 +477,10 @@
  }
 
  u0 = u_scale * (i2fl(u+xd) / bw);
- v0 = v_scale * (i2fl(v+yd) / bh);
+ v0 = v_scale * (i2fl(v+yd) / bh)*(do_resize?0.99f:1.0f);
 
  u1 = u_scale * (i2fl((u+xd)+wc) / bw);
- v1 = v_scale * (i2fl((v+yd)+hc) / bh);
+ v1 = v_scale * (i2fl((v+yd)+hc) / bh)*(do_resize?0.99f:1.0f);
 
  glTexCoord2f(u0, v1);
  glVertex2i(x1, y2);

feedback plz. then commit. also nominate immediately for .14 inclusion.
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline TwentyPercentCooler

  • Operates at 375 kelvin
  • 28
Re: Fix for font rendering at high resolutions
Okay, idiot question, but I'm really not familiar with this kind of tweaking - how do I put this in?

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Steam
Re: Fix for font rendering at high resolutions
YES
el hombre vicio...

 

Offline sigtau

  • 29
  • unfortunate technical art assclown
Re: Fix for font rendering at high resolutions
VALATHIL

I'd write something like "stop being so magical" but then it might actually happen so I won't

KEEP BEING MAGICAL  :nod:
Who uses forum signatures anymore?

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Fix for font rendering at high resolutions
i changed the wrong line : this should be better and work with the original font and the new bluplanet one
Code: [Select]
Index: code/graphics/gropengldraw.cpp
===================================================================
--- code/graphics/gropengldraw.cpp (revision 8119)
+++ code/graphics/gropengldraw.cpp (working copy)
@@ -479,8 +479,8 @@
  u0 = u_scale * (i2fl(u+xd) / bw);
  v0 = v_scale * (i2fl(v+yd) / bh);
 
- u1 = u_scale * (i2fl((u+xd)+wc) / bw);
- v1 = v_scale * (i2fl((v+yd)+hc) / bh);
+ u1 = u_scale * (i2fl((u+xd)+wc) / bw)*(do_resize?0.99f:1.0f);
+ v1 = v_scale * (i2fl((v+yd)+hc) / bh)*(do_resize?0.99f:1.0f);
 
  glTexCoord2f(u0, v1);
  glVertex2i(x1, y2);
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Fix for font rendering at high resolutions
Is this more font-agnostic then?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Valathil

  • ...And I would have had a custom title if it wasn't for you meddling kids!
  • 29
  • Custom Title? Wizards need no Custom Title!
Re: Fix for font rendering at high resolutions
coming from me its more font-atheistic. it knows its not a font but just a texture.
┏┓╋┏┓╋╋╋╋╋╋╋╋╋┏┓
┃┃╋┃┃╋╋╋╋╋╋╋╋╋┃┃
┃┃┏┫┃┏┳━━┓┏━━┓┃┗━┳━━┳━━┳━━┓
┃┃┣┫┗┛┫┃━┫┃┏┓┃┃┏┓┃┏┓┃━━┫━━┫
┃┗┫┃┏┓┫┃━┫┃┏┓┃┃┗┛┃┗┛┣━━┣━━┃
┗━┻┻┛┗┻━━┛┗┛┗┛┗━━┻━━┻━━┻━━┛

 

Offline TwentyPercentCooler

  • Operates at 375 kelvin
  • 28
Re: Fix for font rendering at high resolutions
There are no words to expres my joy and gratitude that those annoying little lines were gone. Those have been bugging me for years, YEARS I tell you.

Thank you Valathil. I bestow upon you the title of "Most Magical Sensational Powerful Super-Duper Wizard Savant Genius."

  

Offline Crybertrance

  • 29
  • Conventional warheads only, no funny business
Re: Fix for font rendering at high resolutions
Thank you Valathil. I bestow upon you the title of "Most Magical Sensational Powerful Super-Duper Wizard Savant Genius."

+1 to that!!
<21:08:30>   Hartzaden fires a slammer at Cybertrance
<21:09:13>   Crybertrance pops flares, but wonders how Hartzaden acquired aspect lock on a stealth fighter... :\
<21:11:58>   *** The_E joined #bp [email protected]
21:11:58   +++ ChanServ has given op to The_E
<21:12:58>   Hartzaden continues to paint crybertrance and feeding the info to a wing of gunships
<21:14:07>   Crybertrance sends emergency "IM GETING MY ASS KICKED HERE!!!!eleventy NEED HELPZZZZ" to 3rd fleet command
<21:14:50>   Hartzaden jamms the transmission.
<21:14:51>   The_E explodes the sun