Chinese characters cannot be used in italics
Bug Description
Reproducible Code (if applicable)
export component GeneratedPage inherits Window {
Rectangle {
width: 100%;
height: 100%;
VerticalLayout {
Text {
text: "重点提示:HTML 是网页的基础结构语言,CSS 用于美化页面样式。";
font-size: 16px;
color: #3498db;
font-italic: true;
}
Text {
text: "Key Tip: HTML is the foundational structure language of web pages, while CSS is used to beautify page styles.";
font-size: 16px;
color: #3498db;
font-italic: true;
}
}
}
}
Environment Details
- Slint Version: 1.14.1
- Platform/OS: Windows 11
- Programming Language: Rust
- Backend/Renderer: femtovg
Product Impact
No response
The image above is an HTML screenshot
Not solving your problem but just leaving a note here. Italics are generally not used in Asian character sets. For CJK text, the right way to express emphasis (or quote) is to use another style (usually serif font).
For that reason CJK fonts often don't contain italic variants, and browsers by default synthesis italic by applying skew transformations, which is likely not implemented by whatever font rendering pipeline used by slint?
References: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-synthesis https://stackoverflow.com/questions/21009957/italic-font-not-work-for-chinese-japanese-korean-on-ios-7
I agree with your analysis.
For that reason CJK fonts often don't contain italic variants, and browsers by default synthesis italic by applying skew transformations, which is likely not implemented by whatever font rendering pipeline used by slint?
Yes, exactly. We should however implement synthesis.