mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
layout: Turn on synthetic small-caps for layout 2020 (#31435)
Synthetic small caps is supported by the font subsystem, but this is disabled in Layout 2020. We can turn this on to bring support to parity with the old layout system. In addition to turning on synthetic small-caps this change also improves the way that they work. Before, synthetic small caps meant that every character was a small version of capitalized character. After this change, capital letters are larger than small caps versions of small letters -- matching other browsers and the common expectation of how small caps works.
This commit is contained in:
parent
98bd306816
commit
5ba29c20ac
48 changed files with 214 additions and 176 deletions
|
@ -664,11 +664,14 @@ impl RunInfo {
|
|||
}
|
||||
|
||||
fn has_font(&self, font: &Option<FontRef>) -> bool {
|
||||
fn identifier(font: &Option<FontRef>) -> Option<Atom> {
|
||||
font.as_ref().map(|f| f.borrow().identifier())
|
||||
fn identifier_and_pt_size(font: &Option<FontRef>) -> Option<(Atom, Au)> {
|
||||
font.as_ref().map(|font| {
|
||||
let font = font.borrow();
|
||||
(font.identifier(), font.descriptor.pt_size)
|
||||
})
|
||||
}
|
||||
|
||||
identifier(&self.font) == identifier(font)
|
||||
identifier_and_pt_size(&self.font) == identifier_and_pt_size(font)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue