diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-09-13 14:04:12 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-09-13 14:44:45 +0200 |
| commit | f9feea3f2972815165b357724a9764a7d32377dc (patch) | |
| tree | e20fc77431e501d65ad3eb615a1dc73d006d2cb8 /crates | |
| parent | e77d9350140eeaef8b5f5c324eb34a402f581290 (diff) | |
Bump dependencies
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst-cli/Cargo.toml | 14 | ||||
| -rw-r--r-- | crates/typst-cli/src/compile.rs | 2 | ||||
| -rw-r--r-- | crates/typst-docs/Cargo.toml | 2 | ||||
| -rw-r--r-- | crates/typst-library/Cargo.toml | 6 | ||||
| -rw-r--r-- | crates/typst-library/src/math/fragment.rs | 2 | ||||
| -rw-r--r-- | crates/typst/Cargo.toml | 14 | ||||
| -rw-r--r-- | crates/typst/src/export/pdf/font.rs | 6 | ||||
| -rw-r--r-- | crates/typst/src/export/render.rs | 7 | ||||
| -rw-r--r-- | crates/typst/src/export/svg.rs | 9 | ||||
| -rw-r--r-- | crates/typst/src/image.rs | 26 |
10 files changed, 45 insertions, 43 deletions
diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml index d2418307..0da03afc 100644 --- a/crates/typst-cli/Cargo.toml +++ b/crates/typst-cli/Cargo.toml @@ -23,18 +23,18 @@ doc = false typst = { path = "../typst" } typst-library = { path = "../typst-library" } chrono = { version = "0.4.24", default-features = false, features = ["clock", "std"] } -clap = { version = "4.2.4", features = ["derive", "env"] } +clap = { version = "4.4", features = ["derive", "env"] } codespan-reporting = "0.11" comemo = "0.3" ecow = "0.1.1" dirs = "5" flate2 = "1" inferno = "0.11.15" -memmap2 = "0.5" -notify = "5" +memmap2 = "0.7" +notify = "6" once_cell = "1" -open = "4.0.2" -pathdiff = "0.1" +open = "5" +pathdiff = "0.2" same-file = "1" # https://github.com/mitsuhiko/self-replace/pull/16 self-replace = { git = "https://github.com/typst/self-replace", optional = true } @@ -58,10 +58,10 @@ xz2 = { version = "0.1", optional = true } zip = { version = "0.6", optional = true } [build-dependencies] -semver = "1" -clap = { version = "4.2.4", features = ["derive", "string"] } +clap = { version = "4.4", features = ["derive", "string"] } clap_complete = "4.2.1" clap_mangen = "0.2.10" +semver = "1" [features] default = ["embed-fonts"] diff --git a/crates/typst-cli/src/compile.rs b/crates/typst-cli/src/compile.rs index 8cec8953..c2d6ea01 100644 --- a/crates/typst-cli/src/compile.rs +++ b/crates/typst-cli/src/compile.rs @@ -271,7 +271,7 @@ impl<'a> codespan_reporting::files::Files<'a> for SystemWorld { // Try to express the path relative to the working directory. vpath .resolve(self.root()) - .and_then(|abs| pathdiff::diff_paths(&abs, self.workdir())) + .and_then(|abs| pathdiff::diff_paths(abs, self.workdir())) .as_deref() .unwrap_or_else(|| vpath.as_rootless_path()) .to_string_lossy() diff --git a/crates/typst-docs/Cargo.toml b/crates/typst-docs/Cargo.toml index b9158a38..e9d84658 100644 --- a/crates/typst-docs/Cargo.toml +++ b/crates/typst-docs/Cargo.toml @@ -20,7 +20,7 @@ include_dir = "0.7" once_cell = "1" pulldown-cmark = "0.9" serde = { version = "1.0.184", features = ["derive"] } -serde_yaml = "0.8" +serde_yaml = "0.9" syntect = { version = "5", default-features = false, features = ["parsing", "html", "regex-fancy"] } typed-arena = "2" unicode_names2 = "0.6.0" diff --git a/crates/typst-library/Cargo.toml b/crates/typst-library/Cargo.toml index 040a4405..dd7c0cc5 100644 --- a/crates/typst-library/Cargo.toml +++ b/crates/typst-library/Cargo.toml @@ -38,13 +38,13 @@ ciborium = "0.2.1" roxmltree = "0.18" rustybuzz = "0.7" serde_json = "1" -serde_yaml = "0.8" +serde_yaml = "0.9" smallvec = "1.10" syntect = { version = "5", default-features = false, features = ["parsing", "regex-fancy", "plist-load", "yaml-load"] } time = { version = "0.3.20", features = ["formatting"] } -toml = { version = "0.7.4"} +toml = { version = "0.8" } tracing = "0.1.37" -ttf-parser = "0.18.1" +ttf-parser = "0.19.2" typed-arena = "2" unicode-bidi = "0.3.13" unicode-math-class = "0.1" diff --git a/crates/typst-library/src/math/fragment.rs b/crates/typst-library/src/math/fragment.rs index 8e051074..4e174349 100644 --- a/crates/typst-library/src/math/fragment.rs +++ b/crates/typst-library/src/math/fragment.rs @@ -472,7 +472,7 @@ impl<'a> GlyphwiseSubsts<'a> { pub fn new(gsub: LayoutTable<'a>, feature: Feature) -> Option<Self> { let table = gsub .features - .find(feature.tag) + .find(ttf_parser::Tag(feature.tag.0)) .and_then(|feature| feature.lookup_indices.get(0)) .and_then(|index| gsub.lookups.get(index))?; let table = table.subtables.get::<SubstitutionSubtable>(0)?; diff --git a/crates/typst/Cargo.toml b/crates/typst/Cargo.toml index e3c4c6c1..d9918b11 100644 --- a/crates/typst/Cargo.toml +++ b/crates/typst/Cargo.toml @@ -24,16 +24,16 @@ bytemuck = "1" comemo = "0.3" ecow = { version = "0.1.2", features = ["serde"] } flate2 = "1" -fontdb = "0.13" +fontdb = { version = "0.13", default-features = false } if_chain = "1" image = { version = "0.24", default-features = false, features = ["png", "jpeg", "gif"] } -indexmap = { version = "1.9.3", features = ["serde"] } +indexmap = { version = "2", features = ["serde"] } log = "0.4" miniz_oxide = "0.7" oklab = "1" once_cell = "1" pdf-writer = "0.8.1" -pixglyph = "0.1" +pixglyph = "0.2" regex = "1" resvg = { version = "0.32", default-features = false, features = ["raster-images"] } roxmltree = "0.18" @@ -43,10 +43,10 @@ siphasher = "0.3" subsetter = "0.1.1" svg2pdf = "0.6" tiny-skia = "0.9.0" -toml = { version = "0.7.4", default-features = false, features = ["parse"] } +toml = { version = "0.8", default-features = false, features = ["parse"] } tracing = "0.1.37" -ttf-parser = "0.18.1" -unicode-general-category = "0.6" +ttf-parser = "0.19.2" +unicode-properties = "0.1" unicode-ident = "1.0" unicode-math-class = "0.1" unicode-segmentation = "1" @@ -55,7 +55,7 @@ usvg = { version = "0.32", default-features = false, features = ["text"] } xmlwriter = "0.1.0" xmp-writer = "0.1" time = { version = "0.3.20", features = ["std", "formatting", "macros"] } -wasmi = "0.30.0" +wasmi = "0.31.0" xmlparser = "0.13.5" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/crates/typst/src/export/pdf/font.rs b/crates/typst/src/export/pdf/font.rs index ceffd4cc..4b10ead9 100644 --- a/crates/typst/src/export/pdf/font.rs +++ b/crates/typst/src/export/pdf/font.rs @@ -4,7 +4,7 @@ use ecow::{eco_format, EcoString}; use pdf_writer::types::{CidFontType, FontFlags, SystemInfo, UnicodeCmap}; use pdf_writer::{Filter, Finish, Name, Rect, Str}; use ttf_parser::{name_id, GlyphId, Tag}; -use unicode_general_category::GeneralCategory; +use unicode_properties::{GeneralCategory, UnicodeGeneralCategory}; use super::{deflate, EmExt, PdfContext, RefExt}; use crate::eval::Bytes; @@ -215,9 +215,7 @@ fn create_cmap( subtable.codepoints(|n| { let Some(c) = std::char::from_u32(n) else { return }; - if unicode_general_category::get_general_category(c) - == GeneralCategory::PrivateUse - { + if c.general_category() == GeneralCategory::PrivateUse { return; } diff --git a/crates/typst/src/export/render.rs b/crates/typst/src/export/render.rs index fc056b75..ac2a8b3d 100644 --- a/crates/typst/src/export/render.rs +++ b/crates/typst/src/export/render.rs @@ -17,7 +17,7 @@ use crate::geom::{ self, Abs, Color, FixedStroke, Geometry, LineCap, LineJoin, Paint, PathItem, Shape, Size, Transform, }; -use crate::image::{DecodedImage, Image}; +use crate::image::{DecodedImage, Image, RasterFormat}; /// Export a frame into a raster image. /// @@ -296,7 +296,10 @@ fn render_bitmap_glyph( let size = text.size.to_f32(); let ppem = size * ts.sy; let raster = text.font.ttf().glyph_raster_image(id, ppem as u16)?; - let image = Image::new(raster.data.into(), raster.format.into(), None).ok()?; + if raster.format != ttf_parser::RasterImageFormat::PNG { + return None; + } + let image = Image::new(raster.data.into(), RasterFormat::Png.into(), None).ok()?; // FIXME: Vertical alignment isn't quite right for Apple Color Emoji, // and maybe also for Noto Color Emoji. And: Is the size calculation diff --git a/crates/typst/src/export/svg.rs b/crates/typst/src/export/svg.rs index 186f9726..c6807177 100644 --- a/crates/typst/src/export/svg.rs +++ b/crates/typst/src/export/svg.rs @@ -420,9 +420,12 @@ fn convert_outline_glyph_to_path(font: &Font, id: GlyphId) -> Option<EcoString> /// Convert a bitmap glyph to an encoded image URL. #[comemo::memoize] fn convert_bitmap_glyph_to_image(font: &Font, id: GlyphId) -> Option<(Image, f64, f64)> { - let bitmap = font.ttf().glyph_raster_image(id, std::u16::MAX)?; - let image = Image::new(bitmap.data.into(), bitmap.format.into(), None).ok()?; - Some((image, bitmap.x as f64, bitmap.y as f64)) + let raster = font.ttf().glyph_raster_image(id, std::u16::MAX)?; + if raster.format != ttf_parser::RasterImageFormat::PNG { + return None; + } + let image = Image::new(raster.data.into(), RasterFormat::Png.into(), None).ok()?; + Some((image, raster.x as f64, raster.y as f64)) } /// Convert an SVG glyph to an encoded image URL. diff --git a/crates/typst/src/image.rs b/crates/typst/src/image.rs index 0ede1d7e..182793d2 100644 --- a/crates/typst/src/image.rs +++ b/crates/typst/src/image.rs @@ -158,6 +158,18 @@ pub enum ImageFormat { Vector(VectorFormat), } +impl From<RasterFormat> for ImageFormat { + fn from(format: RasterFormat) -> Self { + Self::Raster(format) + } +} + +impl From<VectorFormat> for ImageFormat { + fn from(format: VectorFormat) -> Self { + Self::Vector(format) + } +} + cast! { ImageFormat, self => match self { @@ -216,20 +228,6 @@ impl TryFrom<image::ImageFormat> for RasterFormat { } } -impl From<ttf_parser::RasterImageFormat> for RasterFormat { - fn from(format: ttf_parser::RasterImageFormat) -> Self { - match format { - ttf_parser::RasterImageFormat::PNG => RasterFormat::Png, - } - } -} - -impl From<ttf_parser::RasterImageFormat> for ImageFormat { - fn from(format: ttf_parser::RasterImageFormat) -> Self { - Self::Raster(format.into()) - } -} - /// A decoded image. pub enum DecodedImage { /// A decoded pixel raster with its ICC profile. |
