• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    FOG Snapin - Font installation (Windows)

    Scheduled Pinned Locked Moved
    Tutorials
    1
    1
    1.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AvaryanA
      Avaryan
      last edited by Avaryan

      Our media department has a couple dozen fonts that they regularly use. I created this FOG snapin to automate the task. Works for TrueType and OpenType fonts.
      alt text

      $Fonts = Get-ChildItem -Path $PSScriptRoot -Recurse | Where-Object -FilterScript { $PSItem.Extension -eq ".ttf" -or $PSItem.Extension -eq ".otf" }
      $FontPath = "$env:SystemRoot\Fonts"
      $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
      
      ForEach ($Font in $Fonts) {
          Copy-Item -Path $Font.FullName -Destination $FontPath -Force
          $Name = $Font.BaseName
          if ($Font.Extention -eq ".ttf") {
              $Name = $Font.BaseName + " (TrueType)"
          } elseif ($Font.Extention -eq ".otf") {
              $Name = $Font.BaseName + " (OpenType)"
          }
          $Value = $Font.Name
          New-ItemProperty -Path $RegPath -Name $Name -Value $Value -Force | Out-Null
      }
      

      Put the install.ps1 file and your fonts into a folder and zip archive it. Then upload it as a SnapinPack.
      alt text

      A restart is required before the fonts will be accessible.

      1 Reply Last reply Reply Quote 4
      • 1 / 1
      • First post
        Last post

      157

      Online

      12.0k

      Users

      17.3k

      Topics

      155.2k

      Posts
      Copyright © 2012-2024 FOG Project