Custom fonts from an already created image.
-
Cube_
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Custom fonts from an already created image.
Ok so I have a font image (the font is Chairo Bold, there is not *.ttf or simmilar available, just this one png file, this font (for those who are interested) was used in Oacrina of Time (THE ORIGINAL, have no clue about the 3ds version))
how would I go by when making an xml file for the font?
how would I go by when making an xml file for the font?
"this is not the bottleneck you are looking for"
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Custom fonts from an already created image.
You can't. well, you could count pixels and create an XML manually. But I doubt that it's easier than finding this font somewhere as a proper font file.
Re: Custom fonts from an already created image.
Maybe you could get it working as bitmap font. I think our bitmap fonts find the characters by a yellow pixel on top-left of each character and a red pixel on bottom-right. Order probably also has to be the same as in other bitmap fonts. Take a look at one of the existing ones in the media-folder like "fonthaettenschweiler.bmp" in a graphic-program (paintbrush will do).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
hybrid
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Custom fonts from an already created image.
Yeah, but of course this requires the characters to be aligned with a fixed spacing IIRC, and also requires certain height of the lines and the bitmap. Moreover, you lose all extra information about kerning and whatever is stored in the XML as well.
Re: Custom fonts from an already created image.
Well, he already has a bitmap font (.png) if I got that right. So yeah - depends on that stuff, but chances are not too bad all that's there already.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
Cube_
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: Custom fonts from an already created image.
well, if I can't do it this way, does anyone know of some software that can convert a bitmapped font into a ttf file so I can use the irrlicht font tool to convert it (if you want I can upload the image)
I have no clue if the letters are in the 'right' order. I assume they are.
I have no clue if the letters are in the 'right' order. I assume they are.
"this is not the bottleneck you are looking for"
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Custom fonts from an already created image.
It's not just about letters being in the right order, it's more about how a tool can identify and separate letters from eachotheraaammmsterdddam wrote:well, if I can't do it this way, does anyone know of some software that can convert a bitmapped font into a ttf file so I can use the irrlicht font tool to convert it (if you want I can upload the image)
I have no clue if the letters are in the 'right' order. I assume they are.
You seem to assume that all bitmap fonts are the same, or that all bitmap fonts could be read by any tool, which is absolutely not the case
Also, TrueType font glyphs are not stored as rasterized data, but as curves. The conversion from these curves to rasterized data with certain specified qualities can be done easily using a rasterization engine, but rebuilding clean curve data from rasterized data is not something you can do
I'm not saying that it's impossible to get curve data back from your bitmaps, but the resulting data in your truetype font would look pretty horrible
Your bitmap probably also does not include all characters included in the original truetype font by the way
Re: Custom fonts from an already created image.
That's why I wrote to take a look at fonthaettenschweiler in the media folder. Obviously the fonts coming with Irrlicht have the right order. So you can directly compare to those.aaammmsterdddam wrote:I have no clue if the letters are in the 'right' order. I assume they are.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
Cube_
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: Custom fonts from an already created image.
ok... so I should remap the font according to that image (I actually started with that yesterday
)
^^*
Of course it doesn't. there is no TrueType font. This is a font dump I made. (dumped directly from the game!)Your bitmap probably also does not include all characters included in the original truetype font by the way
^^*
"this is not the bottleneck you are looking for"
-
Radikalizm
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: Custom fonts from an already created image.
Well, you were the one talking about recreating a TTF out of your bitmapaaammmsterdddam wrote:ok... so I should remap the font according to that image (I actually started with that yesterday)
Of course it doesn't. there is no TrueType font. This is a font dump I made. (dumped directly from the game!)Your bitmap probably also does not include all characters included in the original truetype font by the way
^^*
Also, it's not exactly legal to use copyrighted resources you extracted from some game and use it in your own
-
Cube_
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: Custom fonts from an already created image.
it is for a fan project.
And I don't care about the law.
**hey nintendo! Sue me, bitchez!**
Back to the question.
there is really no way of doing this?
I tried using incscape and some program (Fontforge I think)
But it didn't want to work
And I don't care about the law.
**hey nintendo! Sue me, bitchez!**
Back to the question.
there is really no way of doing this?
I tried using incscape and some program (Fontforge I think)
But it didn't want to work
"this is not the bottleneck you are looking for"
Re: Custom fonts from an already created image.
Didn't that work? Don't forget the colored pixels I mentioned.aaammmsterdddam wrote:ok... so I should remap the font according to that image (I actually started with that yesterday ;) )
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Custom fonts from an already created image.
It can be done. Those coloured control characters can be found within a loop which will "scan" the bitmap data of the image. From that you can define the rectangles which irrlicht will be able to read, then you can take the characters you want and generate another bitmap using those control characters as delineators for each individual character (this can also be done with some skill, patience and frustration in an image program). The problem is that each position is probably hardcoded into irrlicht to represent a specific character as it has no meta data from an XML file to identify it, so it will take lots of tinkering and a fair amount of bug testing to make sure the engine is loading the correct character as a computer has no concept of what an "A" looks like. If you have done your job correctly you will have a bitmap which can be read as a font file.aaammmsterdddam wrote:it is for a fan project.
there is really no way of doing this?
I tried using incscape and some program (Fontforge I think)
But it didn't want to work
I wouldn't recommend it though. Sounds like a mission with very little reward.
