mirror of
https://github.com/typst/typst
synced 2025-06-28 00:03:17 +08:00
Fix color space definitions
This commit is contained in:
parent
26a427a321
commit
757615dc42
@ -37,8 +37,8 @@ pub fn pdf(ctx: &Context, frames: &[Arc<Frame>]) -> Vec<u8> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Identifies the color space definitions.
|
/// Identifies the color space definitions.
|
||||||
const SRGB: Name<'static> = Name(b"sRGB");
|
const SRGB: Name<'static> = Name(b"srgb");
|
||||||
const SRGB_GRAY: Name<'static> = Name(b"sRGBGray");
|
const SRGB_GRAY: Name<'static> = Name(b"srgbgray");
|
||||||
|
|
||||||
/// An exporter for a whole PDF document.
|
/// An exporter for a whole PDF document.
|
||||||
struct PdfExporter<'a> {
|
struct PdfExporter<'a> {
|
||||||
@ -365,12 +365,10 @@ impl<'a> PdfExporter<'a> {
|
|||||||
pages.count(page_refs.len() as i32).kids(page_refs);
|
pages.count(page_refs.len() as i32).kids(page_refs);
|
||||||
|
|
||||||
let mut resources = pages.resources();
|
let mut resources = pages.resources();
|
||||||
resources.color_spaces().insert(SRGB).start::<ColorSpace>().srgb();
|
let mut spaces = resources.color_spaces();
|
||||||
resources
|
spaces.insert(SRGB).start::<ColorSpace>().srgb();
|
||||||
.color_spaces()
|
spaces.insert(SRGB_GRAY).start::<ColorSpace>().srgb_gray();
|
||||||
.insert(SRGB_GRAY)
|
spaces.finish();
|
||||||
.start::<ColorSpace>()
|
|
||||||
.srgb_gray();
|
|
||||||
|
|
||||||
let mut fonts = resources.fonts();
|
let mut fonts = resources.fonts();
|
||||||
for (font_ref, f) in self.face_map.pdf_indices(&self.face_refs) {
|
for (font_ref, f) in self.face_map.pdf_indices(&self.face_refs) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user