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. |
9th December 2020, 00:35 | #161 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Here is the answer,
Code:
SZ=20 BlankClip(width=80,height=360).Trim(0,-1) For(n=$80,$8F) { s = RT_String("$%02X %s",n,Chr(n)) RT_DebugF("%s",S) Subtitle(s,font="Courier New",size=SZ,y=(n-$80)*SZ) } Return Last
__________________
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 ??? |
9th December 2020, 03:26 | #162 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
OK, This should produce (more or less) good results whatever charset.
We have fixed numbers (sizes) so that both Courier New and WingDings fonts look OK-ish. Code:
######## # Mod ADD_Y and ADD_X to give more or less spacing to characters in Characterset grid (at least 0) ############### Try eg SIZE_Y=40 SIZE_X=32 ADD_Y=0 ADD_X=32 SIZE_Y = 20 # Font size (For Hex Numbers) SIZE_X = 16 # Font size (For Hex Numbers [actually spacing allotted]) ADD_Y = 0 # Additional vertical spacing for character grid (over and above hex number font) ADD_X = 16 # Additional horizontal spacing for character grid (over and above hex number font) CELL_H = SIZE_Y+ADD_Y # Character Box Height CELL_W = SIZE_X+ADD_X # Character Box Width (Adjust for font) VLINE_W = 2 # Vertical grid lines thickness HLINE_H = 2 # Horizontal grid lines thickness LINECOL =$808080 # grid color BORDCOL= $FF0000 # outer lines color #Font = "Courier New" # Character set Font name (Numbers always done in "Courier New") Font = "WingDings" #Font = "Symbol" #Font = "OpenSymbol" #Font = "Times New Roman" #Font = "WebDings" ####################### HexDigit = "0123456789ABCDEF" T=BlankClip(Length=1,width=CELL_W,height=CELL_H) # Do Character Set grid for(y=0,15) { For(x=0,15) { n = y * 16 + x char = Chr(n) charC = T.Subtitle(char,font=FONT,size=SIZE_Y) xclip = (x==0) ? charC : xclip.StackHorizontal(charC.AddBorders(VLINE_W,0,0,0,LINECOL)) } CHARSET = (y==0) ? xclip : CHARSET.StackVertical(xclip.AddBorders(0,HLINE_H,0,0,LINECOL)) } #return charset # Vertical Hex Numbers TV=T.BlankClip(Width=SIZE_X*3) for(y=0,15) { numC = TV.Subtitle("$"+HexDigit.MidStr(y+1,1)+"0",font="Courier New",size=SIZE_Y) yNumC = (y==0) ? numC : yNumC.StackVertical(numC.Addborders(0,HLINE_H,0,0,LINECOL)) } #return yNumC for(x=0,15) { numC = T.Subtitle(HexDigit.MidStr(x+1,1),font="Courier New",size=SIZE_Y) xNumC = (x==0) ? numC : xNumC.StackHorizontal(numC.Addborders(VLINE_W,0,0,0,LINECOL)) } #return xNumC yNumC = yNumC.AddBorders(0,0,VLINE_W,0,LINECOL) # Line between vertical numbers and charset xNumC = xNumC.AddBorders(0,0,0,HLINE_H,LINECOL) # Line between horizontal numbers and charset Corner= T.BlankClip(Width=SIZE_X*3).AddBorders(0,0,VLINE_W,HLINE_H,LINECOL) # Top LHS corner TOP = Corner.StackHorizontal(xnumC) BOT = yNumC.StackHorizontal(CHARSET) StackVertical(TOP,BOT) # Glue the whole lot together AddBorders(VLINE_W,HLINE_H,VLINE_W,HLINE_H,BORDCOL) # Add Outer border Return Last Font = "Courier New" Font = "WingDings" Win7 Symbol Win7 OpenSymbol Font = "Times New Roman" Font = "WebDings" Font ="WingDings" # BIG with mods Code:
SIZE_Y = 40 # Font size (For Hex Numbers) SIZE_X = 32 # Font size (For Hex Numbers [actually spacing allotted]) ADD_Y = 0 # Additional vertical spacing for character grid (over and above hex number font) ADD_X = 32 # Additional horizontal spacing for character grid (over and above hex number font) WebDings Big Spot any more probs Wonkey ? EDIT:We seem to have a "Bullet" at chr(7) [Bell control code character] in both Courier New and Wingdings.
__________________
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 ??? Last edited by StainlessS; 9th December 2020 at 05:55. |
9th December 2020, 05:23 | #163 | Link | |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,420
|
Quote:
|
|
9th December 2020, 06:06 | #164 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Previous post removed RT_Stats requirement, only AVS+ required.
Converterted to Function, might want to create muiltiple example font frames. eg SubtitleCharacterSet("Symbol") ++ SubtitleCharacterSet("webdings")++SubtitleCharacterSet("Times New Roman") SubtitleCharacterSet.avsi Code:
# SubtitleCharacterSet.avsi /* SubtitleCharacterSet() ::: by StainlessS @ https://forum.doom9.org/showthread.p...08#post1930308 Req Avs+ Produces an RGB32 single frame showing characterset for a particular Subtitle font, in Hex/ASCII table. SubtitleCharacterSet( String Font, [* Font Name, Not Optional, Default Arial if "" or invalid font *] Int "Size_y" =20, [* Height of Hex numbers [Courier New) *] Int "Size_X" =16, [* Width of Hex numbers [Courier New) *] Int "Add_Y" =0, [* Vertical Spacing to add for Font characterset, over and obove that allotted for Hex Numbers *] Int "Add_X" =16, [* Hoizontal Spacing to add for Font characterset, over and obove that allotted for Hex Numbers *] Int "VLine_W"=2, [* Width of Vertical lines in grid *] Int "HLine_H"=2, [* Height of Horizontal lines in grid *] Int "LineCol"=$808080, [* Color of Lines in grid *] Int "BordCol"=$FF0000, [* Color of border line *] Bool "Title "=True [* Show Font title on top of frame *] ) eg SubtitleCharacterSet("Arial") SubtitleCharacterSet("Courier New") SubtitleCharacterSet("Symbol") SubtitleCharacterSet("OpenSymbol") SubtitleCharacterSet("Times New Roman") SubtitleCharacterSet("WebDings") SubtitleCharacterSet("WingDings") SubtitleCharacterSet("WebDings" ,Size_Y=40,Size_X=32,Add_Y=0,Add_X=32) SubtitleCharacterSet("WingDings",Size_Y=40,Size_X=32,Add_Y=0,Add_X=32) SubtitleCharacterSet("Symbol") ++ SubtitleCharacterSet("webdings")++SubtitleCharacterSet("Times New Roman") */ Function SubtitleCharacterSet(String Font,Int "Size_y",Int "Size_X",Int "Add_Y",Int "Add_X", \ Int "VLine_W", Int "HLine_H", \ Int "LineCol",Int "BordCol", \ Bool "Title" \ ) { Size_Y = Default(Size_Y,20) Size_X = Default(Size_X,16) Add_Y = Default(Add_Y, 0) Add_X = Default(Add_X, 16) VLine_W = Default(VLine_W,2) HLine_H = Default(HLine_H,2) LineCol = Default(LineCol,$808080) BordCol = Default(BordCol,$FF0000) Title = Default(Title,True) # CELL_H = SIZE_Y+ADD_Y # Character Box Height CELL_W = SIZE_X+ADD_X # Character Box Width (Adjust for font) T=BlankClip(Length=1,width=CELL_W,height=CELL_H) HexDigit = "0123456789ABCDEF" # Do Character Set grid for(y=0,15) { For(x=0,15) { n = y * 16 + x char = Chr(n) charC = T.Subtitle(char,font=FONT,size=SIZE_Y) xclip = (x==0) ? charC : xclip.StackHorizontal(charC.AddBorders(VLINE_W,0,0,0,LINECOL)) } CHARSET = (y==0) ? xclip : CHARSET.StackVertical(xclip.AddBorders(0,HLINE_H,0,0,LINECOL)) } # Vertical Hex Numbers TV=T.BlankClip(Width=SIZE_X*3) for(y=0,15) { numC = TV.Subtitle("$"+HexDigit.MidStr(y+1,1)+"0",font="Courier New",size=SIZE_Y) yNumC = (y==0) ? numC : yNumC.StackVertical(numC.Addborders(0,HLINE_H,0,0,LINECOL)) } for(x=0,15) { numC = T.Subtitle(HexDigit.MidStr(x+1,1),font="Courier New",size=SIZE_Y) xNumC = (x==0) ? numC : xNumC.StackHorizontal(numC.Addborders(VLINE_W,0,0,0,LINECOL)) } yNumC = yNumC.AddBorders(0,0,VLINE_W,0,LINECOL) # Line between vertical numbers and charset xNumC = xNumC.AddBorders(0,0,0,HLINE_H,LINECOL) # Line between horizontal numbers and charset Corner= T.BlankClip(Width=SIZE_X*3).AddBorders(0,0,VLINE_W,HLINE_H,LINECOL) # Top LHS corner TOP = Corner.StackHorizontal(xnumC) BOT = yNumC.StackHorizontal(CHARSET) StackVertical(TOP,BOT) # Glue the whole lot together AddBorders(VLINE_W,HLINE_H,VLINE_W,HLINE_H,BORDCOL) # Add Outer border (TITLE) \ ? Last.BlankClip(Height=SIZE_Y).StackVertical(Last).Subtitle(Font,font="Courier New",size=SIZE_Y).AddBorders(VLINE_W,HLINE_H,VLINE_W,0,BORDCOL) \ : Last Return Last } Code:
[* Font Name, Not Optional, Default Arial if "" or invalid font *] script with the SubtitleCharacterSet.avsi in plugins. Code:
StackVertical(SubtitleCharacterSet("Symbol"),SubtitleCharacterSet("webdings")) EDIT: UK NumberPlate font (Charles Write font):- https://forum.doom9.org/showpost.php...8&postcount=25 See StainlessS below in sig, DATA folder for font.
__________________
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 ??? Last edited by StainlessS; 8th March 2021 at 21:04. |
9th December 2020, 08:42 | #165 | Link | |
Registered User
Join Date: Jul 2018
Posts: 1,075
|
Quote:
Like: 1. Create empty string. 2. Convert it to UTF8 so it is now treated as UTF8 encoded string. 3. + (add) to it our required char code like +CHR($2022). 4. Use it in Subtitle. So to use UTF-8 symbols and strings we need to operate avisynth script as UTF-8 encoded file ? And from 8-bit ANSI text files we can call only 256-symbols part of fonts ? Last edited by DTL; 9th December 2020 at 08:50. |
|
9th December 2020, 16:30 | #167 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,075
|
Oh - now I undrstand. It is Ms Word that shows in the single window named 'code word' 0x95 for ASCII hex 'bullet' and unicode hex 0x2022 for the Unicode 'bullet', but they are very different numbers. And I need to found somewhere convertor of 'Unicode code point' into real byte sequence to enter it using CHR().
|
9th December 2020, 20:13 | #168 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
I'm guessin' that MidStr() et al cannot cope with UTF-8. [?]
__________________
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 ??? |
30th December 2020, 17:29 | #169 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,075
|
Because this forum is mostly about moving pictures I finally made script for creating source data for testing resizers. Based on the 'bullet' symbol because it is closer to 'elementary moving picture object' like elementary 'dot'.
Code:
function SourceObject(clip c, float fArg) { xpos_rot = c.width/3+(10*Sin(Pi()*fArg/(50))) ypos_rot = c.width/3-(10*Cos(Pi()*fArg/(50))) xpos_diag = c.width*2/3+(10*Sin(Pi()*fArg/(50))) ypos_diag = c.width*2/3-(10*Sin(Pi()*fArg/(50))) xpos_h = c.width*2/3+(10*Sin(Pi()*fArg/(50))) ypos_h = c.width/3 xpos_v = c.width/3 ypos_v = c.width*2/3+(10*Sin(Pi()*fArg/(50))) ch_size = (Int(fArg/100))+1 xpos_rot_i=Int(xpos_rot) ypos_rot_i=Int(ypos_rot) xpos_diag_i=Int(xpos_diag) ypos_diag_i=Int(ypos_diag) xpos_h_i=Int(xpos_h) ypos_h_i=Int(ypos_h) xpos_v_i=Int(xpos_v) ypos_v_i=Int(ypos_v) c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_rot_i,y=ypos_rot_i,halo_color=$FF000000, text_color=$00e0e0e0) c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_diag_i,y=ypos_diag_i,halo_color=$FF000000, text_color=$00e0e0e0) c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_h_i,y=ypos_h_i,halo_color=$FF000000, text_color=$00e0e0e0) c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_v_i,y=ypos_v_i,halo_color=$FF000000, text_color=$00e0e0e0) return c } BlankClip(30000,800,800,"RGB24",25,color=$00202020) Animate(last, 0,30000,"SourceObject", 0, 30000) ConvertToYV24() # production-downsizing #SinPowResizeMT(last,width/10,height/10,p=2.6) GaussResize(last,width/10,height/10,p=12) #JincResize(width/10,height/10,tap=5) #LanczosResizeMT(last,width/10,height/10,taps=8) #restoring vewing-upsizing #SincLin2ResizeMT(width*8,height*8,taps=8) SincResize(width*8,height*8,taps=5) #JincResize(width*8,height*8,tap=5) #Levels(25, 1, 55, 0, 255) # can be used for better viewing of processing errors |
8th March 2021, 21:05 | #170 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Added UK Numberplate font image to post #164.
Also added font in zip, StainlessS@MediaFire in sig, DATA folder.
__________________
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 ??? Last edited by StainlessS; 9th March 2021 at 13:42. |
28th April 2021, 12:53 | #171 | Link |
Registered User
Join Date: Sep 2020
Posts: 135
|
What is a good way to practice making these scripts? Someone recommend another method to resize videos and they suggested that I use a AVISynth script to do that. Can anyone tell what is a good way to start? Or even have a dictionary/guide/etc. to get em started?
|
28th April 2021, 16:12 | #172 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Where it says "New To Avisynth - Start Here"
http://avisynth.nl/index.php/Main_Page
__________________
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 ??? |
2nd May 2021, 11:48 | #174 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Universal Avisynth Installer:- https://forum.doom9.org/showthread.php?t=172124 Easy to switch, just execute the CMD file, and select which version you want to activate. where both x86 and x64 active, use eg VDub2 x86 for x86 AVS, and VDub2 x64 for x64 AVS. x86 VD2 requires x86 Avisynth and x86 plugins, x64 VD2 requires x64 Avisynth and x64 plugins.
__________________
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 ??? Last edited by StainlessS; 2nd May 2021 at 11:52. |
|
1st June 2021, 12:00 | #176 | Link | |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,666
|
Quote:
|
|
2nd June 2021, 09:59 | #177 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,905
|
Quote:
My personal Avisynth Cheat Sheet to use when I'm too lazy and I just want to copy-paste: https://github.com/FranceBB/FranceBB...visynth-Script |
|
Tags |
avisynth, faq |
|
|