Resolve XeTeX font probes and expose real OpenType math parameters

This commit is contained in:
gloamxun committed 2026-11-21 14:23:48 +08:00
1 parent 01ef302fb0
commit 7070cc6b82
12 files changed
+428 -27

No files matched your search

@@ -366,9 +366,48 @@ pub enum Primitive {
XeTeXpdffile,
XeTeXpdfpagecount,
XeTeXpicfile,
XeTeXfonttype,
XeTeXcountglyphs,
XeTeXcharglyph,
XeTeXglyphindex,
XeTeXOTcountscripts,
XeTeXOTscripttag,
XeTeXOTcountlanguages,
XeTeXOTlanguagetag,
XeTeXOTcountfeatures,
XeTeXOTfeaturetag,
}
impl Primitive {
const XETEX_FONT_QUERIES: [Self; 10] = [
Self::XeTeXfonttype,
Self::XeTeXcountglyphs,
Self::XeTeXcharglyph,
Self::XeTeXglyphindex,
Self::XeTeXOTcountscripts,
Self::XeTeXOTscripttag,
Self::XeTeXOTcountlanguages,
Self::XeTeXOTlanguagetag,
Self::XeTeXOTcountfeatures,
Self::XeTeXOTfeaturetag,
];
pub(super) fn xetex_font_query_name(self) -> Option<&'static str> {
Some(match self {
Self::XeTeXfonttype => "XeTeXfonttype",
Self::XeTeXcountglyphs => "XeTeXcountglyphs",
Self::XeTeXcharglyph => "XeTeXcharglyph",
Self::XeTeXglyphindex => "XeTeXglyphindex",
Self::XeTeXOTcountscripts => "XeTeXOTcountscripts",
Self::XeTeXOTscripttag => "XeTeXOTscripttag",
Self::XeTeXOTcountlanguages => "XeTeXOTcountlanguages",
Self::XeTeXOTlanguagetag => "XeTeXOTlanguagetag",
Self::XeTeXOTcountfeatures => "XeTeXOTcountfeatures",
Self::XeTeXOTfeaturetag => "XeTeXOTfeaturetag",
_ => return None,
})
}
pub(super) fn page_dimension(self) -> Option<usize> {
use Primitive::*;
Some(match self {
@@ -1643,6 +1682,13 @@ impl State {
] {
self.update_profile_command(name, Meaning::Primitive(primitive), enabled);
}
for primitive in Primitive::XETEX_FONT_QUERIES {
self.update_profile_command(
primitive.xetex_font_query_name().unwrap(),
Meaning::Primitive(primitive),
enabled,
);
}
for parameter in Parameter::XETEX {
self.update_profile_command(
&parameter.name(),