fschutt / printpdf

A fully-featured PDF library for Rust, WASM-ready
https://fschutt.github.io/printpdf/
MIT License
829 stars 98 forks source link

`set_text_matrix(TextMatrix::Rotate(45.0))` rotate text only in its corner #152

Open qarmin opened 1 year ago

qarmin commented 1 year ago
    current_layer.begin_text_section();

    current_layer.set_font(&font, FONT_SIZE_COMMENTS);
    current_layer.add_line_break();
    current_layer.set_text_cursor(Mm(10.0), Mm(10.0));
    current_layer.set_line_height(10.0);
    current_layer.write_text("AAAAAAA", &font);
    current_layer.set_text_matrix(TextMatrix::Rotate(45.0));
    current_layer.write_text("All rights reserved.", &font);

    current_layer.end_text_section();

With such code, All rights reserved, should start with same position like "AAAA", but starts in corner instead.

Screenshot from 2023-09-28 15-04-07