noemen Posted January 9, 2020 Share Posted January 9, 2020 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 Quote Link to comment Share on other sites More sharing options...
bsisko Posted January 9, 2020 Share Posted January 9, 2020 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! Quote Link to comment Share on other sites More sharing options...
noemen Posted January 9, 2020 Author Share Posted January 9, 2020 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. Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted January 9, 2020 Share Posted January 9, 2020 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 Quote Link to comment Share on other sites More sharing options...
noemen Posted January 9, 2020 Author Share Posted January 9, 2020 @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)? Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted January 10, 2020 Share Posted January 10, 2020 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. Quote Link to comment Share on other sites More sharing options...
bsisko Posted January 10, 2020 Share Posted January 10, 2020 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. Quote Link to comment Share on other sites More sharing options...
Azaezel Posted January 10, 2020 Share Posted January 10, 2020 so the way the font system works, is first the system looks under https://github.com/GarageGames/Torque3D/tree/9ebebc1f5ec93d52b2b1cba6e0625a3d5e0ff327/Templates/BaseGame/game/core/gui/scripts/fonts (https://github.com/GarageGames/Torque3D/tree/development/Templates/Full/game/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/blob/561f010f2e6411d8253d23f0cfcff794e81f60bf/Engine/source/gfx/gFont.cpp#L1052which in turn lets everyone else use it without having to ship a system font installer along with the game one. Quote Link to comment Share on other sites More sharing options...
noemen Posted January 10, 2020 Author Share Posted January 10, 2020 so the way the font system works, is first the system looks under https://github.com/GarageGames/Torque3D/tree/9ebebc1f5ec93d52b2b1cba6e0625a3d5e0ff327/Templates/BaseGame/game/core/gui/scripts/fonts (https://github.com/GarageGames/Torque3D/tree/development/Templates/Full/game/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/blob/561f010f2e6411d8253d23f0cfcff794e81f60bf/Engine/source/gfx/gFont.cpp#L1052which 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. Quote Link to comment Share on other sites More sharing options...
noemen Posted January 10, 2020 Author Share Posted January 10, 2020 @bsisko and @marauder2k9mThanks a lot for the help. I think this post will also help other people. Quote Link to comment Share on other sites More sharing options...
bsisko Posted January 11, 2020 Share Posted January 11, 2020 You're welcome Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted January 11, 2020 Share Posted January 11, 2020 @bsisko and @marauder2k9mThanks a lot for the help. I think this post will also help other people. Very welcome ;) Would be interesting to see what you come up with Quote Link to comment Share on other sites More sharing options...
noemen Posted January 15, 2020 Author Share Posted January 15, 2020 It didn't work when I went to Chat ... Then I had an idea: I hid the dark background of Chat, and it is only visible if I call or if I hit PageUp (or PageDown). It was much more elegant. But in principle, the idea of placing two fonts (one being the border) might work very well on other occasions; in buttons, texts and etc. When I'm on the notebook, I'll share it with you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.