Non-Windows Environment
Working with .NET Core DLLs in Non-Windows Environment
As Sheetize for .NET supports .NET Standard 2.0 (.NET Core 2.0), it can be used in Core Applications running on Linux-based operating systems. While the API is continually optimized for .NET Core environments, there are a few steps you should take to ensure better results when using Sheetize features in non-Windows environments.
Required Packages
libgdiplus
Install the libgdiplus package to enable compatibility with graphical features on Linux.Microsoft-Compatible Fonts
Install fonts using thettf-mscorefonts-installer
package:- Run:
sudo apt-get install ttf-mscorefonts-installer
- Ensure the fonts are located in the
/usr/share/fonts/truetype/msttcorefonts
directory, as Sheetize scans this location by default.
- Run:
Custom Font Folder
If your Linux operating system uses a different default font folder or you cannot place fonts in the system directory (e.g., on cloud servers), you can specify a custom font folder in your application code:
- Create a folder named
fonts
in your program directory. - Copy the required font files into this folder.
- Set the custom font path in your program:
Sheetize.FontConfigs.SetFontFolder("fonts", true);
This ensures that Sheetize can locate and use the fonts from your project directory, even in restricted environments.
Using Fonts in Docker
If running your application in a Docker environment, you can copy the fonts to the system path during the build process:
- Place the font files in a
fonts
folder in your project directory. - Add this to your Dockerfile:
COPY fonts/ /usr/share/fonts
This ensures the required fonts are available in the Docker container for Sheetize to use.
Why Font Management Matters
Proper font management ensures accurate rendering of spreadsheets in environments where default fonts are limited. Without the correct fonts:
- Layouts and formatting may differ from the original file.
- Characters might not render as expected, affecting the quality of your output.
Configuring fonts as described will help produce consistent and satisfactory results when processing spreadsheets with Sheetize on non-Windows systems.