![]() |
Using Images for Text?
So I was wanting to use those cool numbers from state.png. I did the math.
Starting at: PHP Code:
PHP Code:
My question is there a way to use images as font's for this? |
http://forums.graalonline.com/forums...hp?t=134258865
It depends on how complex you want this to be. For my thread above(using state.png) it's fairly simple because you assume every character is the same width. However if you start rendering letters using a nonfixed-width font image then things get more complex as you need to start taking in to consideration kerning and spacing. This requires you to build an array of each character width, and to keep track of the last letter placement + width before placing the next character. |
It would probably be easier to just make your image into a TTF file, upload it to the server, and use it as a font (e.g. "fontFace = \"myfont.ttf\"").
|
Quote:
Quote:
|
If the only thing you want to do is display numbers then I suggest an image. Especially if it's for graphical effect, where rendering fonts in large sizes can cause a lot of slowdown. Using an entire font just to display numbers is overkill I think.
|
Quote:
Get's confusing really fast working with that many images. As for fon't size, I think 14x16 pixels per letter is plenty and I will probably not need any larger or smaller font's. |
Quote:
As for using a font, the problem is that I'm not aware of any font format that allows bitmap format with more than 2 colors(font color and transparency). |
Quote:
|
| All times are GMT +2. The time now is 02:02 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.