Forum

Author Topic: QFontDatabase: Cannot find font directory /home/ec2-user/photoscan-pro/lib/fonts  (Read 7963 times)

Goran

  • Newbie
  • *
  • Posts: 10
    • View Profile
hey,
Apparently this Qt library is needed to render the pdf document with fonts.
Quote
QFontDatabase: Cannot find font directory /home/ec2-user/photoscan-pro/lib/fonts - is Qt installed correctly?
How to solve this?
I am running Amazon Linux AMI & Agisoft PhotoScan Professional version 1.3.1 build 4030 (64 bit)
Do I have to build that whole Qt Toolkit ?

regards
goran
« Last Edit: April 20, 2017, 07:01:05 PM by Goran »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Hello Goran,

You may need to set up the following environment variable:

Code: [Select]
export QT_QPA_FONTDIR=<path to font files>
The fonts should be directly in that folder, not in the sub-folders.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Goran

  • Newbie
  • *
  • Posts: 10
    • View Profile
i cant see any lib folder in the photoscan directory,
tried linking agains the base photoscan directory as it contains some qt files but it didnt work

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Hello Goran,

You can link it to any fonts folder on the computer.  PhotoScan is not packaged with any fonts by default.
Best regards,
Alexey Pasumansky,
Agisoft LLC

jomey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Alexey,

could you please give an example on what you mean with 'no subdirectories;?

I set the variable to the
Code: [Select]
/usr/share/fonts before starting Agisoft and still have no luck getting the fonts to work.

Also, are there any recommended fonts to use?

Thank you.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14847
    • View Profile
Hello jomey,

Are all font files in the /usr/share/fonts/ folder? "no subdirectories" means that there shouldn't be additional bottom directory level inside /fonts/.
Best regards,
Alexey Pasumansky,
Agisoft LLC

jomey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Alexey,

Yes, here an excerpt:
Code: [Select]
ls -a /usr/share/fonts/
.                  google-crosextra-caladea  lohit-devanagari  msttcorefonts        smc
..                 google-crosextra-carlito  lohit-gujarati    nhn-nanum            stix
abattis-cantarell  google-noto               lohit-kannada     open-sans            thai-scalab

Joe

BenP

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hi,

I'm having the same issue where my report is exported with only black squares instead of text. I'm working on a CentOS 7.4 Linux machine with fonts in a number of sub-directories under
Code: [Select]
/usr/share/fonts/ (e.g.,
Code: [Select]
/usr/share/fonts/open-sans
I've tried setting the QT_QPA_FONTDIR variable to point to one of these sub-directories but I get the same results everytime. Is there a specific font package that Agisoft requires (like Times, Courier, Helvetica)?

After setting the variable to the font directory I no longer get the error:

Quote
QFontDatabase: Cannot find font directory - is Qt installed correctly?

So I guess the problem is with the font packages?

Thanks,
Ben

EDIT: It works now for some reason. I just need to point QT_QPA_FONTDIR to any of the available font folders (e.g., export QT_QPA_FONTDIR=/usr/share/fonts/open-sans) before running my python scripts.
« Last Edit: June 29, 2018, 01:37:23 PM by BenP »

jomey

  • Newbie
  • *
  • Posts: 7
    • View Profile
Thank you Ben for sharing.

That did it for me too!