Advertisement
Najeebsk

FONTS-VIEWER.ahk

Aug 5th, 2022 (edited)
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;PasteBin Link Of Font Family List.txt:https://pastebin.com/4EU72urE
  2. #SingleInstance,Force
  3. SetWorkingDir,%A_ScriptDir%
  4. OnMessage(0x201, "WM_LBUTTONDOWN")
  5. Edit_Color:= "White"
  6. Set_Window_Size:=0
  7. Family:=0
  8. ;Loading Font Faimly Dir
  9. ;-------------------------------
  10. FileRead,Temp,Font Family List.txt
  11. Font_Family_Index := 0
  12. loop, read,Font Family List.txt
  13.     {
  14.         Font_Family%A_Index% :=A_LoopReadLine
  15.         Font_Family0 = %A_Index%
  16.     }
  17.  
  18. Loop,%Font_Family0%
  19.     {
  20.         if A_Index = 1
  21.             List2 .= Font_Family%A_Index%  . "||"
  22.         else if A_Index != 1
  23.             List2 .= Font_Family%A_Index%  . "|"
  24.     }  
  25. ;-------------------------------------------------------
  26. ;Loading Font Favourites Dir
  27. ;-------------------------------
  28. FileRead,Temp,Font Favourites.txt
  29.     Font_Favorites_Index := 0
  30.     loop, read,Font Favourites.txt
  31.         {
  32.         Font_Favorites%A_Index% :=A_LoopReadLine
  33.         Font_Favorites0 = %A_Index%
  34.         }
  35.  
  36.     Loop,%Font_Favorites0%
  37.         {
  38.             if A_Index = 2
  39.             List1 .= Font_Favorites%A_Index%  . "||"
  40.            
  41.             else
  42.                 List1 .= Font_Favorites%A_Index%  . "|"
  43.         }
  44. ;-------------------------------------------------------       
  45. Gui, 1:Color,Gray,
  46. Gui, 1:Add, Groupbox, xm ym-5 w830 h150 center Section,Options
  47. Gui, 1:Add, Groupbox, xs+10 ym+20 w220 h55  Section,Font Family
  48. Gui, 1:Add, DropDownList,xs+5 ys+20  w200 r20 Sort vFont_Family_Selected gCheck ,%List2%
  49. Gui, 1:Add, Groupbox, xs  w220 h55 Section,Favourites
  50. Gui, 1:Add, DropDownList,xs+10 ys+20  w200 r20 Sort vFont_Favorites gCheck1,%List1%
  51. Gui, 1:Add, Groupbox, x250 ym+20 w120 h117 Section,Save / Delete
  52. Gui, 1:Add, Button, xs+10 ys+20 w100 h30  gAdd_To_Favourites,Add To Favourites
  53. Gui, 1:Add, Button, xp yp+55 w100 h30  gRemove_From_Favourites,Remove From Favourites
  54. Gui, 1:Add, Groupbox, x380 ym+20 w220 h55  Section,Type Colour
  55. Gui, 1:Add, DropDownList,xs+10 ys+20  w200 r20 vFont_Color gUpdate_Font,Black||Silver|Gray|White|Maroon|Red|Purple|Fuchsia|Green|Lime|Olive|Yellow|Navy|Blue|Teal|Aqua|
  56. Gui, 1:Add, Groupbox, xs  w220 h55  Section,Type Size
  57. Gui, 1:Font,cBlack s16 Bold
  58. Gui, 1:Add, Edit, xs+10 ys+20 w180 h30  vFont_Size gUpdate_Font
  59. Gui, 1:Add, UpDown, range1-200,12
  60. Gui, 1:Font,
  61. Gui, 1:Add, Groupbox,x610 ym+20  w220 h55  Section,Background Colour
  62. Gui, 1:Add, DropDownList,xs+10 ys+20  w200 r20 vEdit_Color gUpdate_Edit,Black|Silver|Gray|White||Maroon|Red|Purple|Fuchsia|Green|Lime|Olive|Yellow|Navy|Blue|Teal|Aqua|
  63. Gui, 1:Add, Checkbox, xs ys+65 w100 BackgroundTrans vBold_Font gUpdate_Font,Bold
  64. Gui, 1:Add, Checkbox, x+20 ys+65 BackgroundTrans vUnderline_Font gUpdate_Font,Underline
  65. Gui, 1:Add, Checkbox, xs yp+30  w100 BackgroundTrans vItalic_Font gUpdate_Font,Italic
  66. Gui, 1:Add, Checkbox, x+20   w100 BackgroundTrans vStrike_Font gUpdate_Font,Strike
  67. Gui, 1:Color,Gray,%Edit_Color%
  68. Gui, 1:Add, Edit, xm w830 h270 vFont_Display,Sample Text`n1 2 3 4 5 6 7 8 9 0`na A b B c C d D e E f F g G h H i I j J k K l L m M n N o O p P q Q r R s S t T u U v V w W x X y Y z Z
  69. Gui, 1:Add, Edit, xm w730 h20 vGui_Display,
  70. Gui, 1:Add, Button, x+10 w90 h20 gReload,Reload
  71. Gui,1:+AlwaysOnTop
  72. Gui,1:-Caption ;+Owner
  73. Gui, 1:Show, x100 y100 w850 h470,Font Tool
  74. SetTimer,Watch_Window,400
  75. return
  76. Watch_Window:
  77.     WinGetTitle,Active_Window,A
  78.     if(Active_Window!="Font Tool"&&Set_Window_Size==0)
  79.         {
  80.             WinGetTitle,New_Active_Window,A
  81.             Gui,1:Show,x1300 y700 w50 h20,Font Tool
  82.             WinActivate,%New_Active_Window%
  83.             Set_Window_Size:=1
  84.         }
  85.     if(Active_Window=="Font Tool"&&Set_Window_Size==1)
  86.         {
  87.             Gui, 1:Show,x500 y100 w850 h470,Font Tool
  88.             Set_Window_Size:=2
  89.         }
  90.     if(Set_Window_Size==2&&Active_Window!="Font Tool")
  91.         {
  92.             Set_Window_Size:=0
  93.         }
  94.     return
  95. GuiClose:
  96.     ExitApp
  97. Reload:
  98.     Reload
  99.     return
  100. Check:
  101.     Family:=0
  102.     gosub, Update_Font
  103.     return
  104. Check1:
  105.     Family:=1
  106.     gosub, Update_Font
  107.     return
  108. Update_Edit:
  109.     Gui, 1:Submit,NoHide
  110.     Gui, 1:Color,,%Edit_Color%
  111.     return
  112. Update_Font:
  113.     Gui, 1:Submit,NoHide
  114.     Gui,1:Font,
  115.     if(Font_Size>200)
  116.         {
  117.             Font_Size:=200
  118.             GuiControl,1:,Font_Size,200
  119.         }
  120.     if(Font_Size<1)
  121.         {
  122.             Font_Size:=1
  123.             GuiControl,1:,Font_Size,1
  124.         }  
  125.     if(Bold_Font==1)
  126.         Bold1:="Bold"
  127.     if(Bold_Font==0)
  128.         {
  129.             Gui,1:Font,
  130.             Bold1:=""
  131.         }
  132.     if(Underline_Font==1)
  133.         Underline1:="Underline"
  134.     if(Underline_Font==0)
  135.         {
  136.             Gui,1:Font,
  137.             Underline1:=""
  138.         }
  139.     if(Italic_Font==1)
  140.         Italic1:= "Italic"
  141.     if(Italic_Font==0)
  142.         {
  143.             Gui,1:Font,
  144.             Italic1:=""
  145.         }
  146.     if(Strike_Font==1)
  147.         Strike1:="Strike"
  148.     if(Strike_Font==0)
  149.         {
  150.             Gui,1:Font,
  151.             Strike1:=""
  152.         }
  153.     if(Family==0)
  154.         {
  155.             Gui,1:Font,
  156.             Gui, 1:Font,c%Font_Color% s%Font_Size% %Underline1% %Bold1% %Italic1% %Strike1% Q4,%Font_Family_Selected%  
  157.             Gui_Out := Font_Family_Selected
  158.         }
  159.     if(Family==1)
  160.         {
  161.             Gui,1:Font
  162.             Gui, 1:Font,c%Font_Color% s%Font_Size% %Underline1% %Bold1% %Italic1% %Strike1% Q4,%Font_Favorites%
  163.             Gui_Out := Font_Favorites
  164.         }
  165.     GuiControl,1:Font,Font_Display
  166.     Gui,1:Font,
  167.     Gui,1:Font,c%Font_Color%
  168.     GuiControl,1:Font,Gui_Display
  169.     Gui,1:Font,s16
  170.     GuiControl,1:Font,Font_Size
  171.     GuiControl,1:,Gui_Display,% "Gui,Font,c" Font_Color " s" Font_Size " " Underline1 " " Bold1 " " Italic1 " " Strike1 " Q4," Gui_Out
  172.     Gui,1:Font,
  173.     return
  174. Add_To_Favourites:
  175.     FileAppend,%Font_Family_Selected%`n,Font Favourites.txt
  176.     GuiControl,1:,Font_Favorites,%Font_Family_Selected%
  177.     return
  178. Remove_From_Favourites:
  179.     MsgBox, 262144, Remove Font Family From Favourites, Open the file called Font Favourites.txt and delete the one you don't want anymore.`n`nDid you think I was going to do everything for you? For free? `nlol you are funny lol`n`nNo really just delete the font family from the text doc and you are good to go.
  180.     Run, Font Favourites.txt
  181.     return
  182. WM_LBUTTONDOWN() {
  183.    IfWinActive,Font Tool
  184.             PostMessage, 0xA1, 2  
  185. }
  186. ;~ ~Up::
  187.     ;~ MouseGetPos,,,Active_Window,Ctrl
  188.     ;~ ControlGetText, TUM , %Ctrl%, ahk_id %Active_Window%
  189.     ;~ FileAppend,%TUM%`n,Temp text file to test.txt
  190.     ;~ return
  191. ;~ ~Down::
  192.     ;~ MouseGetPos,,,Active_Window,Ctrl
  193.     ;~ ControlGetText, TUM , %Ctrl%, ahk_id %Active_Window%
  194.     ;~ FileAppend,%TUM%`n,Temp text file to test.txt
  195.     ;~ return
  196. Esc::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement