[Experimental] Proportional fonts
Moderator: InsideQC Admins
13 posts
• Page 1 of 1
[Experimental] Proportional fonts
This is a quick hack to make the normal quake font renders more like a "proportional font".
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.
- Code: Select all
//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.
- Teiman
- Posts: 309
- Joined: Sun Jun 03, 2007 9:39 am
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 %.
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 %.
- Teiman
- Posts: 309
- Joined: Sun Jun 03, 2007 9:39 am
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.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
-

Chip - Posts: 575
- Joined: Wed Jan 21, 2009 9:12 am
- Location: Dublin, Ireland
Darkplaces will have proper font support soon or it already has, I am not sure.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
Spirit wrote:Darkplaces will have proper font support soon or it already has, I am not sure.
I guess he'll soon make an official release and announcement.
QuakeWiki
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
getButterfly - WordPress Support Services
Roo Holidays
Fear not the dark, but what the dark hides.
-

Chip - Posts: 575
- Joined: Wed Jan 21, 2009 9:12 am
- Location: Dublin, Ireland
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.
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.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
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.
It is the same .dat file exported from Bitmap Font Builder's export character widths menu option.
- FrikaC
- Site Admin
- Posts: 1026
- Joined: Fri Oct 08, 2004 11:19 pm
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.
I'll confess to a liking for Quake's old grungy non-proportional fonts however.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
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.
- c0burn
- Posts: 208
- Joined: Fri Nov 05, 2004 12:48 pm
- Location: Liverpool, England
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
-

gnounc - Posts: 424
- Joined: Mon Apr 06, 2009 6:26 am
13 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
