שאלה קטנה...

zontar

New member
שאלה קטנה... ../images/Emo35.gif

איך אני גורם לכתב כלשהוא בform שלי לעבוד עם פונט שלי (מוגדר אצלי במחשב) אבל פונט זה בד"כ לא קיים ברוב המחשבים??
 

The Guardian

New member
אממ..

או שתשתמש בResorce file בשביל הפונט או שכשאתה עושה את תוכנית ההתקנה תשים שם את הפונט..זה מה שאני עושה..אולי יש עוד דרך..
 

MaD-d0g

New member
ישנה פונקצית Api...

ישנה פונקצית Api שתוכל לעזור לך בשאלתך
Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) A​
 

zontar

New member
אודה לך אם תיתן לי הסבר קטן ..

על השימוש בה...(אני לא ממש מתמצא ב api ) תודה.
 

MaD-d0g

New member
מובן?

Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long Dim AppPath As String Private Sub Form_Load() AppPath = App.Path If Right$(AppPath, 1) <> "\" Then AppPath = AppPath + "\" ´Add the font to the Windows Font Table AddFontResource AppPath + "myfont.ttf" ´Write something on the form Me.AutoRedraw = True Me.FontName = "myfont" Me.Print "This is a test!" End Sub Private Sub Form_Unload(Cancel As Integer) ´Remove the font from the Windows Font Table RemoveFontResource AppPath + "myfont.ttf" End Sub​
בספריה של הישום שלך, אתה צריך לשים את הפונט, במקרה הזה, "Mydont.ttf"
 
למעלה