FontID()

Syntax

FontID = FontID(#Font)
Beschreibung
Gibt den eindeutigen System-Identifier (Bezeichner) des Zeichensatzes '#Font' zurück.

Dieses Ergebnis wird manchmal auch als 'Handle' bezeichnet. Schauen Sie in das Extra-Kapitel 'Handles und Nummern' für weitere Informationen.

Es ist auch möglich, das Ergebnis von FontID() zum Auswählen aus verschiedenen geladenen Zeichensätzen zu verwenden.
Ein Beispiel für die Verwendung von FontID() in Kombination mit SetGadgetFont():
  If OpenWindow(0, 0, 0, 222, 130, "FontID()", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ButtonGadget(0, 10, 10, 200, 30, "Anklicken zum Ändern des Fonts...")
    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  

Unterstützte OS

Alle

Font Inhaltsverzeichnis - FreeFont() ->