#Include once "window9.bi"

Function LoadFont(ByVal Name_     As String, _
                  ByVal Size      As Integer, _
                  ByVal corner    As Integer,_ 
                  ByVal BOLD      As integer,_ 
                  ByVal Italic    As Integer,_ 
                  ByVal Underline As Integer,_ 
                  ByVal StrikeOut As Integer) As HFONT Export
  Dim As Integer size_ 
  If BOLD=1 Then 
    BOLD=700
  Else
    BOLD=400
  EndIf
  Dim As HDC hdc = CreateDC("DISPLAY",0,0,0)
  size_ = -MulDiv(Size, GetDeviceCaps(hdc, LOGPIXELSY), 72)
  DeleteDC(hdc)
  Return CreateFont(size_,0,corner*10,0,Bold,Italic,Underline,StrikeOut, _
                    DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH Or FF_DONTCARE,Name_)
End Function
