Skip to content

Commit

Permalink
next try
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Aug 21, 2024
1 parent 4759659 commit 25c06b1
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ target
.idea
out
data
./tests/diff/*
tests/diff/*
Binary file modified tests/refs/text_rendering/ghostscript.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/refs/text_rendering/mupdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/refs/text_rendering/pdfbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/refs/text_rendering/pdfium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/refs/text_rendering/pdfjs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/refs/text_rendering/poppler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/refs/text_rendering/quartz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions tests/visreg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cosmic_text::{Attrs, Buffer, FontSystem, Metrics, Shaping};
use fontdb::Source;
use fontdb::{Database, Source};
use image::{load_from_memory, Rgba, RgbaImage};
use krilla::document::Document;
use krilla::rgb::Rgb;
Expand Down Expand Up @@ -229,9 +229,12 @@ generate_renderer_tests!(linear_gradient, |renderer| {
});

generate_renderer_tests!(cosmic_text, |renderer| {
let mut font_system = FontSystem::new_with_fonts([Source::Binary(Arc::new(include_bytes!(
let mut db = Database::new();
db.load_font_source(Source::Binary(Arc::new(include_bytes!(
"fonts/NotoSans-Regular.ttf"
)))]);
))));
let mut font_system = FontSystem::new_with_locale_and_db("".to_string(), db);
assert_eq!(font_system.db().len(), 1);
let metrics = Metrics::new(14.0, 20.0);
let mut buffer = Buffer::new(&mut font_system, metrics);
buffer.set_size(&mut font_system, Some(200.0), None);
Expand Down

0 comments on commit 25c06b1

Please sign in to comment.