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

How are underlines positioned in Indic text? #28

Open
r12a opened this issue Nov 18, 2016 · 5 comments
Open

How are underlines positioned in Indic text? #28

r12a opened this issue Nov 18, 2016 · 5 comments
Labels

Comments

@r12a
Copy link
Contributor

r12a commented Nov 18, 2016

CSS and browser implementers are looking for information about how to position underlines for various scripts, especially for Indic scripts. Can we provide them with the information they need (and add it to the layout requirements doc)? See w3c/csswg-drafts#459 (comment)

@r12a r12a added the question label Nov 18, 2016
@tiroj
Copy link

tiroj commented Nov 21, 2016

A few thoughts on this:

  1. Ideally, underline position and thickness should be defined at the font level, with CSS only providing fallback default behaviour. There are, however, some issues with this:
  • a) In OpenType fonts, values for underlinePosition and underlineThickness are stored in the 'post' table. There is one pair of values for the whole font, regardless of how many different scripts are supported, and currently no way to specify different values for different scripts or language (writing) systems.
  • b) font tools tend to provide a default setting for these two values, and a lot of font makers appear not to alter the default setting, with the result that the data may not produce best results.

I think both of these issues could be addressed by defining localisable underline thickness and position values, probably as an extension of the existing but little-used 'BASE' table. This would not only provide layout software with appropriate values for different scripts and writing systems, but the newly defined data structure may well encourage font developers (and font tool makers) to pay more attention to this aspect of font production. This could also assist CSS in determining whether the font data is reliable.

[These comments also apply to the strikethrough height and thickness values, currently implemented in the 'OS/2' table, and similarly under-localised.]

  1. A lot of writing systems have conjunct forms, below marks, and/or vertical stacks that cut through the height of an underline. In addition to determining the appropriate height and thickness of underlines, it is also desirable to determine the preferred behaviour of underlining with descending glyphs, which might also differ depending on writing system.

This is complicated by the fact that the depth of a given sequence of characters in a complex script is font-dependent, and cannot be determined or even reliably guessed at from the character string.

@r12a
Copy link
Contributor Author

r12a commented Nov 22, 2016

John, i think it would be best to move the above comment to the discussion at w3c/csswg-drafts#459

Btw, note that CSS already attempts to address the need to avoid the underline running through ink below the baseline. https://drafts.csswg.org/css-text-decor-3/#text-decoration-skip-property

@r12a
Copy link
Contributor Author

r12a commented Nov 22, 2016

btw @tiroj this question was particularly about how to determine the position of an underline relative to the text, but your comment mentions two other topics related to underlines: (a) how to get the right thickness, and (b) how to skip parts of characters that would interfere with the underline. Here are some relevant CSS links:

(a) w3c/csswg-drafts#239 (and parts of w3c/csswg-drafts#459)

(b) https://drafts.csswg.org/css-text-decor-3/#text-decoration-skip-property - there are also some issues at https://github.com/w3c/csswg-drafts/issues?utf8=%E2%9C%93&q=skip

I'd suggest that the link at the top of the page w3c/csswg-drafts#459 is probably best restricted to discussion of the distance of the underline from the text.

@lianghai
Copy link

lianghai commented Jan 22, 2017

Underlines for Indic scripts don't have notable special behaviors compared to Latin ones, besides the common hopes (between Indic and Latin) of skipping descenders (text-decoration-skip) and adjusting the vertical position (*text-underline-offset).

The so-called "hanging baseline" is not relevant here.

@r12a
Copy link
Contributor Author

r12a commented Apr 24, 2017

The so-called "hanging baseline" is not relevant here.

@lianghai so what's the default position for the underline, and what is it calculated in reference to? Is it just below the 'alphabetic' baseline used for Latin text?

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

No branches or pull requests

3 participants