DuiLib(9)——关于字体、html及默认属性

来源:互联网 发布:人人贷网络借贷平台 编辑:程序博客网 时间:2024/06/05 09:10

一、字体

<Font shared="true" id="0" name="幼圆" size="12" default="true" /><Font shared="true" id="1" name="微软雅黑" size="18" />

字体属性有:

  • name:字体名称
  • size:字体大小
  • bold:粗体
  • italic:斜体
  • underline:下划线
  • id:字体的编号
  • shared:是否共享
<Font shared="true" id="1" name="微软雅黑" size="18" bold="false" italic="false" />

二、HTML格式文本

使用标签功能需要把控件的showhtml属性设置为true
b:表示字体是否使用粗体
c:表示字体使用的颜色
f:表示使用全局字体的序号,从0开始;
i:是否使用 斜体或图表路径;
a:超链接功能;
n:表示换行;
p:表示一段落;
r:表示包含内容不适用标签语法功能;
s:表示内容被选中;
u:表示内容使用下划线
x:表示从该处移动x个像素值;
y:表示该行固定位y个像素值;

例子如下:
    <b>text</b> 表示text的内容使用粗体
      <c #xxxxxx>text</c> 表示text内容使用#xxxxxx颜色,#xxxxxx表示16进制的RGB值
     <f x>text</f>表示text内容使用x序号的字体
     <i>text</i> 表示text内容使用斜体
      <i x y z>表示此次插入图片,x表示图片名称,y表示此图片包含几张字图片(可不填,默认值1),z表示当前使用的字图片id(可不填,默认值0)
     <a x>text</a> 表示text内容有链接功能,x表示链接地址(可不填),用法如app:notepad or http:www.xxx.com,此字符串需要在用户程序中解析处理。
     <n> 表示此次换行
      <p x>text</p> 表示text内容是一个段落(从这里开始换行),x表示此段落文字水平距离(可不填)
     <r>text</r>表示text内容不使用语法标签功能
     <s>text</s> 表示text内容被选中(显示选中的背景颜色)
      <u>text</u> 表示text内容使用下划线
     <x i> 表示从此处向后面移动x个像素值
     <y i> 表示该行高度固定为y个像素值

三、默认属性

<Default shared="true" name="Slider" value="thumbsize="10,10" bkimage="file='bg.bmp' corner='6,0,6,0' mask='#FFFF00FF'" foreimage="file='fg.bmp' corner='6,0,6,0' mask='#FFFF00FF'" thumbimage="file='thumb.bmp' source='30,0,40,10' mask='#FFDAEBF9'" thumbhotimage="file='thumb.bmp' source='10,0,20,10' mask='#FFDAEBF9'" " /><Default shared="true" name="Button" value="textcolor="#000000" hottextcolor="#FFFFFF" focusedtextcolor="#000000" pushedtextcolor="#77a8de" normalimage="file='Button/btn.png' corner='5,11,5,11' source='0,0,96,24'" hotimage="file='Button/btn.png' corner='5,11,5,11' source='0,24,96,48'" pushedimage="file='Button/btn.png' corner='5,11,5,11' source='0,48,96,72'" disabledimage="file='Button/btn.png' corner='5,11,5,11' source='0,72,96,96'"" /><Default shared="true" name="Option" value="textcolor="#FFbac0c5" hottextcolor="#FF386382" selectedtextcolor="#FF386382" disabledtextcolor="#FFbac0c5" textpadding="18,2,0,0" align="left" selectedimage="file='Button/RadioBtnSel.png' source='0,0,13,13' dest='0,5,14,19'" normalimage="file='Button/RadioBtnNon.png' source='0,0,13,13' dest='0,5,14,19'"" /><Default shared="true" name="CheckBox" value="textcolor="#FFbac0c5" hottextcolor="#FF386382" selectedtextcolor="#FF386382" disabledtextcolor="#FFbac0c5" textpadding="20,2,0,0" align="left" selectedimage="file='Icon/checked.png' dest='0,2,16,18'" normalimage="file='Icon/unchecked.png' dest='0,2,16,18'"" /><Slider name="alpha_controlor" min="20" max="255" value="255"/><Button name="changeskinbtn" height="20" text="换肤" maxwidth="120" /><CheckBox name="CheckBox1" width="20" height="20" bkcolor="#FFEA679F" />



0 0