1、long WindowFont(BSTR Name, BSTR FontId, BSTR FontName, double Size, BOOL Bold, BOOL Italic, BOOL Underline, BOOL Strikeout, short Charset, short PitchAndFamily)
Name - 窗口的名字.
FontId -给加载的字体取得名字
FontName 要加载的字体
Size 字体大小
Bold - true if you want 粗体
Italic - true if you want 斜体
Underline - true if you want 下划线
Strikeout - true if you want 删除线
Charset
Value Purpose Lua symbol
0 ANSI miniwin.font_charset_ansi
1 Default miniwin.font_charset_default
2 Symbol miniwin.font_charset_symbol
字体大小之后的参数如果不用可以省略
2、VARIANT WindowFontList(BSTR Name) 列出字体列表,返回的是一个table
3、VARIANT WindowFontInfo(BSTR Name, BSTR FontId, long InfoType)
Name - the name of an existing miniwindow
FontId - the font id you used when you loaded the font
InfoType - the information you want: 有具体的参数可以去网上查,下面是大概会用的
1: Height - Specifies the height (ascent + descent) of characters.
2: Ascent - Specifies the ascent (units above the base line) of characters
3: Descent - Specifies the descent (units below the base line) of characters.
4: Internal Leading - Specifies the amount of leading (space) inside the bounds set by the height. Accent marks and other diacritical characters may occur in this area. The designer may set this to zero.
5: External Leading - Specifies the amount of extra leading (space) that the application adds between rows. Since this area is outside the font, it contains no marks and is not altered by text output calls. The designer may set this member to zero.
21: Name - Specifies the name of the font
4、long WindowTextWidth(BSTR Name, BSTR FontId, BSTR Text, BOOL Unicode) 取绘画字符串宽度
Name - 窗口的名字.
FontId -给加载的字体取得名字
Text 要输出的字串
Unicode - if true, the text is Unicode text in UTF-8 format
5、long WindowText(BSTR Name, BSTR FontId, BSTR Text, long Left, long Top, long Right, long Bottom, long Colour, BOOL Unicode)
Name - 窗口的名字.
FontId -给加载的字体取得名字
Text 要输出的字串
此函数的位置坐标是从左上角开始算的向右、下方向增长,如果右、下两个参数设为0,0则不会考虑右下坐标是否越界的问题,否则将严格计算,超出的部分不会显示
6、long ColourNameToRGB(BSTR Name)
颜色参数
- black(黑色) = 1
- red(红色) = 2
- green(绿色) = 3
- yellow(黄色) = 4
- blue(蓝色) = 5
- magenta(洋红色) = 6
- cyan(青色) = 7
- white(白色) = 8
示例代码:
win="Hello"..GetPluginID ()
WindowCreate(win,0,0,200,200,miniwin.pos_top_right,0,ColourNameToRGB("black"))
WindowShow(win,true)
WindowFont(win,"g_font1","宋体",12)
str="你们好!"
WindowTextWidth(win,"g_font1",str)
WindowText(win,"g_font1",str,0,0,0,0,ColourNameToRGB("blue"))