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

Proper tab stops for preformatted text #7788

Open
mbrubeck opened this issue Sep 29, 2015 · 0 comments
Open

Proper tab stops for preformatted text #7788

mbrubeck opened this issue Sep 29, 2015 · 0 comments

Comments

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Sep 29, 2015

Currently we advance by eight spaces for each tab character ('\t', U+0009) in preformatted text: https://github.com/servo/servo/blob/master/components/gfx/text/shaping/harfbuzz.rs#L514

Instead, tabs should advance to the next multiple of the tab-stop width:

All tabs (U+0009) are rendered as a horizontal shift that lines up the start edge of the next glyph with the next tab stop. Tab stops occur at points that are multiples of 8 times the width of a space (U+0020) rendered in the block's font from the block's starting content edge.

http://www.w3.org/TR/CSS2/text.html#white-space-model

mbrubeck referenced this issue in mbrubeck/servo Sep 29, 2015
Harfbuzz now renders tabs with a "missing character" glyph by default, so we
need to filter them out ourselves after computing an advance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.