Skip to content

Commit

Permalink
Added XITS font for unicode typesetting
Browse files Browse the repository at this point in the history
  • Loading branch information
tirix committed Oct 31, 2023
1 parent 8483900 commit 5a5f8a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
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.

0 comments on commit 5a5f8a0

Please sign in to comment.