Results 1 to 5 of 5

Thread: fonts appearing differently on different machine

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    128

    fonts appearing differently on different machine

    i have 2 issues with fonts..

    - on my computer, the text are all ok but on another computer.. there are some characters that are replaced by symbols... like the ("\" replaced by a currency symbol)

    - on my computer, the text size is ok ,on another computer, the text are larger and doesn't even fit in a command button.... (probably system font size or resolution-related)..

    my question
    any solution? lol

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: fonts appearing differently on different machine

    Sounds as if you're using a font that's not installed on the other computer (or not installed on your computer). If a font isn't installed, Windows will use another font in that font family.

    Resolution: Install the missing font on the computer that's missing it.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    128

    Re: fonts appearing differently on different machine

    how can i detect if font is missing on the other computer in my application??

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: fonts appearing differently on different machine

    All fonts are installed in %windir%\fonts, or C:\Windows\Fonts.

    I think there is an API to get that specific folder. If not, you can use the GetWindowsDirectory() API function and then append \fonts to it.

    Then you can check if the file exists.

    Alternatively, you can check them like this:

    VB Code:
    1. Private Function FontExists(ByVal FontName As String) As Boolean
    2.     Dim strCName As String, intLoop As Integer
    3.    
    4.     strCName = LCase$(FontName)
    5.    
    6.     For intLoop = 0 To Screen.FontCount - 1
    7.        
    8.         If LCase$(Screen.Fonts(intLoop)) = strCName Then
    9.             FontExists = True
    10.             Exit For
    11.         End If
    12.    
    13.     Next intLoop
    14.    
    15. End Function
    16.  
    17. Private Sub Form_Load()
    18.     'Test function.
    19.     MsgBox FontExists("tahoma"), , "TRUE"
    20.     MsgBox FontExists("fjlskdfj"), , "FALSE"
    21. End Sub

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    128

    Re: fonts appearing differently on different machine

    thanks how can i set a font to all the textboxes/listboxes in my app???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width