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

\t not worked for string in the Label #4327

Closed
nekronk opened this issue Apr 15, 2016 · 6 comments · Fixed by #76129
Closed

\t not worked for string in the Label #4327

nekronk opened this issue Apr 15, 2016 · 6 comments · Fixed by #76129
Milestone

Comments

@nekronk
Copy link

nekronk commented Apr 15, 2016

Operating system or device:
Windows 10

Issue description (what happened, and what was expected):
\t not worked in the method set_text() for Label object
Example:
get_node("Label").set_text('tab test**\t**wwww')

Steps to reproduce:

  1. Create the Control node
  2. Create the Label node in the Control
  3. Create new script for Control node
  4. Set script text:
extends Control

func _ready():
    get_node("Label").set_text('tab test\twwww')

Link to minimal example project (optional but very welcome):
See screenshot: http://i.imgur.com/Dw6y6YE.png

@StraToN
Copy link
Member

StraToN commented Apr 15, 2016

Very close to #2967
Maybe consider merging both issues?

@akien-mga
Copy link
Member

Indeed, closing as duplicate of #2967. I'll add a mention about \t and Label there.

@DarthSmart
Copy link

Apparently \t still doesnt work for Labels in 3.4.2 🤨

@Calinou
Copy link
Member

Calinou commented Feb 12, 2022

Apparently \t still doesnt work for Labels in 3.4.2 raised_eyebrow

You can generally replace it with four spaces to get a similar appearance (or 1-3 spaces if there's already text before the tab character):

$SomeLabel.text = "\tHello world".replace("\t", "    ")

@VapidLinus
Copy link

This was closed but was not fixed by the linked PR. Issue still present in Godot 4

@bruvzg
Copy link
Member

bruvzg commented Apr 16, 2023

It's not a bug as such, tab width is context dependent, and by default, tab character in most of the fonts is zero width. But I guess adding an option to enable tab stops for the Label will make sense (since RichTextLable already support it).

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

Successfully merging a pull request may close this issue.

7 participants