Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. install windows fonts

install windows fonts

Scheduled Pinned Locked Moved C#
jsonquestion
5 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • W Offline
    W Offline
    Werdna
    wrote on last edited by
    #1

    Does anyone know any API to install fonts to windows folder? On XP I used to just copy those to windows/fonts folder, but it does not work on vista. There is windows API AddFontResource, but it only installs font until user reboots computer. Thanks.

    E S O 3 Replies Last reply
    0
    • W Werdna

      Does anyone know any API to install fonts to windows folder? On XP I used to just copy those to windows/fonts folder, but it does not work on vista. There is windows API AddFontResource, but it only installs font until user reboots computer. Thanks.

      E Offline
      E Offline
      Eduard Keilholz
      wrote on last edited by
      #2

      You can add fonts to your setup & deployment project and then register it as font..

      .: I love it when a plan comes together :. http://www.zonderpunt.nl

      W 1 Reply Last reply
      0
      • W Werdna

        Does anyone know any API to install fonts to windows folder? On XP I used to just copy those to windows/fonts folder, but it does not work on vista. There is windows API AddFontResource, but it only installs font until user reboots computer. Thanks.

        S Offline
        S Offline
        SpiveyC
        wrote on last edited by
        #3

        I did not need to register the new font. I copied the new font file into the directory during the install. XP and Vista found it and listed it in the font selection dialog with no problems. :confused: did not know that i had to register the font in anyway

        1 Reply Last reply
        0
        • E Eduard Keilholz

          You can add fonts to your setup & deployment project and then register it as font..

          .: I love it when a plan comes together :. http://www.zonderpunt.nl

          W Offline
          W Offline
          Werdna
          wrote on last edited by
          #4

          I need to do it programmatically.

          1 Reply Last reply
          0
          • W Werdna

            Does anyone know any API to install fonts to windows folder? On XP I used to just copy those to windows/fonts folder, but it does not work on vista. There is windows API AddFontResource, but it only installs font until user reboots computer. Thanks.

            O Offline
            O Offline
            Okultist
            wrote on last edited by
            #5

            I think i have the same problem. I want to copy the a font file by using my program, but the only thing i managed until now is to register the font file vie AddFontResoucre so openoffice can use it until my pc reboots. I tried to get write permissions by using FileIoPermission for the font-Directory but when my program actually copies the file to the directory it says i dont have the permission to do so. My code looks like this:

            FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Write, "C:\\Windows\\Fonts\\");
            f2.AddPathList(FileIOPermissionAccess.Read, fontPath);
            try
            {
            f2.Demand();
            System.IO.File.Copy(fontPath, destination);
            }
            catch (SecurityException se)
            {
            MessageBox.Show(se.ToString());
            }
            catch (UnauthorizedAccessException ex)
            {
            MessageBox.Show(ex.ToString());
            }

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups