These are chat archives for rust-lang/rust

7th
Oct 2018
Mallory M.
@malzzz
Oct 07 2018 16:56
Hi all, I usually don't work on this type of thing, so I'm totally lost on where to start. I need to generate a png (or image w/transparent background). The image will just be a list of names in a specific font. Is there a repo or some other resource that someone could point me to in order to begin figuring this out?
Michal 'vorner' Vaner
@vorner
Oct 07 2018 16:58
@malzzz I have no experience with it, but the first place I'd go looking is probably this: https://crates.io/crates/magick_rust
Or generate some kind of metapost or postfix and find something to render it.
red75prime
@red75prime
Oct 07 2018 17:03
@malzzz rusttype crate can render fonts, png crate can encode bitmaps. If you are willing to write bunch of glue code.
Mallory M.
@malzzz
Oct 07 2018 17:12
@vorner @red75prime Okay, great. I'll look into those. Thanks!
Ash
@ashthespy
Oct 07 2018 18:59
greetings - is there something from the std lib similar to lrint
red75prime
@red75prime
Oct 07 2018 19:09
No, it seems too x87 specific. There's https://docs.rs/linux-api-math/0.0.1/linux_api_math/ though
Stateful model of floating point computations hasn't aged well
Ash
@ashthespy
Oct 07 2018 19:15
Okay I quickly glanced at https://gist.github.com/lifthrasiir/e021349c1d0cd55933a5 and decided to just quickly implement it for my needs..
Rotem Yaari
@vmalloc
Oct 07 2018 19:49
Clippy claims that in fn format_error<'a>(e: &'a Error) -> Cow<'a, str> {..., explicit lifetimes can be elided... Does anybody know how? To the best of my knowledge Cow requires a lifetime parameter...
Denis Lisov
@tanriol
Oct 07 2018 21:50
'_