[css-inline-3] make `text` of `leading-trim` interoperable? · Issue #3978 · w3c/csswg-drafts · GitHub
Skip to content

[css-inline-3] make text of leading-trim interoperable? #3978

Description

@kojiishi

Unfortunately all impls compute different positions for text-top, and that the leading-trim: text value using it doesn't make this property interoperable. I would like the property to provide at least one value that is interoperable across platforms (browsers/OS).

I discussed with @litherum on this before. IIUC we would like to have two text-top/bottom metrics; one which is interoperable, another which is compatible with the current layout engine of the platform.

How about something like:

Value Description
platform-text Use the text-top/bottom metric. This value matches to metric used by the layout, but may vary by platform.
typo-text Use the text-top/bottom metric using sTypoAscender/sTypoDescender from os/2 table in OpenType fonts, or the tightest metrics on other font systems that can provide multiple text metrics.
em-height Use the text-top/bottom metrics using the synthesized em-height metrics. The em-height metrics is computed by normalizing the typo-text metrics to 1em. For example, the text-top em-height for OpenType is computed by sTypoAscender / (sTypoAscender + sTypoDescender) * font-size.

The em-height is a metric invented by Gecko, @jfkthame explained here.

@fantasai

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions