Thank you very much, Charles
A test:
include "gdip.inc"
window 640,480,1
hdc = GetBufferDC()
%UnitPixel = 2
%UnitPoint = 3
Type RectF
single x
single y
single w
single h
End Type
Extern Lib "gdiplus.dll"
! GdipCreateFontFamilyFromName
! GdipDeleteFontFamily
! GdipCreateSolidFill
! GdipDrawString
! GdipCreateFont
! GdipDeleteFont
! GdipDeleteBrush
End Extern
wstring font
Sub SetFontEx(wstring fontname)
font = fontname
end sub
Sub DrawString(single x, y, height, wstring txt)
RECTF fRect = {x, y, ScrW, ScrH}
sys pFont, pFontFamily, pBrush
GdipCreateFontFamilyFromName font, NULL, &pFontFamily
GdipCreateFont pFontFamily, height, FontStyleRegular, UnitPoint, &pFont
GdipCreateSolidFill 0xFFFFFFFF, &pBrush
GdipDrawString hdc, txt, Len(txt), pFont, fRect, NULL, pBrush
GdipDeleteFont pFont
GdipDeleteBrush pBrush
GdipDeleteFontFamily pFontFamily
End Sub
SetFontEx "david"
DrawString 100,100,24,"Hi Charles,"
SetFontEx "georgia"
DrawString 100,124,24,"great, it works!"
SetFontEx "gisha"
DrawString 100,158,24,"Now, I am looking for another bugs."
SetFontEx "arial"
DrawString 100,186,22,"Anyway, many thanks for your effort."
setfontEx "wingdings"
DrawString 100,260,34,"JJJJJJJJJJJ"
for i=0 to 640 step 40
DrawString i,0x0,24,"q"
DrawString i,430,24,"m"
next
waitkey
winEnd
.