原文地址:http://shahdza.blog.51cto.com/2410787/1560612
|
1
2
3
4
5
6
7
8
9
10
|
//
static
Label*createWithSystemFont(
const
std::string&text,
//字符串内容
std::string&font,0)!important; background:none!important">//字体(字体名称、或字体文件)
float
fontSize,0)!important; background:none!important">//字号
Size&dimensions=Size::ZERO,0)!important; background:none!important">//label的尺寸大小,默认不设置尺寸
TextHAlignmenthAlignment=TextHAlignment::LEFT,0)!important; background:none!important">//水平对齐方式,默认左对齐::LEFT
TextVAlignmentvAlignment=TextVAlignment::TOP
//垂直对齐方式,默认顶部::TOP
);
//
|
4
//使用系统的字体名称"Arial"来创建
Label*lb1=Label::createWithSystemFont(
"123abc"
,
"Arial"
ottom:auto!important; float:none!important; left:auto!important; line-height:1.1em!important; outline:0px!important; overflow:visible!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; width:auto!important; font-family:Consolas,24);
//