Announcement

Collapse
No announcement yet.

copy file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • copy file

    how to copy *.ttf to fonts folder in windows 10

  • #2
    I guess you need set the Destination folder to C:\Windows\Fonts with confirm copy if same file founded.

    Comment


    • #3
      i creat this code .. but not coped files
      File.Copy("AutoPlay\\Docs\\*.TTF", C:\\WindowsFolder \\Fonts", true, true, false, true, nil);

      Comment


      • #4
        Try this , i found it in the manual, i didn't try it but i think you can start from here.
        I will try it for u after i finish some tasks and will give u the results to do it.

        Code:
        fonts_dir = Shell.GetFolder(SHF_FONTS); -- Gets the path to the user's Font directory.
        System.RegisterFont(fonts_dir .. "\\myfont.ttf", "Crazy Font", true);

        Comment


        • #5
          fonts_path = Shell.GetFolder(SHF_FONTS)
          File.Copy("AutoPlay\\Docs\\arial.ttf", fonts_path, true);
          System.RegisterFont(fonts_path.."\\arial.ttf", "arial", true);
          end

          Comment


          • #6
            if you ask the wrong question
            what do you expect ?
            wrong answers
            Hint ::
            this is not a simple copy matter
            also this is not a font registration matter

            Comment


            • #7
              So startup What is the right answer ?

              Comment


              • #8
                Originally posted by sameer valva View Post
                So startup What is the right answer ?
                hi sameer
                Be patient and Follow

                Comment


                • #9
                  Specially that is a Multi forums unanswered question
                  asked from 6 years ago

                  Comment


                  • #10
                    After i posted my hint i realized that its not that easy, i found a post about it months ago were someone gave the way to install fonts through AMS , and even he put a way to search in system fonts and install the missing fonts only. Sadly i lost the post and didn't find it.

                    ill be patient and follow.

                    Comment


                    • #11
                      Originally posted by sameer valva View Post
                      i found a post about it months ago were someone gave the way to install fonts through AMS , and even he put a way to search in system fonts and install the missing fonts only
                      very good post sameer
                      so
                      we all waiting for you to show us that code



                      Comment


                      • #12
                        It seems to missed the last part

                        Sadly i lost the post and didn't find it.
                        But Ill do my best to find it, mean while we will an expert to jump in and solve it,


                        Comment


                        • #13
                          Originally posted by sameer valva View Post
                          Sadly i lost the post and didn't find it.
                          No problem
                          You have one Week to find it
                          Good luck

                          Comment


                          • #14
                            after i searched here i found some examples i hope they make a good start .

                            This one by Wonderboy :
                            Code:
                             
                             FontsFolder = Shell.GetFolder(SHF_FONTS); does_exist = File.DoesExist(FontsFolder.."\\yufen__0.ttf"); if does_exist  then return true; else do File.Copy("AutoPlay\\Docs\\My_Fonts\\yufen__0.ttf", FontsFolder.."\\yufen__0.ttf", true, true, false, true, nil); System.RegisterFont(Shell.GetFolder(SHF_FONTS).."\\yufen__0.ttf", "Yufenom", true); end end
                            and this one by the great Ulrich :
                            Code:
                             
                             [COLOR=#0000FF]local[/COLOR] os [COLOR=#FF0000]=[/COLOR] System[COLOR=#FF0000].[/COLOR]GetOSVersionInfo(); [COLOR=#0000FF]local[/COLOR] user [COLOR=#FF0000]=[/COLOR] System[COLOR=#FF0000].[/COLOR]GetUserInfo(); [COLOR=#0000FF]if[/COLOR] (user[COLOR=#FF0000].[/COLOR]IsAdmin) [COLOR=#0000FF]then[/COLOR]   [COLOR=#008000]-- Windows Vista and newer needs admin privileges to install fonts[/COLOR]   [COLOR=#0000FF]if[/COLOR] ((String[COLOR=#FF0000].[/COLOR]ToNumber(os[COLOR=#FF0000].[/COLOR]MajorVersion) [COLOR=#FF0000]>=[/COLOR] [COLOR=#000000]6[/COLOR] [COLOR=#0000FF]and[/COLOR] [COLOR=#0000FF]not[/COLOR] user[COLOR=#FF0000].[/COLOR]IsVistaAdminLimitedToken) [COLOR=#0000FF]or[/COLOR] String[COLOR=#FF0000].[/COLOR]ToNumber(os[COLOR=#FF0000].[/COLOR]MajorVersion) [COLOR=#FF0000]<=[/COLOR] [COLOR=#000000]5[/COLOR]) [COLOR=#0000FF]then[/COLOR]     [COLOR=#0000FF]local[/COLOR] FontsFolder [COLOR=#FF0000]=[/COLOR] Shell[COLOR=#FF0000].[/COLOR]GetFolder(SHF_FONTS);     File[COLOR=#FF0000].[/COLOR]Copy([COLOR=#800080]"AutoPlay[COLOR=#800080]\\[/COLOR]Docs[COLOR=#800080]\\[/COLOR]Brian Handwriting.ttf"[/COLOR][COLOR=#FF0000],[/COLOR] FontsFolder[COLOR=#FF0000],[/COLOR] [COLOR=#0000FF]false[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#0000FF]false[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#0000FF]false[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#0000FF]true[/COLOR]);     [COLOR=#0000FF]local[/COLOR] [COLOR=#0000FF]error[/COLOR] [COLOR=#FF0000]=[/COLOR] Application[COLOR=#FF0000].[/COLOR]GetLastError();     [COLOR=#0000FF]if[/COLOR] ([COLOR=#0000FF]error[/COLOR] [COLOR=#FF0000]~=[/COLOR] [COLOR=#000000]0[/COLOR]) [COLOR=#0000FF]then[/COLOR]       Dialog[COLOR=#FF0000].[/COLOR]Message([COLOR=#800080]"Error"[/COLOR][COLOR=#FF0000],[/COLOR] _tblErrorMessages[COLOR=#FF0000][[/COLOR][COLOR=#0000FF]error[/COLOR][COLOR=#FF0000]],[/COLOR] MB_OK[COLOR=#FF0000],[/COLOR] MB_ICONEXCLAMATION);     [COLOR=#0000FF]else[/COLOR]       System[COLOR=#FF0000].[/COLOR]RegisterFont(FontsFolder [COLOR=#FF0000]..[/COLOR] [COLOR=#800080]"[COLOR=#800080]\\[/COLOR]Brian Handwriting.ttf"[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#800080]"Brian Handwriting"[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#0000FF]true[/COLOR]);       [COLOR=#0000FF]error[/COLOR] [COLOR=#FF0000]=[/COLOR] Application[COLOR=#FF0000].[/COLOR]GetLastError();       [COLOR=#0000FF]if[/COLOR] ([COLOR=#0000FF]error[/COLOR] [COLOR=#FF0000]~=[/COLOR] [COLOR=#000000]0[/COLOR]) [COLOR=#0000FF]then[/COLOR]         Dialog[COLOR=#FF0000].[/COLOR]Message([COLOR=#800080]"Error"[/COLOR][COLOR=#FF0000],[/COLOR] _tblErrorMessages[COLOR=#FF0000][[/COLOR][COLOR=#0000FF]error[/COLOR][COLOR=#FF0000]],[/COLOR] MB_OK[COLOR=#FF0000],[/COLOR] MB_ICONEXCLAMATION);       [COLOR=#0000FF]else[/COLOR]         Dialog[COLOR=#FF0000].[/COLOR]Message([COLOR=#800080]"Info"[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#800080]"Font installed successfully!"[/COLOR][COLOR=#FF0000],[/COLOR] MB_OK[COLOR=#FF0000],[/COLOR] MB_ICONINFORMATION);       [COLOR=#0000FF]end[/COLOR]     [COLOR=#0000FF]end[/COLOR]   [COLOR=#0000FF]else[/COLOR]     Dialog[COLOR=#FF0000].[/COLOR]Message([COLOR=#800080]"Error"[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#800080]"This program must be run with elevation![COLOR=#800080]\r[/COLOR][COLOR=#800080]\n[/COLOR]Run as administrator, or modify the project settings."[/COLOR][COLOR=#FF0000],[/COLOR] MB_OK[COLOR=#FF0000],[/COLOR] MB_ICONSTOP);   [COLOR=#0000FF]end[/COLOR] [COLOR=#0000FF]else[/COLOR]   Dialog[COLOR=#FF0000].[/COLOR]Message([COLOR=#800080]"Error"[/COLOR][COLOR=#FF0000],[/COLOR] [COLOR=#800080]"Only administrators can install fonts!"[/COLOR][COLOR=#FF0000],[/COLOR] MB_OK[COLOR=#FF0000],[/COLOR] MB_ICONSTOP); [COLOR=#0000FF]end[/COLOR]

                            I didn't try any of them , but all other posts that i found here are around these two Codes.
                            I will try them as soon as i can , or if someone can finish this with the right Code.

                            Comment


                            • #15
                              ok

                              First
                              all my recpect to Ulrich (helpful and brilliant mind man)
                              Second
                              I will wait for sabmov to confirm that he still need help
                              Specially he is the original question owner

                              Comment

                              Working...
                              X