Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
15th March 2017, 01:29 | #1 | Link |
Registered User
Join Date: Feb 2013
Posts: 10
|
Can AviSynth use/load/import a font file that isn't in Windows' Fonts folder?
Can AviSynth use/load/import a font file that isn't in Windows' Fonts folder?
I have the TTF file, which I would like to use for subtitles, but I would prefer other users of my script not to have to copy it into their Windows' Fonts folder. I don't want them to modify their system in any way other than installing AviSynth itself. Is there any way to load the font file in my script or by some other means? Thanks. |
17th March 2017, 13:31 | #3 | Link |
Registered User
Join Date: Feb 2013
Posts: 10
|
Interesting to know about, and I guess it proves it could be done with an external plugin, but would I have to then write the text to a .ass file to be able to use this, rather than just passing it as a parameter? Also, I don't see how I can load a font file with this plugin, unless the ASS file itself can load the file or link to it. I've never used ASS.
I need to render title text that is generated within the script, with a specific font, rather than displaying normal subtitles from a file. It seems that assrender would be quite a laborious way to achieve this, or may not be able to load a font file at all. Also, it speaks about font caching - would that cache all the fonts on the user's system? Basically I just want something that is equivalent to: Subtitle("My text here", font_file="Font Name.ttf") I may have to force the user to install the font on their system :/ Thanks. |
17th March 2017, 13:46 | #4 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Correct.
For reference, documentation of "subtitle" parameters here. There is a plugin called "SubtitleEx" but that just adds visual effects.
__________________
Groucho's Avisynth Stuff |
17th March 2017, 13:54 | #5 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
@Leo D9:
Read the assrender readme. srt with font from file instead of system is possible. Text directly in AviSynth script instead of subtitle file is not AFAIK. Maybe you can abuse some file writer plugin if you need that badly ... |
17th March 2017, 14:03 | #6 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
You can attach fonts with Aegi sub to .ass files. Tested with VSfiltermod.
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
17th March 2017, 14:16 | #7 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Awkward but that would probably work.
__________________
Groucho's Avisynth Stuff |
17th March 2017, 17:43 | #8 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Interesting idea, and it was not was not much work to integrate it in Avisynth+, so it will appear in the next release. It will look like
Code:
Subtitle("Roboto Test", x=-1, y=50, font_width=0, font="Dancing Script1002", font_filename="DancingScript-Regular.ttf") Subtitle("Roboto Test", x=-1, y=75, font_width=0, font="Dancing Script1002") |
22nd March 2017, 15:33 | #10 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Perhaps this can be hacked, just add font_filename arg to func, and pass it on to the Subtitle call.
Code:
#Avisource("D:\avs\test.avi") Colorbars.killaudio Function Sub(clip c, string text, float "x", float "y", int "first_frame", int "last_frame", string "font", float "size", \ int "text_color", int "halo_color", int "align", int "spc", int "lsp", float "font_width", float "font_angle", bool "interlaced", \ bool "vcenter") { c GScript(""" size=Default(size,18) vcenter=Default(vcenter,false) if(vcenter && Defined(align) && Defined(lsp) && (align>=4 && align<=6)) { s=RT_StrReplace(text,"\n",Chr(10),Sig=false) # Replace String case Insignificant Lines = RT_TxtQueryLines(s) # Line count with/without final newline y=(Height/2) - ((Lines-1) * size / 2.0) } """) Subtitle(text,x,y,first_frame,last_frame,font,size,text_color,halo_color,align,spc,lsp,font_width,font_angle,interlaced) } VC=True #VC=False S="The\nQuick\nBrown\nfox\njumped\nover\nthe\nlazy\ndog.\nThe\nQuick\nBrown\nfox\njumped\nover\nthe\nlazy\ndog.\n" Sub(S,lsp=0,align=4,vcenter=VC) Sub(S,lsp=0,align=5,vcenter=VC) Sub(S,lsp=0,align=6,vcenter=VC)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
Tags |
avisynth, font, import, load, ttf |
|
|