Skip to content

Commit 021b9b1

Browse files
committed
Add test for DPI
1 parent a75850c commit 021b9b1

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99
- Added support for text embedding.
10-
- Added a `text` feature flag.
10+
- Made the CLI more flexible in terms of which features you want to include.
11+
- Added `raster-scale` and `text-to-paths` as arguments for the CLI.
12+
- Removed the option to configure the view box from the API. This might be readded in
13+
a later update.
1114
- The `convert_str` method has been removed. You should now always convert your SVG string into a `usvg`
1215
tree yourself and then call either `to_pdf` or `to_chunk`.
1316
- The `convert_tree` method has been renamed into `to_pdf`, and now requires you to provide the fontdb
1417
used for the `usvg` tree, unless you have disabled the `text` feature.
1518
- `convert_tree_into` has been renamed into `to_chunk` and now returns an independent chunk as well
1619
as the object ID of the actual SVG in the chunk.
1720

18-
- TODO: The CLI options have been (temporarily) removed. They will be readded before the next release.
19-
- TODO: Add tests for CLI and svg options
20-
- TODO: Add CLI option to convert text to paths.
21-
2221
### Changed
2322
- Bumped resvg to v0.40.
2423
- `convert_str` now requires a `fontdb` as an argument as well.

tests/ref/api/dpi.png

972 Bytes
Loading

tests/src/api.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ fn text_to_paths() {
2020
assert_eq!(res, 0);
2121
}
2222

23+
#[test]
24+
fn dpi() {
25+
let conversion_options = ConversionOptions::default();
26+
let page_options = PageOptions {
27+
dpi: 140.0
28+
};
29+
30+
let svg_path = "svg/resvg/text/text/simple-case.svg";
31+
let (pdf, actual_image) =
32+
convert_svg(Path::new(svg_path), conversion_options, page_options);
33+
let res = run_test_impl(pdf, actual_image, "api/dpi");
34+
assert_eq!(res, 0);
35+
}
36+
2337
#[test]
2438
fn to_chunk() {
2539
let mut alloc = Ref::new(1);

0 commit comments

Comments
 (0)