mirror of
https://github.com/typst/typst
synced 2025-08-15 15:38:33 +08:00
Compare commits
3 Commits
efdb75558f
...
e60d3021a7
Author | SHA1 | Date | |
---|---|---|---|
|
e60d3021a7 | ||
|
326bec1f0d | ||
|
758ee78ef5 |
@ -361,7 +361,7 @@ pub struct FontArgs {
|
||||
|
||||
/// Ensures system fonts won't be searched, unless explicitly included via
|
||||
/// `--font-path`.
|
||||
#[arg(long)]
|
||||
#[arg(long, env = "TYPST_IGNORE_SYSTEM_FONTS")]
|
||||
pub ignore_system_fonts: bool,
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,9 @@ impl World for SystemWorld {
|
||||
}
|
||||
|
||||
fn font(&self, index: usize) -> Option<Font> {
|
||||
self.fonts[index].get()
|
||||
// comemo's validation may invoke this function with an invalid index. This is
|
||||
// impossible in typst-cli but possible if a custom tool mutates the fonts.
|
||||
self.fonts.get(index)?.get()
|
||||
}
|
||||
|
||||
fn today(&self, offset: Option<i64>) -> Option<Datetime> {
|
||||
|
@ -97,7 +97,7 @@ impl World for TestWorld {
|
||||
}
|
||||
|
||||
fn font(&self, index: usize) -> Option<Font> {
|
||||
Some(self.base.fonts[index].clone())
|
||||
self.base.fonts.get(index).cloned()
|
||||
}
|
||||
|
||||
fn today(&self, _: Option<i64>) -> Option<Datetime> {
|
||||
|
@ -4,5 +4,5 @@ equation = Rovnice
|
||||
bibliography = Bibliografie
|
||||
heading = Kapitola
|
||||
outline = Obsah
|
||||
raw = Seznam
|
||||
raw = Výpis
|
||||
page = strana
|
@ -498,7 +498,7 @@ impl World for DocWorld {
|
||||
}
|
||||
|
||||
fn font(&self, index: usize) -> Option<Font> {
|
||||
Some(FONTS.1[index].clone())
|
||||
FONTS.1.get(index).cloned()
|
||||
}
|
||||
|
||||
fn today(&self, _: Option<i64>) -> Option<Datetime> {
|
||||
|
@ -67,7 +67,7 @@ impl World for TestWorld {
|
||||
}
|
||||
|
||||
fn font(&self, index: usize) -> Option<Font> {
|
||||
Some(self.base.fonts[index].clone())
|
||||
self.base.fonts.get(index).cloned()
|
||||
}
|
||||
|
||||
fn today(&self, _: Option<i64>) -> Option<Datetime> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user