Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

456
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda