-
Couldn't load subscription status.
- Fork 2
Add result printer #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
49b8589 to
c9d7bb7
Compare
src/printer.rs
Outdated
| use genpdf::Element as _; | ||
| use genpdf::{elements, fonts, style}; | ||
|
|
||
| const FONT_DIRS: &[&str] = &["/usr/share/fonts/truetype/ubuntu"]; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
src/components/app.rs
Outdated
|
|
||
| rsx! { | ||
| if printed() { | ||
| div { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/components/app.rs
Outdated
| class: "btn btn-primary", | ||
| onclick: move |_| { | ||
| info!("Printing results for race {}", race.id); | ||
| print_result(&race.clone()); |
There was a problem hiding this comment.
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"]; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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 (?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
c9d7bb7 to
09b81cc
Compare
09b81cc to
1375d37
Compare
No description provided.