Skip to content

Commit

Permalink
dev: use fontdb to load system fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Nov 6, 2023
1 parent f056b17 commit bf3b102
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 149 deletions.
18 changes: 15 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ tokio-tungstenite = "0.20.0"

# system
dirs = "5"
fontdb = "0.15.0" # "0.15.0"
memmap2 = "0.9"
notify = "6"
path-clean = "1.0.1"
Expand Down Expand Up @@ -223,3 +224,5 @@ hayagriva = { git = "https://github.com/Myriad-Dreamin/hayagriva.git", branch =
# typst-syntax = { path = "../typst/crates/typst-syntax" }
# typst-ide = { path = "../typst/crates/typst-ide" }
# hayagriva = { path = "../hayagriva" }

# fontdb = { path = "../fontdb" }
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ human-panic.workspace = true
typst-ts-core.workspace = true
typst-ts-compiler = { workspace = true, default-features = false, features = [
"system",
# "lazy-fontdb",
"dynamic-layout",
] }

Expand Down
1 change: 0 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ fn measure_fonts(args: MeasureFontsArgs) -> ! {

let world = TypstSystemWorld::new(CompileOpts {
root_dir: root_path,
font_profile_paths,
font_paths: args.font.paths,
font_profile_cache_path: args.output.clone(),
no_system_fonts: args.no_system_fonts,
Expand Down
7 changes: 5 additions & 2 deletions compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ flate2.workspace = true
ecow.workspace = true
instant.workspace = true
strum.workspace = true
rayon.workspace = true

serde.workspace = true
serde_json.workspace = true
serde-wasm-bindgen = { workspace = true, optional = true }

memmap2 = { workspace = true, optional = true }
dirs = { workspace = true, optional = true }
walkdir = { workspace = true, optional = true }
notify = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
pollster = { workspace = true, optional = true }
log = { workspace = true, optional = true }
fontdb = { workspace = true, optional = true }

chrono = { workspace = true }
base64.workspace = true
rustc-hash.workspace = true
Expand Down Expand Up @@ -85,12 +87,13 @@ serde.workspace = true
[features]
cjk = []
emoji = []
lazy-fontdb = []
system-compile = [
"dep:memmap2",
"dep:dirs",
"dep:walkdir",
"dep:notify",
"dep:log",
"dep:fontdb",
]
system-watch = ["dep:notify", "dep:tokio"]
system = ["system-compile", "system-watch"]
Expand Down
Loading

0 comments on commit bf3b102

Please sign in to comment.