Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

461
Vistas
Unable To open True Type (TTF) font file in Python 3

I'm running Laravel project on Nginx server, in which I call a python file using below command by passing arguments

$result = exec("python3 path/to/file.py $data");

In the python file, there is a line of code

    font_file = base_path+'/fonts/LiberationMono-Bold.ttf'
    cmd = ["ttf2cxf_stream",
                   "",
                   "-s","5.0",
                   font_file,"STDOUT"]
    p = Popen(cmd, stdout=PIPE, stderr=PIPE)

This is giving an error that it can't open the font file which is present on that location. The owner of the project is ubuntu:www-data and the font file is present in that project. I also tried giving it 777 permission but still no luck.

Now when I run the same command in terminal

python3 path/to/file.py "data"

It successfully runs without the font file access error. What could be the issue?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I had faced similar issue while using "ttf2cxf_stream" library to open font - ttf files. Please check if ttf2cxf_stream exist in /usr/bin directory if not then try copying it from /usr/local/bin/ directory and see if you can run py file through PHP code.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda