Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Jan 18, 2024 11:36 am

Hi,

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.

spirexls_spinergie
 
Posts: 5
Joined: Wed Nov 22, 2023 1:33 pm

Fri Jan 19, 2024 3:42 am

Hello,

Thank you for your inquiry.
I tested your code and did reproduce the issue you mentioned. I have logged the issue into our bug tracking system with the ticket number SPIREXLS-5092. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Apr 30, 2024 9:51 am

Hello,

Thank you for your patience.
We are pleased to inform you that we have just released Spire.XLS for Python Version:14.4.4, which fixes the issue of SPIREXLS-5092. Welcome to test it.


Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS