aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-10-10 10:20:19 +0200
committerAlex Auvolat <alex@adnab.me>2023-10-10 10:20:19 +0200
commit0b7b96267a4151d00e31c50946d088701689db34 (patch)
tree0b65f0cb794f41fa2a50b24e687e8d096fda8e2f
parent727f5657f0a801fc68c0e04e791dcd34cc605fba (diff)
downloaddatagengo-0b7b96267a4151d00e31c50946d088701689db34.tar.gz
datagengo-0b7b96267a4151d00e31c50946d088701689db34.zip
ensure sans-serif font is used in all browsers
-rw-r--r--src/main.rs8
-rw-r--r--static/style.css10
2 files changed, 14 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index b69a2da..ba31b5a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1168,7 +1168,7 @@ fn format_batch_aux<'a>(
for ex in batch.extra_examples.iter() {
writeln!(
f,
- r#"<tr><td style="text-align: center"><span style="font-size: 1.2em">&nbsp;&nbsp;{}&nbsp;&nbsp;</span><br />{}</td></tr>"#,
+ r#"<tr><td style="text-align: center"><span class="tab_large font_ja">&nbsp;&nbsp;{}&nbsp;&nbsp;</span><br />{}</td></tr>"#,
ex.ja, ex.en
)?;
}
@@ -1192,7 +1192,7 @@ fn format_vocab(f: &mut impl Write, vocab: &[&JlptVocab], t: &str) -> Result<()>
for v in vocab {
writeln!(
f,
- r#"<tr><td>{}</td><td>&nbsp;&nbsp;<span style="font-size: 1.2em">{}</span>&nbsp;&nbsp;</td><td>{}</td><td>{}</td></tr>"#,
+ r#"<tr><td>{}</td><td>&nbsp;&nbsp;<span class="tab_large font_ja">{}</span>&nbsp;&nbsp;</td><td>{}</td><td>{}</td></tr>"#,
v.level, v.kanji, v.en, v.kana
)?;
}
@@ -1259,7 +1259,7 @@ fn format_index(batches: &[Batch], kanji_levels: &[(String, String)]) -> Result<
for (i, batch) in batches.iter().enumerate() {
writeln!(
f,
- r#"<tr><td><a href="{:03}.html">{:03}</a></td><td>{}</td><td>{}</td><td>&nbsp;&nbsp;{}</td><td>{}</td><td>{}</td><td>{}</td></tr>"#,
+ r#"<tr><td><a href="{:03}.html">{:03}</a></td><td>{}</td><td class="font_ja">{}</td><td>&nbsp;&nbsp;{}</td><td class="font_ja">{}</td><td class="font_ja">{}</td><td class="font_ja">{}</td></tr>"#,
i,
i,
batch.level,
@@ -1293,7 +1293,7 @@ fn format_index(batches: &[Batch], kanji_levels: &[(String, String)]) -> Result<
let missing = chars.diff(&all_chars);
writeln!(
f,
- "<tr><td>{}</td><td>{}</td><td>{}</td><td>{} ({})</td></tr>",
+ r#"<tr><td>{}</td><td>{}</td><td class="font_ja">{}</td><td><span class="font_ja">{}</span> ({})</td></tr>"#,
lvl,
chars.len(),
chars.to_string(),
diff --git a/static/style.css b/static/style.css
index dd96813..047624e 100644
--- a/static/style.css
+++ b/static/style.css
@@ -1,3 +1,4 @@
+
a {
color: blue;
text-decoration: none;
@@ -23,6 +24,7 @@ table {
.ja {
text-align: center;
font-size: 2rem;
+ font-family: 'MS PGothic', Osaka, Arial, sans-serif;
}
.ja:hover .char_cur {
@@ -85,3 +87,11 @@ details .chars {
.extratable td {
padding: 4px;
}
+
+.tab_large {
+ font-size: 1.2em;
+}
+
+.font_ja {
+ font-family: 'MS PGothic', Osaka, Arial, sans-serif;
+}