Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

455
Views
No se puede abrir el archivo de fuente True Type (TTF) en Python 3

Estoy ejecutando el proyecto Laravel en el servidor Nginx, en el que llamo a un archivo python usando el siguiente comando pasando argumentos

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

En el archivo python, hay una línea de código

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

Esto da un error de que no puede abrir el archivo de fuente que está presente en esa ubicación. El propietario del proyecto es ubuntu:www-data y el archivo de fuente está presente en ese proyecto. También intenté darle permiso 777 pero aún no tuve suerte.

Ahora, cuando ejecuto el mismo comando en la terminal

 python3 path/to/file.py "data"

Se ejecuta con éxito sin el error de acceso al archivo de fuente. ¿Cual podría ser el problema?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Me había enfrentado a un problema similar al usar la biblioteca "ttf2cxf_stream" para abrir fuentes - archivos ttf. Verifique si ttf2cxf_stream existe en el directorio /usr/bin ; de lo contrario, intente copiarlo desde el directorio /usr/local/bin/ y vea si puede ejecutar el archivo py a través del código PHP.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!