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

TextAnnotations - TabRun #7678

Open
claudiaareneee opened this issue Feb 10, 2025 · 4 comments
Open

TextAnnotations - TabRun #7678

claudiaareneee opened this issue Feb 10, 2025 · 4 comments
Labels
drawing-production enhancement New feature or request

Comments

@claudiaareneee
Copy link
Contributor

claudiaareneee commented Feb 10, 2025

Is your feature request related to a problem? Please describe.

I would like to be able to insert tabs into a TextBlock. It's just whitespace, so I'm thinking something similar to LineBreakRun that adds whitespace for tabbing.

Update*

Example use case:

User hits the tab key to indent the beginning of a paragraph. It should count as one character. When the user hits backspace, the whole tab should be deleted. I propose adding a new run called TabRun to act both as a single unit for this action and as a way of persisting this information.

Describe the solution you'd like

A new type of run should be created called TabRun

  • StyleOverrides should include a spaces property to specify how many spaces make up a tab. Usually 2 or 4 spaces. Default would be 4.
  • In the stringify method, users should be able to specify if they want their tabs to be computed with spaces or as a tab ("\t") character.
@pmconne
Copy link
Member

pmconne commented Feb 10, 2025

Can you please clarify the problem you are solving (not "I want this" but "user is trying to do X and I propose solving it via Y")?
I want to assume that you want to preserve in the text block that the user inserted tabs, not spaces, so when the user re-edits it and presses backspace over a tab it deletes all the inserted spaces?

@claudiaareneee
Copy link
Contributor Author

Modified the description to be more explicit

@pmconne
Copy link
Member

pmconne commented Feb 10, 2025

To be clear, number of spaces per tab could only be applied when editing the text. At display time it must be fixed - each user couldn't independently decide how many spaces they want to see.

@claudiaareneee
Copy link
Contributor Author

claudiaareneee commented Feb 10, 2025

Exactly, yes.

I assume it would similar to other style attributes like stackedFractionType or lineSpacingFactor that are used when computing the graphics. To change these settings, the user would have to edit the text itself. In our case, using out text editor.

Truthfully, I can't see a user doing this often, but instead of hardcoding '4', we could treat it like lineSpacingFactor as that's the pattern that's already there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drawing-production enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants