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

Monospace Support for Rich Text #5556

Conversation

southbridge-fur
Copy link

@southbridge-fur southbridge-fur commented Dec 11, 2024

This adds the new [mono] tag to the RichText system allowing for monospaced text in player-created paper documents.

Technical Details

Created the new MonoTag.cs class which handles the [mono] tag when it appears in rich text documents. This loads the Monospace font described in the Prototypes/fonts.yml file and pushes it onto the MarkupDrawingContext object.

Also added the MonoTag entry to the MarkupTagManager.cs list of valid tags. Forks will need to also need to add this tag to the list of their PaperWindow.xaml.cs _allowedTags attribute. However, I will be opening a PR on Wizden to account for this so it should propagate neatly.

Breaking Changes

If a branch does not have a monospace font defined in its Resources/Prototypes/fonts.yml and if someone tries to use the [mono] tag in a text document it will likely cause a huge issue. That being said this isn't something that seems to be handled in the similar BoldTag.cs or ItalicTag.cs so I'm gonna assume it's fine.

Demonstration

Using the Wizden SS14 debug build.

monospace.mp4

Copy link
Member

@PJB3005 PJB3005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be implemented in SS14? I don't think this needs to be part of Robust.

@southbridge-fur
Copy link
Author

This is where all the other elements of rich text are implemented, I assumed this is where it had to go.

@southbridge-fur
Copy link
Author

ahh it can be implemented there, then I'll do that.a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants