TEMPEST.114 Posted December 10, 2022 Posted December 10, 2022 (edited) -- #Region MonoSpaced -- local morseText = "\n" .. -- "A * - " .. " " .. "B - * * * " .. "C - * - *\n" .. -- "D - * * " .. " " .. "E * " .. "F * * - *\n" .. -- "G - - * " .. " " .. "H * * * * " .. "I * * \n" .. -- "J * - - - " .. " " .. "K - * - " .. "L * - * *\n" .. -- "M - - " .. " " .. "N - * " .. "O - - - \n" .. -- "P * - - * " .. " " .. "Q - - * - " .. "R * - * \n" .. -- "S * * * " .. " " .. "T - " .. "U * * - \n" .. -- "V * * * - " .. " " .. "W - * * " .. "X - * - -\n" .. -- "Y - * - - " .. " " .. "Z - - * * " .. "\n\n" .. -- "1 * - - - -" .. " " .. "2 * * - - -" .. "\n" .. -- "3 * * * - -" .. " " .. "4 * * * * -" .. "\n" .. -- "5 * * * * *" .. " " .. "6 - * * * *" .. "\n" .. -- "7 - - * * *" .. " " .. "8 - - - * *" .. "\n" .. -- "9 - - - - *" .. " " .. "0 - - - - -" -- #EndRegion MonoSpaced Above is a sample of text, perfectly aligned using a monospaced font. I had originally thought that DCS was not using a monospaced font as there are all sorts of font errors/bugs in DCS. However upon further investigation (see here:) It appears you ARE using a monospaced font. However, despite as you can see from the code sample that in a perfectly rendered monospace font, all the columns line up perfectly. In your game, it renders completely out of whack. From experience, I know that you often convert a font into a texture that you then 'slice' up into tiles so that you can render it in the graphical renderer fast and with low memory bandwidth. However I believe you have an error in this where you're trimming the space character differently to other characters. Possibly you're trimming others poorly too, but definitely the space character is broken. I've tested this with just lining up two rows of identically paired characters and changing one space before and after the left most character of the bottom row, they don't match. Something is wrong in your tiling/slicing or font renderer. Edited December 11, 2022 by Elphaba 1
Flappie Posted December 11, 2022 Posted December 11, 2022 11 hours ago, Elphaba said: In your game, it renders completely out of whack. I don't see what's wrong with the radio comms menu / subtitles spacing. Can you please show a screenshot? ---
TEMPEST.114 Posted December 11, 2022 Author Posted December 11, 2022 (edited) That's because you haven't tried to show a monospaced font with rows and columns like I already provided. This is what that exact code renders like with your poorly trimmed font glyphs. Look at the 'J'. It's completely miss-trimmed. Look at P, S, V and Y and compare them to the M above them - they are all trimmed such that any space BEFORE the font letter is cut off. This **completely** makes the use of a monospaced font (which you are actually using) utterly redundant. Also note that the 'space' is far, far, far smaller in width than the space given for the widest letter 'W'. Therefore, your use of a monospaced font is completely broken by the glyph texturing system you've written. Edited December 11, 2022 by Elphaba
Flappie Posted December 11, 2022 Posted December 11, 2022 Thank you. I see what you meant. By the way, I'm not part of ED, which means I haven't written any part of the game. For your needs, you should definitely use "PICTURE TO" action. Here's an example. morse.miz ---
TEMPEST.114 Posted December 12, 2022 Author Posted December 12, 2022 8 hours ago, Flappie said: Thank you. I see what you meant. By the way, I'm not part of ED, which means I haven't written any part of the game. For your needs, you should definitely use "PICTURE TO" action. Here's an example. morse.miz 43.99 kB · 0 downloads When I say 'you' I mean ED not a person. Also, if only I could use 'picture to' because ED haven't added it to the scripting language and I'm not doing this in the ME for every mission. This is part of my Superscript. So 'picture to' doesn't work. The point still stands. ED are using a monospaced font for the in-game radio font. Therefore this shouldn't be happening. It's only happening because the font/glyph texture routine is incorrectly trimming the fonts. Hence the bug report. I've also made a bug report for 'picture to' to be available from script, but that hasn't even been marked as reported. Neither has my request for other VITALLLY missing features like addcommandtoUNIT and addsubmenuforUNIT and removemenuforUNIT.
Recommended Posts