When trying to access workbook.CustomFontFilePaths or workbook.CustomFontFileDirectory after they have been set, I get a value error about a character not in unicode range. I got U+6d6f682f (which I always get with the supplied script at least on my system) and U+7070612f (reliable on our server). I tested with python 3.9 and 3.12 both on my machine (Ubuntu 22.04 LTS) and on the python:3.9 and python:3.12 docker images.
Script to reproduce:
- Code: Select all
#!/usr/bin/python3
from spire.xls import Workbook
# ADAPT THIS TO POINT TO ACTUAL FONTS/FOLDER!
PATH_TO_FONT = "/home/julien/spinergie/spindata/Utilities/excel_toolbox/excel_fonts/DancingScript.ttf"
PATH_TO_FONTS = "/home/julien/spinergie/spindata/Utilities/excel_toolbox/excel_fonts/"
workbook = Workbook()
print(f"{workbook.CustomFontFilePaths=}")
workbook.CustomFontFilePaths = [PATH_TO_FONT]
try:
print(workbook.CustomFontFilePaths)
except ValueError as e:
print(f"An error occurred: {e}")
print(f"{workbook.CustomFontFileDirectory=}")
workbook.CustomFontFileDirectory = [PATH_TO_FONTS]
try:
print(workbook.CustomFontFileDirectory)
except ValueError as e:
print(f"An error occurred: {e}")
Output:
- Code: Select all
workbook.CustomFontFilePaths=[]
An error occurred: character U+6d6f682f is not in range [U+0000; U+10ffff]
workbook.CustomFontFileDirectory=[]
An error occurred: character U+6d6f682f is not in range [U+0000; U+10ffff]
I expect to see the values of those properties. Note that despite the error, I’m still able to export an Excel file to PDF as long as I don’t try to access those properties.