Use shaped glyph edges for XeTeX protrusion and line breaking
This commit is contained in:
1 parent
5df90f113c
commit
6826efbeb1
12 files changed
+231
-39
No files matched your search
@@ -2281,8 +2281,13 @@ impl Executor {
|
||||
Ok(self.state.fonts.auto_kern_code(font, slot, p == Primitive::Knaccode))
|
||||
}
|
||||
Meaning::Primitive(p @ (Primitive::Lpcode | Primitive::Rpcode)) => {
|
||||
let (font, slot) = self.font_character_target(files)?;
|
||||
Ok(self.state.fonts.protrusion_code(font, slot, p == Primitive::Rpcode))
|
||||
let (font, slot) = self.protrusion_target(files)?;
|
||||
let right = p == Primitive::Rpcode;
|
||||
Ok(if self.state.input_profile() == InputProfile::XeTeX {
|
||||
self.state.fonts.xe_protrusion_code(font, slot, right)
|
||||
} else {
|
||||
self.state.fonts.protrusion_code(font, slot as u8, right)
|
||||
})
|
||||
}
|
||||
Meaning::Primitive(p @ (Primitive::Hyphenchar | Primitive::Skewchar)) => {
|
||||
let font = self.font_identifier(files)?;
|
||||
@@ -4344,10 +4349,15 @@ impl Executor {
|
||||
self.state.fonts.set_auto_kern_code(font, slot, primitive == Some(Knaccode), code);
|
||||
}
|
||||
Some(Lpcode | Rpcode) => {
|
||||
let (font, slot) = self.font_character_target(files)?;
|
||||
let (font, slot) = self.protrusion_target(files)?;
|
||||
self.optional_equals(files)?;
|
||||
let code = self.integer(files)?;
|
||||
self.state.fonts.set_protrusion_code(font, slot, primitive == Some(Rpcode), code);
|
||||
let right = primitive == Some(Rpcode);
|
||||
if self.state.input_profile() == InputProfile::XeTeX {
|
||||
self.state.fonts.set_xe_protrusion_code(font, slot, right, code);
|
||||
} else {
|
||||
self.state.fonts.set_protrusion_code(font, slot as u8, right, code);
|
||||
}
|
||||
}
|
||||
Some(Hyphenchar | Skewchar) => {
|
||||
let font = self.font_identifier(files)?;
|
||||
|
||||
Reference in new issue
Block a user