Closed Didier0 closed 2 years ago
You need to give the full (relative) path to the font file (.ttf
) as you have also shown in the last screenshot --- but the paths are not given in the second screenshot. Also you probably need to use the same filename (fontlist.txt
and not fontlist1.txt
) unless you have made the corresponding change in the code.
Yes, in the second screenshot I didn't put .ttf
fonts into folders, they were out (in the same folder where are fontlist.txt) like halida-sans.normal.ttf
in 2nd screenshot, but then I try to put them in folders like you did, that you can see in the 3rd screenshot and also don't work.
In code I made a change from fontlist.txt to fontlist1.txt, just load other .txt file.
You can see in the picture:
And also says this:
Traceback (most recent call last):
File "/home/isus/Dokumenti/WET/SynthText-python3/synthgen.py", line 669, in render_text
regions['homography_inv'][ireg])
File "/home/isus/Dokumenti/WET/SynthText-python3/synthgen.py", line 506, in place_text
render_res = self.text_renderer.render_sample(font,collision_mask)
File "/home/isus/Dokumenti/WET/SynthText-python3/text_utils.py", line 415, in render_sample
f_h = self.font_state.get_font_size(font, f_h_px)
File "/home/isus/Dokumenti/WET/SynthText-python3/text_utils.py", line 535, in get_font_size
m = self.font_model[font.name]
KeyError: 'Fabiolo'
Mabye the script can't read any font?
Do I need to install the fonts on Ubuntu?
Also I don't think you need to install these fonts -- but can try.
The Failed to load font: unknown file format
error seems to be originating in Pygame's freestyle font engine. I do not have any good pointers on how to resolve that unfortunately.
Ok, thank you, I'll try.
I just used fonts that exists here font_px2pt.cp
and it works. TY
Hi all and @ankush-me ,
can someone help me, I don't understand how to add my own font into script? I found in code fontlist.txt text source - a file that is used as text source. So there I put my .ttf fonts that I downloaded from here:
https://www.1001fonts.com/text-fonts.html?page=1&fbclid=IwAR395plHPNmZemLoKmvpedbqRv0z8pUVU66np7LLWzia14GrAKWcZB1H5o4
and then terminal shows me and error :'Fabiolo' is the name of font
When I use the upper one (fontlist1.txt - mine) there shows an error. When I use the bottom one (fontlist.txt - originally from SynthText script) that works fine everytime.
Here you can see how I add paths and names into fontlist1.txt I also add the font names like 'Fabiolo', 'Halida Sans', ... into Font Manager but still nothing, shows the same errors.