I am trying to open a Simple webpage in JavaFX Webview. I have used my organization's custom font file. When I am opening the webpage in browser manually it's working fine and looking like this.
but when I am running my JavaFX application and displaying the webpage in webview, it's getting displayed like this:
It's clearly visible that Font-family is not correct when displaying the webpage in WebView. User Agent used by WebEngine is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/602.1 (KHTML, like Gecko) JavaFX/8.0 Safari/602.1
Html Page:
<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: Sample;
src: url(fonts/Sample.woff2);
}
h1 {
width: 100%;
height: 76px;
font-size: 72px;
font-family:Sample;
font-weight: bold;
font-stretch: normal;
font-style: normal;
line-height: 1.00;
letter-spacing: normal;
text-align: center;
color: #333333;
}
</style>
</head>
<body>
<h1>Checkout unavailable</h1>
</body>
</html>
Can anybody please suggest what can resolve this issue.
question from:
https://stackoverflow.com/questions/65842814/font-family-not-getting-visible-correctly-in-javafx-webview 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…