diff --git a/Cargo.lock b/Cargo.lock index d28bb206c..b24ffec12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1569,7 +1569,7 @@ checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" [[package]] name = "xmp-writer" version = "0.1.0" -source = "git+https://github.com/typst/xmp-writer#a4a36967cd73c9c19548e940bbcc55583a901417" +source = "git+https://github.com/typst/xmp-writer#0bce4e38395877dad229ea4518d4f78038738155" [[package]] name = "yaml-front-matter" diff --git a/docs/src/general/changelog.md b/docs/src/general/changelog.md index 622fa5833..723f4add2 100644 --- a/docs/src/general/changelog.md +++ b/docs/src/general/changelog.md @@ -5,6 +5,22 @@ description: | --- # Changelog +## February 15, 2023 +- [Box]($func/box) and [block]($func/block) have gained `fill`, `stroke`, + `radius`, and `inset` properties +- Blocks may now be explicitly sized, fixed-height blocks can still break + across pages +- Blocks can now be configured to be [`breakable`]($func/block.breakable) or not +- [Numbering style]($func/enum.numbering) can now be configured for nested enums +- [Markers]($func/list.marker) can now be configured for nested lists +- The [`eval`]($func/eval) function now expects code instead of markup and + returns an arbitrary value. Markup can still be evaluated by surrounding the + string with brackets. +- PDFs generated by Typst now contain XMP metadata +- Link boxes are now disabled in PDF output +- Tables don't produce small empty cells before a pagebreak anymore +- Fixed raw block highlighting bug + ## February 12, 2023 - Shapes, images, and transformations (move/rotate/scale/repeat) are now block-level. To integrate them into a paragraph, use a [`box`]($func/box) as diff --git a/src/export/pdf/mod.rs b/src/export/pdf/mod.rs index 38433211c..69fa805b4 100644 --- a/src/export/pdf/mod.rs +++ b/src/export/pdf/mod.rs @@ -116,10 +116,8 @@ fn write_catalog(ctx: &mut PdfContext) { }; // Write the document information. - let meta_ref = ctx.alloc.bump(); - let mut xmp = XmpWriter::new(); - let mut info = ctx.writer.document_info(ctx.alloc.bump()); + let mut xmp = XmpWriter::new(); if let Some(title) = &ctx.document.title { info.title(TextStr(title)); xmp.title([(None, title.as_str())]); @@ -129,6 +127,7 @@ fn write_catalog(ctx: &mut PdfContext) { xmp.creator([(author.as_str())]); } info.creator(TextStr("Typst")); + info.finish(); xmp.creator_tool("Typst"); xmp.num_pages(ctx.document.pages.len() as u32); xmp.format("application/pdf"); @@ -136,10 +135,9 @@ fn write_catalog(ctx: &mut PdfContext) { xmp.rendition_class(RenditionClass::Proof); xmp.pdf_version("1.7"); - info.finish(); - let xmp_buf = xmp.finish(None); - let mut meta_stream = ctx.writer.stream(meta_ref, &xmp_buf); + let meta_ref = ctx.alloc.bump(); + let mut meta_stream = ctx.writer.stream(meta_ref, xmp_buf.as_bytes()); meta_stream.pair(Name(b"Type"), Name(b"Metadata")); meta_stream.pair(Name(b"Subtype"), Name(b"XML")); meta_stream.finish();