Skip to content

Conversation

@holoujak
Copy link
Owner

No description provided.

@holoujak holoujak force-pushed the print-results branch 6 times, most recently from 49b8589 to c9d7bb7 Compare October 14, 2025 12:47
@holoujak holoujak requested a review from trnila October 14, 2025 18:26
@holoujak holoujak marked this pull request as ready for review October 14, 2025 18:26
src/printer.rs Outdated
use genpdf::Element as _;
use genpdf::{elements, fonts, style};

const FONT_DIRS: &[&str] = &["/usr/share/fonts/truetype/ubuntu"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add these fonts to our app? Its crashing now for me as fonts are not found.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added


rsx! {
if printed() {
div {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about running xdg-open generated.pdf instead?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

class: "btn btn-primary",
onclick: move |_| {
info!("Printing results for race {}", race.id);
print_result(&race.clone());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need cloning here?

src/printer.rs Outdated
use genpdf::Element as _;
use genpdf::{elements, fonts, style};

const FONT_DIRS: &[&str] = &["/usr/share/fonts/truetype/ubuntu"];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it need to be an list then?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

src/printer.rs Outdated
print_categories(&mut doc, race);

doc.render_to_file(output_file)
.expect("Failed to write output file");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would rather log/return error? ... crashing is not nice (?)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@holoujak holoujak merged commit 11d3b62 into master Oct 15, 2025
2 checks passed
@holoujak holoujak deleted the print-results branch October 15, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants