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

Cannot handle multple fonts in same cell correctly #232

Closed
piaoger opened this issue Oct 5, 2024 · 4 comments
Closed

Cannot handle multple fonts in same cell correctly #232

piaoger opened this issue Oct 5, 2024 · 4 comments

Comments

@piaoger
Copy link
Contributor

piaoger commented Oct 5, 2024

  • How to reproduce
  1. create a file with two cells which are filled by mixing different Bold, Italic, Font and font size. See attached aaa_multifonts.xlsx.
  2. run a simple read write roundtrip
  3. Open the output file, you will find fonts are not handled well for entire string.
    See below snapshot in WPS office, the 2nd and 3th chars are default Simsun。In MS Office, they are Calibri.
    1728116907586
    image
  • code snippt
        let f = "/w/assets/xlsx/aaa_multifonts.xlsx";
        let path = std::path::Path::new(&f);
        let mut book = umya_spreadsheet::reader::xlsx::lazy_read(&path).unwrap();
        let _ = umya_spreadsheet::writer::xlsx::write(&book, &format!("{f}.rw.output.xlsx"));

aaa_multifonts.xlsx

aaa_multifonts.xlsx.rw.output.xlsx

@MathNya
Copy link
Owner

MathNya commented Oct 7, 2024

@piaoger
Thank you very much for your help here.
I think it is probably a glitch.
We will investigate the cause and take action.

@MathNya
Copy link
Owner

MathNya commented Oct 16, 2024

@piaoger
Sorry, could you please provide us with aaa_multifonts.xlsx so that we can understand the situation as accurately as possible.
(I think the two files you attached are probably both post-processed files.)

@piaoger
Copy link
Contributor Author

piaoger commented Oct 17, 2024

@MathNya I just updated the origin post and attached the right xlsx file.

MathNya pushed a commit that referenced this issue Oct 18, 2024
@piaoger
Copy link
Contributor Author

piaoger commented Oct 18, 2024

I just checked the result with latest change. It works great !!

Blow is the snapshot of WPS Office:
1729231667444

@piaoger piaoger closed this as completed Oct 18, 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