Skip to content
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

write_text function cannot use different font than used use_text #150

Open
qarmin opened this issue Sep 25, 2023 · 0 comments
Open

write_text function cannot use different font than used use_text #150

qarmin opened this issue Sep 25, 2023 · 0 comments
Milestone

Comments

@qarmin
Copy link

qarmin commented Sep 25, 2023

        layer.use_text(
            format!("{} ", header),
            FONT_SIZE,
            Mm(position.x),
            Mm(PAGE_HEIGHT - position.y - idx as f32 * 5.0),
            &fonts[&Fonts::RobotoRegular],
        );
        layer.write_text(*data, &fonts[&Fonts::RobotoBold]);

        layer.use_text(
            format!("{} ", header),
            FONT_SIZE,
            Mm(position.x),
            Mm(PAGE_HEIGHT - position.y - idx as f32 * 5.0 - 20.0),
            &fonts[&Fonts::RobotoBold],
        );
        layer.write_text(*data, &fonts[&Fonts::RobotoRegular]);

First part should be writeten with one font and second(after :) with another, but this not works

Screenshot from 2023-09-25 12-26-52

In fpdf2 with similar construction I got such output

Screenshot from 2023-09-25 12-34-18

@fschutt fschutt added this to the 0.8 milestone Nov 2, 2024
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

No branches or pull requests

2 participants