### font border

There are no stupid questions, just stupid answers.
• 1
• 2

#### font border

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm

I'm working a lot with the Torque3D GUI ... I noticed that it works with fonts that are installed on the pc. My question is: Can I put borders on these fonts? A white font with a black border ... I see that some games use custom fonts in a png file and they come colored and bordered.

I thought of putting one text on top of the other, with the back text being larger than the front and dark in color (this would be the border). But I realized it's the absurd idea lol

#### Re: font border

bsisko
Posts: 80
Joined: Mon Jun 19, 2017 7:28 pm
I havn't tried graphic manipulation of fonts, but I suppose that if you can load up a font in any graphic editor such as gimp or krita, it could be done!

#### Re: font border

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm

I havn't tried graphic manipulation of fonts, but I suppose that if you can load up a font in any graphic editor such as gimp or krita, it could be done!
Thanks ... I'll try and then post here.

#### Re: font border

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
What you first suggested is probably best and a lot less expensive, rendering of font is damn expensive to an engine lol this is why most games developed use the png format you described. I would create 2 versions, one that is just the text and another that is just the border both in white, that way you can change the color to whatever you want if later on down the line you dont want the text to be say red with a green border, you wont have to modify your png file for each character again u would just go into the editor and change the font colors there

#### Re: font border

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm

@
marauder2k9
Got it ... I want to use this bordered font, just game chat. In this case, with each dictation text would I have its replica sent as well (the border and text)?

#### Re: font border

marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
if u use what i said about splitting the border from the actual text then yeah, but this is the thing rendering 2 polygons to a screen is far better and easier than rendering the amount required by rendering an actual font to a screen. I cant remember but i know i read it somewhere that the amount of polygons required for rendering an actual font is colossal like we are talking near 20 polygons each character.

#### Re: font border

bsisko
Posts: 80
Joined: Mon Jun 19, 2017 7:28 pm
https://beebom.com/free-tools-to-create-your-own-fonts/

** WARNING **
I haven't tried any of these programs myself yet.

#### Re: font border

Azaezel
DEVGRU
Posts: 495
Joined: Tue Feb 03, 2015 9:50 pm

so the way the font system works, is first the system looks under https://github.com/GarageGames/Torque3D ... ipts/fonts (https://github.com/GarageGames/Torque3D ... core/fonts in the case of older builds) for an appropriately sized font file entry and tries to find the character within it. if it can't, it'll look up the system font of the same name. if it *still* can't, it'll fall back to a standard font.

this end, what we ended up doing is installing the font on my machine as a forinstance, and executing:
function populateAllFonts(%font)
{
populateFontCacheRange(%font,14,0,65535);
populateFontCacheRange(%font,18,0,65535);
populateFontCacheRange(%font,24,0,65535);
populateFontCacheRange(%font,32,0,65535);
populateFontCacheRange(%font,36,0,65535);
}
which leverages https://github.com/GarageGames/Torque3D ... .cpp#L1052
which in turn lets everyone else use it without having to ship a system font installer along with the game one.

#### Re: font border

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm

so the way the font system works, is first the system looks under https://github.com/GarageGames/Torque3D ... ipts/fonts (https://github.com/GarageGames/Torque3D ... core/fonts in the case of older builds) for an appropriately sized font file entry and tries to find the character within it. if it can't, it'll look up the system font of the same name. if it *still* can't, it'll fall back to a standard font.

this end, what we ended up doing is installing the font on my machine as a forinstance, and executing:
function populateAllFonts(%font)
{
populateFontCacheRange(%font,14,0,65535);
populateFontCacheRange(%font,18,0,65535);
populateFontCacheRange(%font,24,0,65535);
populateFontCacheRange(%font,32,0,65535);
populateFontCacheRange(%font,36,0,65535);
}
which leverages https://github.com/GarageGames/Torque3D ... .cpp#L1052
which in turn lets everyone else use it without having to ship a system font installer along with the game one.
Got it now ... I'm learning a lot. I will work now with Torque3D, if I get a good result ... I will share here.

#### Re: font border

noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm

@
bsisko
and @
marauder2k9
m
Thanks a lot for the help. I think this post will also help other people.
• 1
• 2

#### Who is online

Users browsing this forum: No registered users and 14 guests