PDFDocument error

I am working in a command line tool that generates a PDF file using Xojo 2021. It works fine in MacOS but when I run it in Ubuntu 16.04.6 LTS it fails with the following error:

Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig error: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 72: non-double matrix element
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 80: saw unknown, expected number
Runtime Error
Please report what caused this error along with the information below.
Common/ObjectGlue.cpp: 147
Failure Condition: mClassPtr
Xojo.Core.PlatformNotSupportedException
Abortado (`core' generado)

Does anybody know what can be the problem?

I tried rebuilding for 64bit, and the error changes to:

Fontconfig error: Cannot load default config file
Runtime Error
Please report what caused this error along with the information below.
Common/ObjectGlue.cpp: 147
Failure Condition: mClassPtr
Xojo.Core.PlatformNotSupportedException
Abortado (`core' generado)

Hi @Mar_Tin

It seems something related with fonts configuración/availability on your Linux distro.

I forgot to say it is a server with no graphics interface, can it be the problem?

Sure it is. Make sure your server has (as a minimum) the by default PDF standard font files. For example:

LiberationSans
LiberationSansBold
LiberationSansItalic
LiberationSeriff
LiberationSeriffBold
LiberationSeriffItalic
LiberationMono
LiberationMonoBold
LiberationMonoItalic

sudo apt install -y ttf-liberation

I tried but it seems to be already installed:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
ttf-liberation is already the newest version (1.07.4-1).
0 upgraded, 0 newly installed, 0 to remove and 209 not upgraded.

Any reason for not

sudo apt update -y
sudo apt upgrade -y

?

I made it work, thanks a lot!

There were actually 2 problems instead of one: first there was a bug in my code and second a problem in the Ubuntu installation. As I am not allowed to update nor upgrade that server, so I just removed all g.FontName = “…” from my code, now the PDF works fine using the default font, the document is not as “pretty” but this workaround solved the issue.

It is not my server and other applications are working on it. The client does not allow me to do that.

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.