Skip to content

Commit

Permalink
?
Browse files Browse the repository at this point in the history
  • Loading branch information
Myriad-Dreamin committed Sep 29, 2024
1 parent 59b75cf commit fe359f7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
14 changes: 14 additions & 0 deletions crates/conversion/vec2svg/src/frontend/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ impl<Feat: ExportFeature> SvgExporter<Feat> {
let pages = typst2vec.doc(&output.introspector, output);

let module = typst2vec.finalize();

let mut module = module;
module.glyphs.sort_by(|(a, _), (b, _)| {
a.font_hash
.cmp(&b.font_hash)
.then(a.glyph_idx.cmp(&b.glyph_idx))
});

// println!("module: {:#?}", module);
// let t = format!("{:#?}", module);
// let t_hash = format!("{:#?}", reflexo::hash::hash128(&module));
// std::fs::write("module.txt", t).unwrap();
// std::fs::write("module.hash", t_hash).unwrap();

VecDocument { pages, module }
}

Expand Down
2 changes: 2 additions & 0 deletions packages/renderer/src/render/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ mod tests {
time_used: String,
data_content_hash: String,
text_content_hash: String,
artifact_hash: String,
}

#[derive(Serialize, Deserialize)]
Expand Down Expand Up @@ -345,6 +346,7 @@ mod tests {
time_used: format!("{:.3}", end - start),
data_content_hash: data_content_hash.clone(),
text_content_hash: hash_bytes(&text_content),
artifact_hash: hash_bytes(&artifact),
},
verbose: {
let mut verbose_data = HashMap::new();
Expand Down
8 changes: 8 additions & 0 deletions server/dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ fn compile_corpus(args: CompileCorpusArgs) {
}
info!("compile corpus: {cat:10} {}", corpus_name.to_string_lossy());

// if !corpus_name
// .to_string_lossy()
// .to_string()
// .contains("clip_00")
// {
// continue;
// }

compile(cat.clone(), corpus_name.to_string_lossy().to_string());
}
}
Expand Down
6 changes: 3 additions & 3 deletions tests/integration/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ mod tests {
"###);
check_canvas_render_test_point!(@r###"
name: layout_clip_01_artifact_ir
data_content_phash: "phash-gradient:FBIAAAAANFsAFBMAlBMABBAAvDYAJFcAQBsAjAEAiBMAmAMAAAAAQBEAAAAAqBgAFFMAFDMAJBEAnBYApBYApF4AAAAAABQA"
data_content_phash: "phash-gradient:FBIAAAAANFsAFBMAlBMABBAAvDYAJFcAUBsALAEAiBMAmAMAAAAAQBEAAAAAqBgAFFMAFDMAJBEAnBYApBYApF4AAAAAABQA"
text_content_hash: "sha256:93cc86f5b4466bef3b400ed07a9fd183972793729ccd319a361869163f77c37c"
"###);
check_canvas_render_test_point!(@r###"
Expand Down Expand Up @@ -538,7 +538,7 @@ mod tests {
"###);
check_canvas_render_test_point!(@r###"
name: layout_list-marker_03_artifact_ir
data_content_phash: "phash-gradient:AAAAAAAAAAAAAAEAAAAAEJkBEpkCUqkFxLIFYrIFUKwBAAwAUIAAIFEAIBEAoNIA1GQAkmwAkEgAAAAAgCgAAAAAAAAAAAAA"
data_content_phash: "phash-gradient:AAAAAAAAAAAAAAEAAAAAEJkBEpkCUqkF1LIFYrIFUKwBAAwAUIAAIFEAIBEAoNIA1GQAkmwAkEgAAAAAgCgAAAAAAAAAAAAA"
text_content_hash: "sha256:87e6e1cd2b4ad9e48ac686ebc22c9362f7770ff274d49702c13b15d072e9fbbb"
"###);
// ok empty page, compile error
Expand All @@ -549,7 +549,7 @@ mod tests {
"###);
check_canvas_render_test_point!(@r###"
name: layout_transform_00_artifact_ir
data_content_phash: "phash-gradient:AAAAAAAAAAAASEgAAJIAyGgBzWgBYWsAuGsBgNkCVPMACLIAAEAAkDIAwLIAlHoAkHQAmDUAFD0AAE0AIC0AAAAAAAAAAAAA"
data_content_phash: "phash-gradient:AAAAAAAAAAAASGgAAIIAyGgBzWgBYWsAuGsBgNkCVPMACLIAAEAAkDIAwLIAlHoAkHQAmDUAFD0AAE0AIC0AAAAAAAAAAAAA"
text_content_hash: "sha256:f1b9f63c42525a7552deae670ee0fb0aedc4781c1208cf04988c6009d7a11007"
"###);
check_canvas_render_test_point!(@r###"
Expand Down

0 comments on commit fe359f7

Please sign in to comment.