mirror of
https://github.com/typst/typst
synced 2025-05-21 04:25:28 +08:00
Bump pdf-writer and svg2pdf
This commit is contained in:
parent
333e4037fc
commit
7dc74b7281
9
Cargo.lock
generated
9
Cargo.lock
generated
@ -1670,12 +1670,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pdf-writer"
|
name = "pdf-writer"
|
||||||
version = "0.8.1"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9d77bc47c8968aa63f86a7e6693e270a6cbd1e3b784c364f1711a0ddecc71447"
|
checksum = "4b651409cd03bf702052d7491f08d27fbd6b25f96dc8b9b873ada7d0b3342b8d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"itoa",
|
"itoa",
|
||||||
|
"memchr",
|
||||||
"ryu",
|
"ryu",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -2367,9 +2368,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "svg2pdf"
|
name = "svg2pdf"
|
||||||
version = "0.7.1"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2adc7de163bd53f323850e65269280b2a66ffceee291cb8eca34f2eabc3acad"
|
checksum = "a4283ae77d25dbee75aa1bce6b5bc8e7d802960135d6de306eaec0a5241d80c8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"image",
|
"image",
|
||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
|
@ -31,7 +31,7 @@ kurbo = "0.9"
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
miniz_oxide = "0.7"
|
miniz_oxide = "0.7"
|
||||||
once_cell = "1"
|
once_cell = "1"
|
||||||
pdf-writer = "0.8.1"
|
pdf-writer = "0.9"
|
||||||
pixglyph = "0.2"
|
pixglyph = "0.2"
|
||||||
palette = { version = "0.7.3", default-features = false, features = ["approx", "libm"] }
|
palette = { version = "0.7.3", default-features = false, features = ["approx", "libm"] }
|
||||||
regex = "1"
|
regex = "1"
|
||||||
@ -41,7 +41,7 @@ rustybuzz = "0.7"
|
|||||||
serde = { version = "1.0.184", features = ["derive"] }
|
serde = { version = "1.0.184", features = ["derive"] }
|
||||||
siphasher = "0.3"
|
siphasher = "0.3"
|
||||||
subsetter = "0.1.1"
|
subsetter = "0.1.1"
|
||||||
svg2pdf = "0.7.1"
|
svg2pdf = "0.8"
|
||||||
tiny-skia = "0.10.0"
|
tiny-skia = "0.10.0"
|
||||||
toml = { version = "0.8", default-features = false, features = ["parse"] }
|
toml = { version = "0.8", default-features = false, features = ["parse"] }
|
||||||
tracing = "0.1.37"
|
tracing = "0.1.37"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use pdf_writer::types::DeviceNSubtype;
|
use pdf_writer::types::DeviceNSubtype;
|
||||||
use pdf_writer::{writers, Dict, Filter, Name, PdfWriter, Ref};
|
use pdf_writer::{writers, Chunk, Dict, Filter, Name, Ref};
|
||||||
|
|
||||||
use super::page::{PageContext, Transforms};
|
use super::page::{PageContext, Transforms};
|
||||||
use super::RefExt;
|
|
||||||
use crate::export::pdf::deflate;
|
use crate::export::pdf::deflate;
|
||||||
use crate::geom::{Color, ColorSpace, Paint};
|
use crate::geom::{Color, ColorSpace, Paint};
|
||||||
|
|
||||||
@ -162,7 +161,7 @@ impl ColorSpaces {
|
|||||||
|
|
||||||
/// Write the necessary color spaces functions and ICC profiles to the
|
/// Write the necessary color spaces functions and ICC profiles to the
|
||||||
/// PDF file.
|
/// PDF file.
|
||||||
pub fn write_functions(&self, writer: &mut PdfWriter) {
|
pub fn write_functions(&self, writer: &mut Chunk) {
|
||||||
// Write the Oklab function & color space
|
// Write the Oklab function & color space
|
||||||
if let Some(oklab) = self.oklab {
|
if let Some(oklab) = self.oklab {
|
||||||
let code = oklab_function();
|
let code = oklab_function();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use pdf_writer::Finish;
|
use pdf_writer::Finish;
|
||||||
|
|
||||||
use crate::export::pdf::{PdfContext, RefExt};
|
use crate::export::pdf::PdfContext;
|
||||||
|
|
||||||
/// A PDF external graphics state.
|
/// A PDF external graphics state.
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||||
|
@ -6,7 +6,7 @@ use pdf_writer::{Filter, Finish, Name, Rect, Str};
|
|||||||
use ttf_parser::{name_id, GlyphId, Tag};
|
use ttf_parser::{name_id, GlyphId, Tag};
|
||||||
use unicode_properties::{GeneralCategory, UnicodeGeneralCategory};
|
use unicode_properties::{GeneralCategory, UnicodeGeneralCategory};
|
||||||
|
|
||||||
use super::{deflate, EmExt, PdfContext, RefExt};
|
use super::{deflate, EmExt, PdfContext};
|
||||||
use crate::eval::Bytes;
|
use crate::eval::Bytes;
|
||||||
use crate::font::Font;
|
use crate::font::Font;
|
||||||
use crate::util::SliceExt;
|
use crate::util::SliceExt;
|
||||||
|
@ -5,7 +5,7 @@ use pdf_writer::{Finish, Ref};
|
|||||||
|
|
||||||
use super::color::{ColorSpaceExt, PaintEncode};
|
use super::color::{ColorSpaceExt, PaintEncode};
|
||||||
use super::page::{PageContext, Transforms};
|
use super::page::{PageContext, Transforms};
|
||||||
use super::{AbsExt, PdfContext, RefExt};
|
use super::{AbsExt, PdfContext};
|
||||||
use crate::geom::{
|
use crate::geom::{
|
||||||
Abs, Color, ColorSpace, Gradient, Numeric, Quadrant, Ratio, Relative, Transform,
|
Abs, Color, ColorSpace, Gradient, Numeric, Quadrant, Ratio, Relative, Transform,
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
|||||||
use image::{DynamicImage, GenericImageView, Rgba};
|
use image::{DynamicImage, GenericImageView, Rgba};
|
||||||
use pdf_writer::{Filter, Finish};
|
use pdf_writer::{Filter, Finish};
|
||||||
|
|
||||||
use super::{deflate, PdfContext, RefExt};
|
use super::{deflate, PdfContext};
|
||||||
use crate::{
|
use crate::{
|
||||||
geom::ColorSpace,
|
geom::ColorSpace,
|
||||||
image::{ImageKind, RasterFormat, RasterImage},
|
image::{ImageKind, RasterFormat, RasterImage},
|
||||||
|
@ -19,7 +19,7 @@ use std::num::NonZeroUsize;
|
|||||||
use ecow::{eco_format, EcoString};
|
use ecow::{eco_format, EcoString};
|
||||||
use pdf_writer::types::Direction;
|
use pdf_writer::types::Direction;
|
||||||
use pdf_writer::writers::PageLabel;
|
use pdf_writer::writers::PageLabel;
|
||||||
use pdf_writer::{Finish, Name, PdfWriter, Ref, TextStr};
|
use pdf_writer::{Finish, Name, Pdf, Ref, TextStr};
|
||||||
use xmp_writer::{LangId, RenditionClass, XmpWriter};
|
use xmp_writer::{LangId, RenditionClass, XmpWriter};
|
||||||
|
|
||||||
use self::gradient::PdfGradient;
|
use self::gradient::PdfGradient;
|
||||||
@ -52,7 +52,7 @@ pub fn pdf(document: &Document) -> Vec<u8> {
|
|||||||
pub struct PdfContext<'a> {
|
pub struct PdfContext<'a> {
|
||||||
document: &'a Document,
|
document: &'a Document,
|
||||||
introspector: Introspector,
|
introspector: Introspector,
|
||||||
writer: PdfWriter,
|
writer: Pdf,
|
||||||
colors: ColorSpaces,
|
colors: ColorSpaces,
|
||||||
pages: Vec<Page>,
|
pages: Vec<Page>,
|
||||||
page_heights: Vec<f32>,
|
page_heights: Vec<f32>,
|
||||||
@ -84,7 +84,7 @@ impl<'a> PdfContext<'a> {
|
|||||||
Self {
|
Self {
|
||||||
document,
|
document,
|
||||||
introspector: Introspector::new(&document.pages),
|
introspector: Introspector::new(&document.pages),
|
||||||
writer: PdfWriter::new(),
|
writer: Pdf::new(),
|
||||||
colors: ColorSpaces::default(),
|
colors: ColorSpaces::default(),
|
||||||
pages: vec![],
|
pages: vec![],
|
||||||
page_heights: vec![],
|
page_heights: vec![],
|
||||||
|
@ -2,7 +2,7 @@ use std::num::NonZeroUsize;
|
|||||||
|
|
||||||
use pdf_writer::{Finish, Ref, TextStr};
|
use pdf_writer::{Finish, Ref, TextStr};
|
||||||
|
|
||||||
use super::{AbsExt, PdfContext, RefExt};
|
use super::{AbsExt, PdfContext};
|
||||||
use crate::geom::{Abs, Smart};
|
use crate::geom::{Abs, Smart};
|
||||||
use crate::model::Content;
|
use crate::model::Content;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ use pdf_writer::{Content, Filter, Finish, Name, Rect, Ref, Str};
|
|||||||
|
|
||||||
use super::color::PaintEncode;
|
use super::color::PaintEncode;
|
||||||
use super::extg::ExternalGraphicsState;
|
use super::extg::ExternalGraphicsState;
|
||||||
use super::{deflate, AbsExt, EmExt, PdfContext, RefExt};
|
use super::{deflate, AbsExt, EmExt, PdfContext};
|
||||||
use crate::doc::{Destination, Frame, FrameItem, GroupItem, Meta, TextItem};
|
use crate::doc::{Destination, Frame, FrameItem, GroupItem, Meta, TextItem};
|
||||||
use crate::eval::Repr;
|
use crate::eval::Repr;
|
||||||
use crate::font::Font;
|
use crate::font::Font;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user