Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    51
  • comments
    129
  • views
    82855

VBE fun, #2

Sign in to follow this  
Muhammad Haggag

632 views

I spent the whole day working on the English glyphs. I wasn't happy with the ugly look in the previous entry, so I took a screenshot of an anti-aliased font, zoomed in, and started a pixel-by-pixel struggle of epic proportions, crafting the glyphs by hand, in C. I could've probably written a program to do it, but I sometimes like to brute-force my way through things (especially when I know it's going to take less than a day). Here's how it looks like now:



Each glyph is a 14x8 array of uint8s. Each element takes a value from 0 to 9, where 0 represents the background color and 9 represents the foreground (text) color. The renderer then converts this number to a a floating point value [0, 1] and uses it for blending. The only downside to this so far is that the glyph representations are no longer clear in the code:


[snip]
// 35 - '#'
{
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 8, 5, 4, 9, 0},
{0, 0, 0, 9, 4, 5, 8, 0},
{0, 0, 4, 8, 0, 7, 7, 0},
{4, 9, 9, 9, 9, 9, 9, 9},
{0, 0, 7, 5, 0, 9, 4, 0},
{0, 0, 9, 0, 4, 8, 0, 0},
{9, 9, 9, 9, 9, 9, 9, 5},
{0, 6, 7, 0, 8, 4, 0, 0},
{0, 7, 6, 3, 9, 3, 0, 0},
{0, 9, 4, 5, 8, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0}
},
// 36 - '$'
{
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 9, 0, 0, 0},
{0, 4, 7, 9, 9, 9, 7, 4},
{0, 8, 5, 0, 9, 0, 4, 8},
{0, 9, 4, 0, 9, 0, 0, 0},
{0, 5, 8, 7, 9, 4, 0, 0},
{0, 0, 4, 5, 9, 5, 8, 5},
{0, 0, 0, 0, 9, 0, 0, 9},
{0, 8, 4, 0, 9, 0, 5, 8},
{0, 4, 7, 9, 9, 9, 7, 4},
{0, 0, 0, 0, 9, 0, 0, 0},
{0, 0, 0, 0, 9, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0}
},
[/snip]



Now, I really have one thing to say before going off to sleep: Rawrrrrrrrrrrrrrrrrrrrrrrrr.
Sign in to follow this  


1 Comment


Recommended Comments

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!