Copy link to clipboard
Copied
Hi guys good morning! What is the possibility of adding a font.ttf in the default font directory of windows with script, "C: \ Windows \ Fonts"? I tried a script to copy and paste into the fonts folder however, it doesn't work in that folder. Is there any possibility? If possible, could anyone share? Thanks
Copy link to clipboard
Copied
Does your code work with some other folder? If so, then it might be a case of privileges for the user using which the code executes.
-Manan
Copy link to clipboard
Copied
Hi Manan Joshi , it works well with other folders.
I used it to add some fonts to the standard font folders of Adobe software at: "/ C / Program Files / Common Files / Adobe / Fonts /" ... and it works fine. My goal is to create a user interface whose elements will be icons and they will be based on a font.ttf that I am creating just for this purpose.
The problem is that in user interfaces, the font is not identified if it is not inside the standard windows font folder.
Here is the script:
var source = new Folder ("~/desktop/MyFonts/");
var sourceFiles = source.getFiles ();
var destination = new Folder ("/C/Program Files/Common Files/Adobe/Fonts/");
if(!destination.exists) destination.create();
for (var turn=0; turn<sourceFiles.length; turn++){
var fileName = sourceFiles[turn].name;
var sucess = sourceFiles[turn].copy(destination+'/'+fileName);
}