FontID()

Syntaxe

Resultat = FontID(#Police)
Description
Renvoie l'identifiant d'une police dans le système d'exploitation.

Arguments

#Police Le numéro d'identification de la police à tester.

Valeur de retour

Renvoie l'identifiant système de la police.

Ce résultat est aussi parfois appelé 'Handle'. Jetez un oeil au chapitre Numéros et Identifiants pour plus d'informations.

Exemple

  If OpenWindow(0, 0, 0, 222, 130, "FontID()", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)  
    ButtonGadget(0, 10, 10, 200, 30, "Cliquez pour changer la police...")
    Font1 = LoadFont(#PB_Any, "Arial"  ,  8, #PB_Font_Bold) 
    Font2 = LoadFont(#PB_Any, "Verdana", 12, #PB_Font_StrikeOut) 
    UsedFont = 1
  EndIf 
  
  Repeat 
    Event = WaitWindowEvent()
  
    If Event = #PB_Event_Gadget
      If EventGadget() = 0
        If UsedFont = 1 
          SetGadgetFont(0, FontID(Font2)) 
          UsedFont = 2
        Else
          SetGadgetFont(0, FontID(Font1)) 
          UsedFont = 1
        EndIf
      EndIf
    EndIf
  Until Event = #PB_Event_CloseWindow 

Voir aussi

IsFont(), LoadFont(), SetGadgetFont(), DrawingFont()

OS Supportés

Tous

Font Index - FreeFont() ->