Font engine rewrite...
Apr. 25th, 2010 12:20 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
So, as I'm bored today (at least until I start making dinner, then going over to Grandpa's to watch the hockey game), I've decided to rewrite my font engine.
The current font engine I have for Tetris-Power is strictly based on bitmaps which are used to directly affect the screen pixels, which means that if I need a different font size, I have to create, load and track another font file, which is not a recommended practice.
So, I need a polygon-based font engine that allows me to specify a size for each line of text without needing a new font for each point-size I need.
This will need to be almost a complete rewrite of the engine from the ground up, as my previous font engine used a vertically short and horizontally long image to represent the font, and graphics cards like square images to work with.
Another reason I need this rewrite is that when a row gets removed, the score you get floats up from the vanishing row, which means that I needed to figure out exactly where in pixels I had to start the score, when the rows exist in three dimensions. With the new engine, I'll be able to specify the location of the score text by simply taking the 3D position of the row and moving it closer to the viewer, so much simpler and with even less chance for mistakes.
(also, it makes graphical effects like spinning text SO much easier to do, and it even gives me anti-aliased text for nearly free, too!)
The current font engine I have for Tetris-Power is strictly based on bitmaps which are used to directly affect the screen pixels, which means that if I need a different font size, I have to create, load and track another font file, which is not a recommended practice.
So, I need a polygon-based font engine that allows me to specify a size for each line of text without needing a new font for each point-size I need.
This will need to be almost a complete rewrite of the engine from the ground up, as my previous font engine used a vertically short and horizontally long image to represent the font, and graphics cards like square images to work with.
Another reason I need this rewrite is that when a row gets removed, the score you get floats up from the vanishing row, which means that I needed to figure out exactly where in pixels I had to start the score, when the rows exist in three dimensions. With the new engine, I'll be able to specify the location of the score text by simply taking the 3D position of the row and moving it closer to the viewer, so much simpler and with even less chance for mistakes.
(also, it makes graphical effects like spinning text SO much easier to do, and it even gives me anti-aliased text for nearly free, too!)