日期:2009-03-27  浏览次数:20559 次

' 将OLE StdFont字体结构转换到API的LOGFONT字体结构
With tLF
sFont = myfont.Name

temp = StrConv(sFont, vbFromUnicode)
For iChar = 1 To Len(sFont)
.lfFaceName(iChar - 1) = temp(iChar - 1)
Next iChar
.lfItalic = myfont.Italic
.lfWeight = IIf(myfont.Bold, FW_BOLD, FW_NORMAL)
.lfWidth = fontwidth
.lfHeight = fontheight
.lfUnderline = fontunderline
.lfStrikeOut = fontStrikethrough
.lfCharSet = myfont.Charset
End With
hFnt = CreateFontIndirect(tLF)' 转换LOGFONT结构到字体句柄