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

Add test checking the lang attribute affects rendering #50336

Conversation

mbrodesser-Igalia
Copy link
Contributor

@mbrodesser-Igalia mbrodesser-Igalia commented Jan 28, 2025

The added test is self-describing.

mbrodesser-Igalia and others added 2 commits January 28, 2025 15:10
The DejaVuSerif font was added since it provides different ligatures for
Catalan and English.

Not reusing <css/css-writing-modes/support/DejaVuSerif-webfont.woff>
since that's an older version, see [1], not providing different
ligatures. [2] Doesn't provide that functionality either.

The newly added <DejaVuSerif.ttf> stems from [2].

[1] https://github.com/web-platform-tests/wpt/commits/master/css/css-writing-modes/support/DejaVuSerif-webfont.woff
[2] http://sourceforge.net/projects/dejavu/files/dejavu/2.37/dejavu-fonts-ttf-2.37.zip
[3] https://github.com/web-platform-tests/wpt/blob/c3b8c1186bb1f3a4aedaff5311126aacb90cc868/fonts/noto/noto-sans-v8-latin-regular.woff
@mbrodesser-Igalia mbrodesser-Igalia changed the title Add test checking lang attribute affects ligatures Add test checking the lang attribute affects ligatures Jan 28, 2025
@mbrodesser-Igalia
Copy link
Contributor Author

The test passes for Chrome and Firefox. For WebKitGTK's MiniBrowser, it fails.

Copy link
Contributor

@drott drott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the test addition, this works, but I have some concerns about DejaVu Sans, in particular as this change suggests to add a second copy.

I noticed recently this font is not maintained since 2016 and also has some issues as missing cap height and x height metrics in the OS/2 table. Hence I would check to see if this could be demonstrated with open-source, more recently released and updated fonts, for example from the Noto collection or Roboto perhaps?

fonttools' ttx -tgsub -o- <font file> or HarfBuzz' hb-shape testing tool might help in identifying whether there are locale specific ligatures in such fonts.

@mbrodesser-Igalia
Copy link
Contributor Author

Thanks for the test addition, this works, but I have some concerns about DejaVu Sans, in particular as this change suggests to add a second copy.

I noticed recently this font is not maintained since 2016 and also has some issues as missing cap height and x height metrics in the OS/2 table. Hence I would check to see if this could be demonstrated with open-source, more recently released and updated fonts, for example from the Noto collection or Roboto perhaps?

fonttools' ttx -tgsub -o- <font file> or HarfBuzz' hb-shape testing tool might help in identifying whether there are locale specific ligatures in such fonts.

Thanks for the pointers. Learning why the test currently passes with the DejaVu font, before replacing that font.

ttx is case-sensitive, i.e. ttx -tGSUB -o- <font-file> is required.

@jfkthame
Copy link
Contributor

I'm happy to see additional test coverage for this sort of behavior. Just a note in passing: there's already a file css/css-fonts/language-specific-01.html that aims to exercise some language-dependent behavior; however, it lacks a linked reference file, so I guess it doesn't actually get used unless one loads and inspects it manually.

(It uses a copy of Lato, found in the support/fonts dir, which has different behavior for "fi" in Turkish vs default.)

So perhaps it'd be good to create a reference case for that file? (In addition to the new test being added here.)

@mbrodesser-Igalia
Copy link
Contributor Author

I'm happy to see additional test coverage for this sort of behavior. Just a note in passing: there's already a file css/css-fonts/language-specific-01.html that aims to exercise some language-dependent behavior; however, it lacks a linked reference file, so I guess it doesn't actually get used unless one loads and inspects it manually.

(It uses a copy of Lato, found in the support/fonts dir, which has different behavior for "fi" in Turkish vs default.)

So perhaps it'd be good to create a reference case for that file? (In addition to the new test being added here.)

Thanks for the pointers.

Updated this PR.

I'll add a separate test, checking "fi" for English and Turkish are rendered differently for the Lato font. Since the test of this PR relies on that assumption.

@mbrodesser-Igalia
Copy link
Contributor Author

I'll simplify the test of this PR. It's sufficient to check "fi" renders differently for Turkish and English.

@mbrodesser-Igalia mbrodesser-Igalia changed the title Add test checking the lang attribute affects ligatures Add test checking the lang attribute affects rendering Jan 29, 2025
@mbrodesser-Igalia
Copy link
Contributor Author

mbrodesser-Igalia commented Jan 29, 2025

I'm happy to see additional test coverage for this sort of behavior. Just a note in passing: there's already a file css/css-fonts/language-specific-01.html that aims to exercise some language-dependent behavior; however, it lacks a linked reference file, so I guess it doesn't actually get used unless one loads and inspects it manually.

(It uses a copy of Lato, found in the support/fonts dir, which has different behavior for "fi" in Turkish vs default.)

So perhaps it'd be good to create a reference case for that file? (In addition to the new test being added here.)

Will consider adding a reference case for that file, but in a separate PR.

Filed #50364 so that it's not forgotten, but I currently lack time for that change.

Copy link
Contributor

@drott drott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for updating the test to a leaner version without requiring a font addition. I'd suggest to hear it from Jonathan on the updated PR as well.

Copy link
Contributor

@jfkthame jfkthame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbrodesser-Igalia mbrodesser-Igalia merged commit 034aca8 into web-platform-tests:master Jan 29, 2025
19 checks passed
@mbrodesser-Igalia mbrodesser-Igalia deleted the AddTestCheckingLangAttributeAffectsLigatures branch January 29, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants