Invisible characters

Questions about XML that are not covered by the other forums should go here.
fabzyr
Posts: 2
Joined: Wed May 17, 2023 1:23 pm

Invisible characters

Post by fabzyr »

Hello everyone,

I would like to know if there is a way to make characters appear (such as the letter "i" or ".") invisible! I need to move the text within the screen of a game (that uses the xml language) in order to align it with other text, to create columns. I would need just the font size of an "i" to move the text and align it. Or a "."
But they have to be invisible!! The space command   works. All other spacing types do not: thin space, en space... Nothing. Otherwise I would have moved the text horizontally with a thin space, but unfortunately it doesn't work. The command is not read by the game. I would like to try with the "i" character and hide it. "i" is just the right size!

Thanks
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Invisible characters

Post by adrian »

Hi,
As you can probably imagine, this doesn't really qualify as an XML question... but anyway...
The AI (LLM) of the day says that:
If you're looking to make specific characters, such as the letter "i" or ".", appear invisible while still maintaining their spacing properties, there are a few approaches you can try. Keep in mind that the success of these methods may depend on the specific game and how it handles text rendering.
  • Zero-width space: Unicode includes a character called the zero-width space (U+200B) that has no visual representation but still occupies space. You can try using this character in your text to create the desired alignment. For example, you can insert the zero-width space character between each letter or after a specific character you want to hide. However, note that not all games or text rendering systems may handle this character correctly.
  • Custom font: Another option is to use a custom font where the specific characters you want to hide are designed as invisible glyphs. This approach requires creating or modifying a font file to have invisible representations for the characters you wish to hide. Then, you can use this custom font in your game's text rendering system. However, this method may involve more technical expertise and might not be feasible depending on the game's font rendering capabilities.
  • Transparent color: Some text rendering systems allow you to set the color of individual characters or parts of the text. If your game supports this feature, you can try setting the color of the characters you want to hide to be fully transparent (e.g., using an alpha value of 0). This way, the characters will be present but not visible.
Please note that the effectiveness of these methods depends on the specific game and its text rendering capabilities. It's always a good idea to test your approach within the game to see if it yields the desired results.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
fabzyr
Posts: 2
Joined: Wed May 17, 2023 1:23 pm

Re: Invisible characters

Post by fabzyr »

Thank you so much adrian!
Your advice helped me. The second method worked! Unfortunately the game does not support the other two methods. The game is not in english language and only supports its original language font table. However, it allows you to use the English alphabet for any translations or localizations in English. So I used a glyph from that font-table to create a blank font that was different from the xml's SPACE.
Post Reply