Render XeTeX OpenType math accents and stretch constructions
This commit is contained in:
1 parent
01b3931ae0
commit
821631778e
16 files changed
+825
-144
No files matched your search
@@ -245,6 +245,7 @@ impl Executor {
|
||||
class,
|
||||
limits: OperatorLimits::Display,
|
||||
accent: None,
|
||||
accent_style: AccentStyle::default(),
|
||||
rule: None,
|
||||
vcenter: false,
|
||||
nucleus,
|
||||
@@ -706,12 +707,28 @@ impl Executor {
|
||||
n.source.operator = PaintSource::token(TokenOrigin::from(token));
|
||||
b.pending = Some(FieldTarget::Nucleus(i));
|
||||
}
|
||||
Mathaccent => {
|
||||
let code = self.integer(files)?;
|
||||
if !(0..32768).contains(&code) {
|
||||
return self.fail("mathaccent must be in 0..32767");
|
||||
}
|
||||
let (_, accent) = self.decode_math_char(code as u16);
|
||||
Mathaccent | Umathaccent => {
|
||||
let (accent, accent_style) = if *p == Umathaccent {
|
||||
let mode = if self.keyword("fixed", files)? {
|
||||
AccentStyle::Fixed
|
||||
} else if self.keyword("bottom", files)? {
|
||||
if self.keyword("fixed", files)? {
|
||||
AccentStyle::BottomFixed
|
||||
} else {
|
||||
AccentStyle::Bottom
|
||||
}
|
||||
} else {
|
||||
AccentStyle::Top
|
||||
};
|
||||
let code = self.scan_unicode_math_code(true, files)?;
|
||||
(self.explicit_math_code(code)?.1, mode)
|
||||
} else {
|
||||
let code = self.integer(files)?;
|
||||
if !(0..32768).contains(&code) {
|
||||
return self.fail("mathaccent must be in 0..32767");
|
||||
}
|
||||
(self.decode_math_char(code as u16).1, AccentStyle::Top)
|
||||
};
|
||||
self.new_noad(NoadClass::Ord, MathField::Empty, token.span);
|
||||
let b = self.math.last_mut().unwrap();
|
||||
let i = b.nodes.len() - 1;
|
||||
@@ -719,6 +736,7 @@ impl Executor {
|
||||
unreachable!()
|
||||
};
|
||||
n.accent = Some(accent);
|
||||
n.accent_style = accent_style;
|
||||
n.source.operator = PaintSource::token(TokenOrigin::from(token));
|
||||
b.pending = Some(FieldTarget::Nucleus(i));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user