Checking available fonts?

Discussion in 'Questions (Windows Mobile)' started by MitchDabo, Feb 9, 2008.

  1. MitchDabo

    MitchDabo New Member

    Is it possible to check what fonts are available on the device? I haven't found any examples and can't find a registry value that has the info. Thanks.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It isn't possible (without creating a custom library).
    You can always copy the required font file to \Windows\Fonts.
     
  3. MitchDabo

    MitchDabo New Member

    Thank you. I was just looking for a more generic solution.
     
  4. alfcen

    alfcen Well-Known Member Licensed User

    Hello Mitch

    Please try the code below. It works for my PPC but not necessarily for all devices.

    Cheers
    Robert

    Code:
    Sub Globals  
      
    Dim Values(0)
    End Sub

    Sub mnuSysFonts_Click
      Reg.RootKey(Reg.rtLocalMachine)
      Values() = reg.GetValueNames(
    "SOFTWARE\Microsoft\FontLink\SystemLink")
      lbS.Clear  
    'lbS is a listbox
      lbS.Add("SYSTEM FONTS:")
      
    For i = 0 To ArrayLen(Values())-1
        lbS.Add(Values(i))
      
    Next
      lbS.Add(
    "")
      lbS.Add(
    "ADDED FONTS:"'look for fonts in \Windows\Fonts
      FileSearch (alFiles, hard.GetSpecialFolder(hard.sfFonts), "*.ttf")
      alFiles.Sort(cCaseUnsensitive) 
    'alFiles is an array list for sorting purposes
      For i = 0 To alFiles.Count - 1
        lbS.Add(FileName(alFiles.item(i)))
      
    Next
    End Sub
     
  5. MitchDabo

    MitchDabo New Member

    Many thanks, I will give it a try.
     
  6. MitchDabo

    MitchDabo New Member

    It did work. The system font seems to be at HKEY_LOCAL_MACHINE\System\GDI\SYSFNT on my Mogul. Although I could get the added font file names with your program, I couldn't get the actual font names - needed to select them with a program. Maybe this is because I couldn't get "hard.GetSpecialFolder(hard.sfFonts)" to work. Thanks for your help.
     
Loading...