Skip to content

Version "0.9.0" and external fonts and default-features = false show no Text in PDF Reader #258

@watchtmouse

Description

@watchtmouse

Hello Felix thank for a great tool,

This is the first issue I post on Github

I came from Version 0.7 of printpdf and switched to version 0.9.0 yesterday.
When I user internal fonts my generated PDFs Show text when opening them in a PDF Reader when I use External fonts no Text is shown.

Can you please verify that PDFs generated with printpdf 0.9.0 have there External fonts Embedded?

To verify I used the program https://github.com/fschutt/printpdf/blob/master/examples/otf-font.rs , I now think there is nothing wrong with my program, since this shows the same behaviour (no Text shown in the PDF reader).

At the moment 17.02.2024 14:45 CET I Cannot compile without "default-features = false" because I get the following Error

   Compiling azul-css v0.0.6
   Compiling thiserror v2.0.18
   Compiling derive_more v0.99.20
error[E0308]: mismatched types
   --> /home/bert/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/azul-css-0.0.6/src/corety.rs:232:47
    |
232 |         let c_str = core::ffi::CStr::from_ptr(ptr);
    |                     ------------------------- ^^^ expected `*const u8`, found `*const i8`
    |                     |
    |                     arguments to this function are incorrect
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`
note: associated function defined here
   --> /home/bert/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ffi/c_str.rs:253:25
    |
253 |     pub const unsafe fn from_ptr<'a>(ptr: *const c_char) -> &'a CStr {
    |                         ^^^^^^^^

This is my Cargo.toml

[package]

name = "fonts"
version = "0.1.0"
edition = "2024"

[dependencies]
#printpdf = { git = "https://github.com/fschutt/printpdf", rev = "ebe45a6" }
#printpdf = { version = "0.9.0"}
printpdf = { version = "0.9.0", default-features = false }

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions