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

8191758: Match WebKit's font weight rendering with JavaFX #180

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -71,7 +71,7 @@ std::unique_ptr<FontPlatformData> FontPlatformData::create(
family,
fontDescription.computedSize(),
isItalic(fontDescription.italic()),
isFontWeightBold(fontDescription.weight()));
fontDescription.weight() >= boldWeightValue());
return !wcFont ? nullptr : std::make_unique<FontPlatformData>(wcFont, fontDescription.computedSize());
}

@@ -26,6 +26,7 @@
package test.javafx.scene.web;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import java.io.File;
import java.util.concurrent.FutureTask;
@@ -89,4 +90,28 @@ private void setZoom(final WebView view, final float zoom) throws Exception {
view.setZoom(zoom);
});
}

/**
* @test
* @bug 8191758
* To make sure extra-heavy weights of the system font can be achieved
*/
@Test public void testFontWeights() {
loadContent(
"<!DOCTYPE html><html><head></head>" +
"<body>" +
" <div style=\"font: 19px system-ui\">" +
" <div style=\"font-style: italic;\">" +
" <span id=\"six\" style=\"font-weight: 600;\">Hello, World</span>" +
" <span id=\"nine\" style=\"font-weight: 900;\">Hello, World</span>" +
" </div>" +
" </div>" +
"</body> </html>"
);
submit(() -> {
assertFalse("Font weight test failed ",
(Boolean) getEngine().executeScript(
"document.getElementById('six').offsetWidth == document.getElementById('nine').offsetWidth"));
});
}
}
ProTip! Use n and p to navigate between commits in a pull request.