Closed makseem77 closed 11 months ago
Please always include your specs like we ask for in our issue templates – MoviePy version, platform used etc. – to help pinpoint what causes your problem, thanks.
Please always include your specs like we ask for in our issue templates – MoviePy version, platform used etc. – to help pinpoint what causes your problem, thanks.
Sorry for that, just edited my issue.
Sorry for that, just edited my issue.
Better to put the specs at the bottom of the issue (see other open issues for how it's done when following the template). Subject lines are meant to summarise what issues are about, and shouldn't be hard to parse.
Sorry I'm pretty bad at this, can you link me a conventional issue so I can replicate the template ?
Sorry I'm pretty bad at this, can you link me a conventional issue so I can replicate the template ?
Any recent issue would have done, but no worries, I fixed it for you.
To see a list of fonts in your Windows OS, open cmd and type convert -list font
, now you'll see a list of fonts installed like this:
Font: Myanmar-Text
family: Myanmar Text
style: Normal
stretch: Normal
weight: 400
glyphs: c:\windows\fonts\mmrtext.ttf
Now find your font, grab its name and use it in the TextClip
object like this:
TextClip(
txt="Hello World",
size=(850, 1800),
method='caption',
fontsize=60,
color='white',
font="Myanmar-Text",
stroke_width=3,
stroke_color='black'
)
If you want to install font in Linux OS, first navigate to the font path then:
sudo mv path/to/font.otf /usr/share/fonts/
sudo fc-cache -f -v
Repeat same process to get the font name, bla bla...
To see a list of fonts in your Windows OS, open cmd and type
convert -list font
, now you'll see a list of fonts installed like this:Font: Myanmar-Text family: Myanmar Text style: Normal stretch: Normal weight: 400 glyphs: c:\windows\fonts\mmrtext.ttf
Now find your font, grab its name and use it in the
TextClip
object like this:TextClip( txt="Hello World", size=(850, 1800), method='caption', fontsize=60, color='white', font="Myanmar-Text", stroke_width=3, stroke_color='black' )
If you want to install font in Linux OS, first navigate to the font path then:
sudo mv path/to/font.otf /usr/share/fonts/ sudo fc-cache -f -v
Repeat same process to get the font name, bla bla...
Thanks for your answer, but my issue is that whenever I install a font, it doesn't show up in the convert -list font
list. I only have in this list the font that are already installed on Windows, but no way to add (or even delete) fonts.
Try manual adding fonts to c:\windows\fonts\
, maybe it work?
Try manual adding fonts to
c:\windows\fonts\
, maybe it work?
By drag and dropping a .ttf into it right ? I tried it and it didn't solve the issue. I can see all my custom fonts in c:\windows\fonts\
but it doesn't translate in convert -list font
.
I also just noticed that when I type convert -list font
in cmd in administrator mode, I actually don't get the list, but in normal mode it works. (maybe this could hint something wrong on my ImageMagick installation ?)
Btw I also use custom fonts in Windows OS and it works perfect, I don’t know why it’s not working for you? You can give a try to Linux OS.
Didn't find the cause of the issue, but what works for me is to simply Right Click + "Install for all users" on my .otf/.ttf files so they end up in the C:\Windows\Fonts location and not in the C:\Users\33628\AppData\Local\Microsoft\Windows\Fonts location.
for some reason, I can't use custom fonts when creating a MoviePy TextClip. It says in their documentation that it should be to use all the fonts installed on my system, but when I run this little code snippet in Visual Studio with Python (to get all the possible TextClip fonts):
It prints a list of all the basic fonts that you get when you install Windows, but none of the custom fonts that I installed myself. (And that I can see in the Windows/Fonts directory)
I did some research and it seems that it might be related with ImageMagick, but apparently, on Windows, the fonts should be handled without the user having to do anything. I tried reinstalling ImageMagick, but it didn't solve the issue. I also found a post talking about editing the type-windows.xml file in the ImageMagick config, but when I open it, I see a list of fonts looking like this:
But the fonts do not correspond with the one I see when I print the list from TextClip.list + I didn't find anything on how to manually add a font there so I gave up on this lead.
If anyone has some ideas on what I'm doing wrong, it would be greatly appreciated !
ImageMagick version ImageMagick-7.1.1-Q16-HDRI
Operating system Windows 10
Operating system, version and so on Windows 10.0.19044 Build 19044
MoviePy version 1.0.3