font border

There are no stupid questions, just stupid answers.
  • 1
  • 2
13 posts Page 1 of 2
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
  by noemen » Thu Jan 09, 2020 2:05 am
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
bsisko
Posts: 80
Joined: Mon Jun 19, 2017 7:28 pm
by bsisko » Thu Jan 09, 2020 3:18 am
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!
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Thu Jan 09, 2020 6:08 am
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.
marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Thu Jan 09, 2020 10:58 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
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Fri Jan 10, 2020 12:25 am
@
User avatar
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)?
marauder2k9
Posts: 418
Joined: Wed Feb 18, 2015 7:36 am
by marauder2k9 » Fri Jan 10, 2020 1:00 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.
bsisko
Posts: 80
Joined: Mon Jun 19, 2017 7:28 pm
by bsisko » Fri Jan 10, 2020 1:25 am
I just did a google search and found this link.
https://beebom.com/free-tools-to-create-your-own-fonts/

** WARNING **
I haven't tried any of these programs myself yet.
Azaezel
DEVGRU
Posts: 495
Joined: Tue Feb 03, 2015 9:50 pm
 
by Azaezel » Fri Jan 10, 2020 5:55 am
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.
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Fri Jan 10, 2020 7:35 am
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.
noemen
Posts: 100
Joined: Tue May 29, 2018 3:46 pm
 
by noemen » Fri Jan 10, 2020 7:38 am
@
User avatar
bsisko
and @
User avatar
marauder2k9
m
Thanks a lot for the help. I think this post will also help other people.
  • 1
  • 2
13 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 14 guests