Felix Schütt

Results 278 comments of Felix Schütt

ok, go ahead if you want

Use the [`add_line_break`](https://docs.rs/printpdf/0.3.2/printpdf/types/pdf_layer/struct.PdfLayerReference.html#method.add_line_break) function: ```rust let text_source_address = "610 Monroe St.\nStoudsburg, PA 18630-2115"; pdf_layer.begin_text_section(); pdf_layer.set_font(&font, 10); pdf_layer.set_text_cursor(Mm(30.0), Mm(230.0)); for line in text_source_address.lines() { pdf_layer.write_text(line, &font); pdf_layer.add_line_break(); //

I think I forgot that you need to call `set_line_height(10)` first so that the PDF knows how much to advance. If that doesn't work, you have to calculate the (x,...

That would be possible, but only with a config / feature flag. For my purpose (creating topographic maps) I need to keep the entire font in the PDF because I...

@anhtumai yeah at least for now it would be a good workaround because this issue comes up again and again

I'll see if I can do a simple `\n` replacer tomorrow, it is annoying to do manual line breaks. I was working on a scale-bar generator and noticed that centering...

@TKGgunter yeah, I haven't worked on this ... mostly because I don't use builtin fonts. It isn't possible to calculate the width and height from builtin fonts, because you'd need...

No, how would that be possible? Built-in fonts can even vary from PDF viewer to PDF viewer. You'd need the `Helvetica.ttf` files to do that, but I can't include them...

It's supposed to prevent you from passing in a `File` handle because then Rust would write the PDF character-by-character, requiring a syscall for every single character. I once benchmarked this...