Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added XITS font for unicode typesetting #25

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/uni.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl UnicodeRenderer {
}

pub(crate) fn render_formula(&self, formula: &Formula) -> Result<String, String> {
let mut output: String = " ".into();
let mut output: String = "<span class=\"uni\"><span color=\"gray\">⊢</span> ".into();
// write!(output, "{} ", as_str(if use_provables
let typesetting = self.database.typesetting_result();
let nset = self.database.name_result();
Expand All @@ -34,11 +34,12 @@ impl UnicodeRenderer {
)
.unwrap();
}
write!(output, "</span>").unwrap();
Ok(output)
}

pub(crate) fn render_statement(&self, sref: &StatementRef) -> Result<String, String> {
let mut output: String = "".into();
let mut output: String = "<span class=\"uni\">".into();
let typesetting = self.database.typesetting_result();
for token in sref.math_iter() {
write!(
Expand All @@ -52,6 +53,7 @@ impl UnicodeRenderer {
)
.unwrap();
}
write!(output, "</span>").unwrap();
Ok(output)
}
}
6 changes: 6 additions & 0 deletions static/metamath.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@font-face {
font-family: XITSMath-Regular;
src: url("/static/xits-math.woff");
}

body {
color: #001;
font-family: Bitter,'Times New Roman', Times, serif;
Expand Down Expand Up @@ -183,6 +188,7 @@ ol.breadcrumb li:not(:last-child)::after, nav.typesettings ul li:not(:last-child
margin: 0 10px;
}

.uni { font-family: Bitter,'Times New Roman', Times, serif, XITSMath-Regular }
mjx-container { margin: .3em 0em !important }
mjx-container { float: left!important; width: inherit !important; text-align: left !important; }
mjx-container { display: inline-block!important; }
Expand Down
Binary file added static/xits-math.woff
Binary file not shown.