如何取得当前系统字体大小(大字体?小字体?其他?)

swander 2001-07-26 09:47:35
...全文
69 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
killerdanny 2001-07-26
  • 打赏
  • 举报
回复
//====================================================================
// 函数[Function]:- fontdialog for nvo_winapi
//--------------------------------------------------------------------
// 描述[Description]:
//--------------------------------------------------------------------
// 参数[Arguments]:
//
// 参数(1): string ffacename
// <description>
// 参数(2): integer fontsize
// <description>
// 参数(3): boolean bbold
// <description>
// 参数(4): boolean bitalic
// <description>
// 参数(5): boolean bstrikeout
// <description>
// 参数(6): boolean bunderline
// <description>
// 参数(7): long fontcolor
// <description>
//--------------------------------------------------------------------
// 返回值[Returns]: (BOOLEAN)
//--------------------------------------------------------------------
// 作者[Author]: DANNY 日期[Date]: 2000年03月31日
//====================================================================


long Flags = 0 // Dialog Flags
long hWndParent = 0 // Parent Window
integer FontType = 0
integer SizeMin = 0
integer SizeMax = 0
string FaceName = ""
long Height = 0
long Weight = 0
boolean Italic = False
boolean Underline = False
boolean StrikeOut = False
CHOOSEFONT ChooseFont
LOGFONT LogFont
boolean lb_Result

If Flags = 0 Then Flags = BitOr({CF_FORCEFONTEXIST,CF_BOTH,CF_EFFECTS,CF_INITTOLOGFONTSTRUCT})

LogFont.lffacename = ffacename
//LogFont.lfHeight = Height
LogFont.lfHeight = ffontsize
if fbBold then
weight=700;
else
weight=300;
end if
LogFont.lfWeight = Weight
If fbItalic Then LogFont.lfItalic = Char(255) Else LogFont.lfItalic = Char(0)
If bUnderline Then LogFont.lfUnderline = Char(1) Else LogFont.lfUnderline = Char(0)
If bStrikeOut Then LogFont.lfStrikeOut = Char(1) Else LogFont.lfStrikeOut = Char(0)

ChooseFont.lStructSize = 60
ChooseFont.hWndOwner = hWndParent
ChooseFont.hDC = 0
ChooseFont.lpLogFont = LocalAlloc(0,60)
PutLogFont(ChooseFont.lpLogFont,LogFont,60)
ChooseFont.iPointSize = 0
ChooseFont.Flags = Flags
//ChooseFont.RGBColors = RGBColors
ChooseFont.RGBColors = fontColor
ChooseFont.lCustData = 0
ChooseFont.lpfnHook = 0
ChooseFont.lpTemplateName = 0
ChooseFont.hInstance = 0
ChooseFont.lpszStyle = 0
ChooseFont.nFontType = FontType
ChooseFont.nSizeMin = SizeMin
ChooseFont.nSizeMax = SizeMax

If ChooseFontA(ChooseFont) = 1 Then
GetLogFont(LogFont,ChooseFont.lpLogFont,60)

FontType = ChooseFont.nFontType
ffacename = LogFont.lffacename
Height = LogFont.lfHeight
Weight = LogFont.lfWeight
Italic = (Asc(LogFont.lfItalic) = 255)
Underline= (Asc(LogFont.lfUnderline) = 1)
StrikeOut= (Asc(LogFont.lfStrikeOut) = 1)
lb_Result = True
///
fbItalic = italic;
bUnderline = Underline;
bStrikeout = Strikeout;
ffacename = ffacename;
fontcolor = ChooseFont.rgbColors;
if Weight>=700 then
fbBold =true;
else
fbBold = false;
end if
ffontsize = Height;
Else
FontType = 0
ffacename = ""
Height = 0
Weight = 0
Italic = False
Underline= False
StrikeOut= False
lb_Result = False
End If

LocalFree(ChooseFont.lpLogFont)

Return(lb_Result)
swander 2001-07-26
  • 打赏
  • 举报
回复
as title

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧