Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AutoSizeColumn throws exception on Windows with .NET Framework 4.8.1 #1485

Open
1 task done
sky-catoniv opened this issue Feb 3, 2025 · 1 comment
Open
1 task done
Labels

Comments

@sky-catoniv
Copy link

NPOI Version

2.7.2

File Type

  • XLSX

Upload the Excel File

N/A

Reproduce Steps

Call void AutoSizeColumn(int column, bool useMergedCells)

Issue Description

I get an exception: SixLabors.Fonts.FontException: No fonts found installed on the machine.

I know it is a duplicate of #981, #1258 and #1259 but my case is on Windows OS and I don't find a solution for it.

I'm using: NPOI 2.7.2, SixLabors.Fonts 1.0.1

According to suggestion in the above issues, I run fc-list and I have many fonts installed but seems that SixLabors.Fonts doesn't find them. Maybe the cause is that (as stated by @ai3i3as it isn't compatible with .net 4.8.1)?
Is there a way to fix it? how can I "install" a font to be read by SixLabors.Font?
Or is there a workaround to auto size a column?

Thanks,
Vjncenzo

@sky-catoniv sky-catoniv added the bug label Feb 3, 2025
@Foenix-001
Copy link

My project DLL is built on .NET Framework 4.8.
I am using NPOI 2.7.0~2.7.2 (referencing the corresponding packages based on each version's declared dependencies).
The currently tested feasible results are shown in the table below, mainly due to issues caused by Microsoft packages.

After calling NPOI.XSSF.UserModel.XSSFSheet.AutoSizeColumn(Int32 column), the following error occurs:
Type: FontException
Message: No fonts found installed on the machine.

NPOI 2.7.0~2.7.2

Package Name Usable Version Range Error Version
System.Buffers 4.5.1 4.6.0
System.Memory 4.5.4 ~ 4.5.5 4.6.0
System.Text.Encoding.CodePages 5.0.0 ~ 9.0.1 9.0.2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants