View previous topic :: View next topic |
Author |
Message |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Thu Jan 21, 2010 9:52 pm Post subject: [Experimental] Proportional fonts |
|
|
This is a quick hack to make the normal quake font renders more like a "proportional font".
Code: |
//Tei crude proportional fonts
switch(curr_char){
case 'i':
case 'I':
case 'l':
case 'L':
overlap = 2;
break;
case 'W':
case 'M':
break;
default:
overlap = 1;
break;
}
//Tei crude proportional fonts
// Draw the character but don't apply overall opacity, we've already done that
// And don't update the glstate, we've done that also!
Draw_CharacterBase(x-overlap, y, curr_char, scale, false, rgba, bigchar, false);//Tei added p.f.
x += ((bigchar ? 64 : 8) * scale) + char_gap - overlap*2 ;//Tei added p.f.
|
Since the code is soo simplistic, the rendering is not correct, but still I think it shows potential. Theres probably out here some bitmap proportional font. It can be possible,, IMHO, to replace/make optional, a proportional font, or render the original quake font in a proportiona-ish way. That may make text's in quake more readable. |
|
Back to top |
|
 |
ceriux

Joined: 06 Sep 2008 Posts: 968 Location: Florida, USA
|
|
Back to top |
|
 |
Team Xlink
Joined: 25 Jun 2009 Posts: 320
|
Posted: Wed Feb 03, 2010 1:00 am Post subject: |
|
|
This seems overly useful. _________________
Anonymous wrote: | if it works, it works. if it doesn't, HAHAHA! |
|
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Wed Feb 03, 2010 7:09 pm Post subject: |
|
|
I agree. And is one thing that can be hardcoded, ...adding small finne tunning to achieve perfection.
It sould be disabled for things like centerprint. But can be used in console (no changes) and on menus (lots of changes, here ezQuake uses align=left, so you have to calcute the new width prior to render this thing... )
Anyway is just a hack. The proper thing to do is support one proportional image, or support windows TTF files (arial and such). TTF fonts would enhance quake usability a 4.899999993 %. |
|
Back to top |
|
 |
Chip

Joined: 21 Jan 2009 Posts: 314 Location: Romania
|
Posted: Wed Feb 03, 2010 7:58 pm Post subject: |
|
|
The support of TTF files combined with the power of CSQC would allow modders to place any kind of text on the screen, such as hints, variables, constants, without the need of images. _________________ My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake |
|
Back to top |
|
 |
Spirit

Joined: 20 Nov 2004 Posts: 476
|
Posted: Wed Feb 03, 2010 8:05 pm Post subject: |
|
|
Darkplaces will have proper font support soon or it already has, I am not sure. _________________ Quake Maps |
|
Back to top |
|
 |
Chip

Joined: 21 Jan 2009 Posts: 314 Location: Romania
|
Posted: Wed Feb 03, 2010 8:26 pm Post subject: |
|
|
Spirit wrote: | Darkplaces will have proper font support soon or it already has, I am not sure. |
I know, LordHavoc is working on it. I'm monitorizing his SVN changelog.
I guess he'll soon make an official release and announcement. _________________ My Projects: Quake 1 Mods | OpenQuartz 2 | ChipQuake |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Wed Feb 03, 2010 8:59 pm Post subject: |
|
|
It seems some HL based games use it for his graphics.
But... how you generate these ttf files? the vectorial tools like InkScape helps you create then?
/me Looking forward for the next version of DP  |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Thu Feb 04, 2010 12:30 am Post subject: |
|
|
freetype2 isn't too hard a library to use, tbh.
its making use of it properly that takes time.
in svn builds of fte, set com_parseutf8 and it'll support utf-8 throughout, until it gets encoding errors from certain mods - chat is fine, depending upon player names.
^Ue100 upwards will show sbar images even without freetype2, just for the sake of it, but if you want truetype fonts, you'd need to get a freetype2 dll from somewhere. _________________ What's a signature? |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Mon Feb 08, 2010 7:36 pm Post subject: |
|
|
Interesting side note: Qake has variable width (proportional) fonts and has had it for quite a while. It uses the same bitmap font approach as Quake, but loads a <fontname>.dat file as well, which is (iirc) 255 byte long binary file that says how many pixels wide each character in the font is.
It is the same .dat file exported from Bitmap Font Builder's export character widths menu option. |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 909
|
Posted: Mon Feb 08, 2010 7:46 pm Post subject: |
|
|
That sounds rather neat. I wonder how it all fits in with centering text on-screen?
I'll confess to a liking for Quake's old grungy non-proportional fonts however. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
c0burn
Joined: 05 Nov 2004 Posts: 158 Location: Liverpool, England
|
Posted: Mon Feb 08, 2010 8:01 pm Post subject: |
|
|
mh wrote: | That sounds rather neat. I wonder how it all fits in with centering text on-screen?
I'll confess to a liking for Quake's old grungy non-proportional fonts however. |
Guess you'd just need to calculate pixel width rather than number of characters. But you know this of course.  |
|
Back to top |
|
 |
gnounc

Joined: 06 Apr 2009 Posts: 120
|
Posted: Tue Aug 10, 2010 11:58 am Post subject: |
|
|
Quote: | But... how you generate these ttf files? the vectorial tools like InkScape helps you create then? |
http://fontforge.sourceforge.net/
sorry, didnt notice the question when the thread was new |
|
Back to top |
|
 |
|