Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command tag to emulate a non-breaking space in a string #83

Closed
JujuAdams opened this issue Jun 26, 2020 · 4 comments
Closed

Command tag to emulate a non-breaking space in a string #83

JujuAdams opened this issue Jun 26, 2020 · 4 comments
Labels
feature 💭 It would be extra good if...

Comments

@JujuAdams
Copy link
Owner

Adding a non-breaking space to text is useful for handling UI elements where in-line sprites and phrases might want to be wrapped as a single unit. It's possible to achieve this already using the actual non-breaking space character (familiar to people everywhere as U+00A0) but editing a font to include an non-breaking space is annoying. Some fonts might not even support nbsp.

Scribble should support programmatically adding a non-breaking space to text. A programmatic nbsp would not be stored as U+00A0 in a string but instead utilise the command tag system to emulate a non-breaking space. This should be done with a command tag, either one of [nbsp] [&nbsp] [ ] [nbsp;]. This enables people to add non-breaking spaces with the least amount of effort.

@JujuAdams JujuAdams added feature 💭 It would be extra good if... in progress labels Jun 26, 2020
@glitchroy
Copy link

I like it! Not sure about the [] for the tag, though. There would be a difference in [nbsp] compared to all other tags, since this one would actually add something to the string instead of simply being a control character. I'm wondering if just the bare HTML entity sytnax (&tag;) would be a good idea or just more confusing for everyone.

@DragoniteSpam
Copy link

I mentioned on discord liking the idea of an empty [ ] with a space in it because it visually like a space character, but tbh it's also something I could see people doing by accident.

Also if you add the command as [&nbsp] it shouldn't be too hard for people like me to just make an alias for [ ] and call it a day. ¯\_(ツ)_/¯

@JujuAdams
Copy link
Owner Author

JujuAdams commented Jun 26, 2020

@DragoniteSpam It's easy enough to add [ ] in there, do a search for   and you'll find some case statements - you can add your customisation there

@glitchroy Dealing with   as an actual in-line piece of text would require a loooot of extra parsing work which'll make Scribble slower for everyone, and it might also break existing uses of Scribble. We've got some basic parsing apparatus in already, makes sense to use what's already there

@JujuAdams
Copy link
Owner Author

Implemented for v6.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 💭 It would be extra good if...
Projects
None yet
Development

No branches or pull requests

3 participants