Skip to content

Commit af26160

Browse files
authored
Merge pull request netease-im#42 from lovesnow/development
XML中的Font节点添加id属性,支持font自定义,同时兼容过去的索引方式
2 parents 414351b + 52242da commit af26160

File tree

20 files changed

+208
-179
lines changed

20 files changed

+208
-179
lines changed

bin/resources/themes/default/cef/cef.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<HBox height="auto">
1515
<Button class="btn_global_blue_80x30" name="btn_back" text="后退" width="60"/>
1616
<Button class="btn_global_blue_80x30" name="btn_forward" text="前进" width="60" margin="5,0,5"/>
17-
<RichEdit class="simple prompt input" name="edit_url" width="stretch" height="28" valign="center" padding="5,5,5,5" font="1" prompttext="请输入网址"/>
17+
<RichEdit class="simple prompt input" name="edit_url" width="stretch" height="28" valign="center" padding="5,5,5,5" prompttext="请输入网址"/>
1818
<Button class="btn_global_blue_80x30" name="btn_navigate" text="转到" width="60" margin="5"/>
1919
<Button class="btn_global_blue_80x30" name="btn_refresh" text="刷新" width="60" margin="5"/>
2020
</HBox>

bin/resources/themes/default/controls/controls.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<Control class="splitline_hor_level1"/>
5656
<!-- RichEdit -->
5757
<RichEdit class="prompt" name="edit" bkcolor="bk_wnd_lightcolor" width="stretch" height="stretch"
58-
font="1" multiline="true" vscrollbar="true" hscrollbar="true" autovscroll="true"
58+
multiline="true" vscrollbar="true" hscrollbar="true" autovscroll="true"
5959
normaltextcolor="darkcolor" wantreturnmsg="true" rich="true"/>
6060
</VBox>
6161
</VBox>

bin/resources/themes/default/global.xml

+71-71
Large diffs are not rendered by default.

bin/resources/themes/default/layouts/login.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@
1414
</HBox>
1515
<HBox height="auto">
1616
<Control />
17-
<Button name="register_account" margin="0,5,15,10" halign="right" text="注册" cursortype="hand" font="24" normaltextcolor="link_green"/>
18-
<Button name="enter_login" margin="0,5,15,10" halign="right" text="直接登录" cursortype="hand" font="24" normaltextcolor="link_green" visible="false"/>
17+
<Button name="register_account" margin="0,5,15,10" halign="right" text="注册" cursortype="hand" font="system_underline_12" normaltextcolor="link_green"/>
18+
<Button name="enter_login" margin="0,5,15,10" halign="right" text="直接登录" cursortype="hand" font="system_underline_12" normaltextcolor="link_green" visible="false"/>
1919
</HBox>
2020
<!--帐号和密码-->
2121
<VBox name="enter_panel" width="240" height="auto" margin="20,0,20,0" bkimage="user_password.png">
2222
<HBox height="41" padding="14,1,10,0">
2323
<Control name="usericon" width="16" height="16" valign="center" normalimage="user_1.png" disabledimage="user_2.png"/>
24-
<RichEdit class="simple prompt" name="username" width="stretch" height="auto" margin="10,0,10,0" valign="center" font="2" prompttext="帐号"/>
24+
<RichEdit class="simple prompt" name="username" width="stretch" height="auto" margin="10,0,10,0" valign="center" font="system_14" prompttext="帐号"/>
2525
</HBox>
2626
<HBox name="nick_name_panel" height="40" padding="14,1,0,0" visible="false" margin="0,0,0,0">
2727
<Control name="nick_name_icon" width="16" height="16" valign="center" normalimage="nickname.png" disabledimage="nickname.png"/>
28-
<RichEdit class="simple prompt" name="nickname" width="stretch" height="auto" margin="10,0,10,0" valign="center" font="2" prompttext="昵称"/>
28+
<RichEdit class="simple prompt" name="nickname" width="stretch" height="auto" margin="10,0,10,0" valign="center" font="system_14" prompttext="昵称"/>
2929
</HBox>
3030
<HBox height="41" padding="14,0,10,1" margin="0,2,0,0">
3131
<Control name="passwordicon" width="16" height="16" valign="center" normalimage="password_1.png" disabledimage="password_2.png"/>
32-
<RichEdit class="simple prompt" name="password" width="stretch" height="auto" margin="10,0,10,0" valign="center" font="2" password="true" prompttext="密码"/>
32+
<RichEdit class="simple prompt" name="password" width="stretch" height="auto" margin="10,0,10,0" valign="center" font="system_14" password="true" prompttext="密码"/>
3333
</HBox>
3434
</VBox>
3535
</VBox>
3636
<!--登录提示-->
37-
<Label name="login_ing_tip" margin="20,20,20,0" font="1" text="正在登录..." visible="false"/>
38-
<Label name="login_error_tip" margin="20,20,20,0" font="1" normaltextcolor="obvious_tip" visible="false"/>
37+
<Label name="login_ing_tip" margin="20,20,20,0" font="system_12" text="正在登录..." visible="false"/>
38+
<Label name="login_error_tip" margin="20,20,20,0" font="system_12" normaltextcolor="obvious_tip" visible="false"/>
3939
<!--登录和取消按钮-->
4040
<Box width="240" height="40" margin="20,20,20,20">
41-
<Button class="btn_global_blue_80x30" name="btn_login" width="240" height="40" font="8" text="登录"/>
42-
<Button class="btn_global_blue_80x30" name="btn_register" width="240" height="40" font="8" text="注册" visible="false"/>
43-
<Button class="btn_global_red_80x30" name="btn_cancel" width="240" height="40" font="8" text="取消登录" visible="false"/>
41+
<Button class="btn_global_blue_80x30" name="btn_login" width="240" height="40" font="system_bold_16" text="登录"/>
42+
<Button class="btn_global_blue_80x30" name="btn_register" width="240" height="40" font="system_bold_16" text="注册" visible="false"/>
43+
<Button class="btn_global_red_80x30" name="btn_cancel" width="240" height="40" font="system_bold_16" text="取消登录" visible="false"/>
4444
</Box>
4545
</VBox>
4646
</Box>

bin/resources/themes/default/layouts/wechat.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- 好友列表 -->
99
<VBox width="270" bkcolor="light_gray">
1010
<Box padding="10,8,10,8" height="auto">
11-
<RichEdit class="simple prompt input" name="nickname" width="stretch" height="35" padding="25,8,8,8" font="1" borderround="5,5" prompttext="搜索"/>
11+
<RichEdit class="simple prompt input" name="nickname" width="stretch" height="35" padding="25,8,8,8" borderround="5,5" prompttext="搜索"/>
1212
<Control width="auto" height="auto" margin="6,9" bkimage="search_icon.png"/>
1313
</Box>
1414
<VBox>

bin/resources/themes/default/msgbox/msgbox.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Button class="btn_wnd_close" name="closebtn" margin="10,6,0,0"/>
77
</HBox>
88

9-
<RichEdit name="content" width="300" margin="20,30,20,30" font="3" multiline="true" vscrollbar="false" autovscroll="false" enabled="false" rich="true"/>
9+
<RichEdit name="content" width="300" margin="20,30,20,30" font="system_16" multiline="true" vscrollbar="false" autovscroll="false" enabled="false" rich="true"/>
1010

1111
<HBox height="auto" margin="0,0,20,20" childmargin="10">
1212
<Control />

bin/resources/themes/default/multi_browser/multi_browser.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
</HBox>
1111

1212
<HBox height="30" margin="10,2,10,2" childmargin="3">
13-
<Button class="btn_global_blue_80x30" name="btn_back" width="50" height="30" textid="STRID_CEF_BROWSER_BACKWARD" valign="center" font="1" />
14-
<Button class="btn_global_blue_80x30" name="btn_forward" width="50" height="30" textid="STRID_CEF_BROWSER_FORWARD" valign="center" font="1" />
15-
<Button class="btn_global_blue_80x30" name="btn_refresh" width="50" height="30" textid="STRID_CEF_BROWSER_REFRESH" valign="center" font="1" />
13+
<Button class="btn_global_blue_80x30" name="btn_back" width="50" height="30" textid="STRID_CEF_BROWSER_BACKWARD" valign="center" font="system_12" />
14+
<Button class="btn_global_blue_80x30" name="btn_forward" width="50" height="30" textid="STRID_CEF_BROWSER_FORWARD" valign="center" font="system_12" />
15+
<Button class="btn_global_blue_80x30" name="btn_refresh" width="50" height="30" textid="STRID_CEF_BROWSER_REFRESH" valign="center" font="system_12" />
1616
<RichEdit class="simple prompt" name="edit_url" width="400" height="30" padding="5,2,5,0" valign="center"
17-
bordercolor="gray" bordersize="1" font="2" prompttextid="STRID_CEF_BROWSER_INPUT_ADDRESS" vscrollbar="false" autovscroll="false" hscrollbar="false" autohscroll="true" wantreturnmsg="true" />
17+
bordercolor="gray" bordersize="1" font="system_14" prompttextid="STRID_CEF_BROWSER_INPUT_ADDRESS" vscrollbar="false" autovscroll="false" hscrollbar="false" autohscroll="true" wantreturnmsg="true" />
1818
<!-- 顶部标签列表 -->
1919
<HListBox class="list" name="tab_list" >
20-
<Button class="btn_global_blue_80x30" name="btn_add" text="+" width="20" height="20" valign="center" font="3" />
20+
<Button class="btn_global_blue_80x30" name="btn_add" text="+" width="20" height="20" valign="center" font="system_16" />
2121
</HListBox>
2222
</HBox>
2323
<Control class="splitline_hor_level1" margin="0,0,0,0" />

bin/resources/themes/default/multi_browser/tab_item.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Control name="tab_item_icon" width="38" height="38" borderround="38,38,38,38" margin="1,1,0,0"/>
77
<Control class="icon_headimage_mask_40x40"/>
88
</Box>
9-
<Label name="tab_item_name" width="stretch" valign="center" font="1" mouse="false"/>
9+
<Label name="tab_item_name" width="stretch" valign="center" font="system_12" mouse="false"/>
1010

1111
<Box width="auto" height="auto" float="true" halign="right" valign="center">
1212
<Button class="btn_del_search" name="tab_item_close" width="16" height="16" halign="center" valign="center" visible="false"/>

bin/resources/themes/default/richlist/richlist.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Window size="400,600" caption="0,0,0,35">
33
<VBox bkcolor="bk_wnd_darkcolor">
44
<HBox width="stretch" height="35" bkcolor="bk_wnd_lightcolor">
5-
<Label text="自定义列表示例" font="2" valign="center" margin="8"/>
5+
<Label text="自定义列表示例" font="system_14" valign="center" margin="8"/>
66
<Control />
77
<Button class="btn_wnd_min" name="minbtn" margin="4,6,0,0"/>
88
<Box width="21" margin="4,6,0,0">
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Window size="340,180" caption="0,0,0,600" shadowattached="false" custom_shadow="10,10,10,10">
33
<Box width="340" height="auto" bkimage="file='win_bg.png' corner='15,15,15,15'">
4-
<RichEdit name="content" width="300" minheight="30" margin="20,20,20,20" font="2" multiline="true" vscrollbar="false" autovscroll="false" enabled="false" rich="false" mouse="false" disabledtextcolor="light_gray"/>
4+
<RichEdit name="content" width="300" minheight="30" margin="20,20,20,20" font="system_14" multiline="true" vscrollbar="false" autovscroll="false" enabled="false" rich="false" mouse="false" disabledtextcolor="light_gray"/>
55
<Button name="close_btn" width="25" height="24" valign="top" halign="right" visible="false" normalimage="file='close.png' source='0,0,24,24'" hotimage="file='close.png' source='25,0,49,24'" pushedimage="file='close.png' source='50,0,74,24'" disabledimage="file='close.png' source='75,0,99,24'"/>
66
</Box>
77
</Window>

tool_kits/duilib/Control/CheckBox.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void CheckBoxTemplate<InheritType>::PaintText(IRenderContext* pRender)
225225
std::wstring newTextColor = m_dwSelectedTextColor.empty() ? this->m_textColorMap[kControlStateNormal] : m_dwSelectedTextColor;
226226
DWORD dwTextColor = GlobalManager::GetTextColor(newTextColor);
227227
DWORD dwDisabledTextColor = GlobalManager::GetTextColor(this->m_textColorMap[kControlStateDisabled]);
228-
pRender->DrawText(rc, this->GetText(), this->IsEnabled() ? dwTextColor : dwDisabledTextColor, this->m_iFont, this->m_uTextStyle);
228+
pRender->DrawText(rc, this->GetText(), this->IsEnabled() ? dwTextColor : dwDisabledTextColor, this->m_sFontId, this->m_uTextStyle);
229229
}
230230

231231
template<typename InheritType>

tool_kits/duilib/Control/Label.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ class UILIB_API LabelTemplate : public InheritType
5656
* @brief 获取当前字体编号
5757
* @return 返回字体编号,该编号在 global.xml 中标识
5858
*/
59-
int GetFont() const;
59+
std::wstring GetFont() const;
6060

6161
/**
6262
* @brief 设置当前字体
6363
* @param[in] index 要设置的字体编号,该编号必须在 global.xml 中存在
6464
* @return 无
6565
*/
66-
void SetFont(int index);
66+
void SetFont(const std::wstring& strFontId);
6767

6868
/**
6969
* @brief 获取文字边距
@@ -105,7 +105,7 @@ class UILIB_API LabelTemplate : public InheritType
105105
void SetLineLimit(bool bLineLimit);
106106

107107
protected:
108-
int m_iFont;
108+
std::wstring m_sFontId;
109109
UINT m_uTextStyle;
110110
bool m_bSingleLine;
111111
bool m_bLineLimit;
@@ -119,7 +119,7 @@ class UILIB_API LabelTemplate : public InheritType
119119

120120
template<typename InheritType>
121121
LabelTemplate<InheritType>::LabelTemplate() :
122-
m_iFont(1),
122+
m_sFontId(),
123123
m_uTextStyle(DT_LEFT | DT_TOP | DT_END_ELLIPSIS | DT_NOCLIP | DT_SINGLELINE),
124124
m_bSingleLine(true),
125125
m_bLineLimit(false),
@@ -226,7 +226,7 @@ CSize LabelTemplate<InheritType>::EstimateText(CSize szAvailable, bool& bReEstim
226226
CSize fixedSize;
227227
if (!GetText().empty()) {
228228
auto pRender = this->m_pWindow->GetRenderContext();
229-
UiRect rect = pRender->MeasureText(GetText(), m_iFont, m_uTextStyle, width);
229+
UiRect rect = pRender->MeasureText(GetText(), m_sFontId, m_uTextStyle, width);
230230
if (this->GetFixedWidth() == DUI_LENGTH_AUTO) {
231231
fixedSize.cx = rect.right - rect.left + m_rcTextPadding.left + m_rcTextPadding.right;
232232
}
@@ -239,7 +239,7 @@ CSize LabelTemplate<InheritType>::EstimateText(CSize szAvailable, bool& bReEstim
239239
int maxWidth = szAvailable.cx - m_rcTextPadding.left - m_rcTextPadding.right;
240240
if (estimateWidth > maxWidth) {
241241
estimateWidth = maxWidth;
242-
UiRect newRect = pRender->MeasureText(GetText(), m_iFont, m_uTextStyle, estimateWidth);
242+
UiRect newRect = pRender->MeasureText(GetText(), m_sFontId, m_uTextStyle, estimateWidth);
243243
estimateHeight = newRect.bottom - newRect.top;
244244
}
245245
}
@@ -288,7 +288,7 @@ void LabelTemplate<InheritType>::SetAttribute(const std::wstring& strName, const
288288
else if (strName == _T("singleline")) SetSingleLine(strValue == _T("true"));
289289
else if (strName == _T("text")) SetText(strValue);
290290
else if (strName == _T("textid")) SetTextId(strValue);
291-
else if (strName == _T("font")) SetFont(_ttoi(strValue.c_str()));
291+
else if (strName == _T("font")) SetFont(strValue);
292292
else if (strName == _T("normaltextcolor")) SetStateTextColor(kControlStateNormal, strValue);
293293
else if (strName == _T("hottextcolor")) SetStateTextColor(kControlStateHot, strValue);
294294
else if (strName == _T("pushedtextcolor")) SetStateTextColor(kControlStatePushed, strValue);
@@ -339,22 +339,22 @@ void LabelTemplate<InheritType>::PaintText(IRenderContext* pRender)
339339
std::wstring clrColor = GetStateTextColor(kControlStateNormal);
340340
if (!clrColor.empty()) {
341341
DWORD dwClrColor = GlobalManager::GetTextColor(clrColor);
342-
pRender->DrawText(rc, GetText(), dwClrColor, m_iFont, m_uTextStyle, 255, m_bLineLimit);
342+
pRender->DrawText(rc, GetText(), dwClrColor, m_sFontId, m_uTextStyle, 255, m_bLineLimit);
343343
}
344344

345345
if (this->m_nHotAlpha > 0) {
346346
std::wstring clrColor = GetStateTextColor(kControlStateHot);
347347
if (!clrColor.empty()) {
348348
DWORD dwClrColor = GlobalManager::GetTextColor(clrColor);
349-
pRender->DrawText(rc, GetText(), dwClrColor, m_iFont, m_uTextStyle, (BYTE)this->m_nHotAlpha, m_bLineLimit);
349+
pRender->DrawText(rc, GetText(), dwClrColor, m_sFontId, m_uTextStyle, (BYTE)this->m_nHotAlpha, m_bLineLimit);
350350
}
351351
}
352352

353353
return;
354354
}
355355
}
356356

357-
pRender->DrawText(rc, GetText(), dwClrColor, m_iFont, m_uTextStyle, 255, m_bLineLimit);
357+
pRender->DrawText(rc, GetText(), dwClrColor, m_sFontId, m_uTextStyle, 255, m_bLineLimit);
358358
}
359359

360360
template<typename InheritType>
@@ -387,15 +387,15 @@ void LabelTemplate<InheritType>::SetStateTextColor(ControlStateType stateType, c
387387
}
388388

389389
template<typename InheritType>
390-
int LabelTemplate<InheritType>::GetFont() const
390+
std::wstring LabelTemplate<InheritType>::GetFont() const
391391
{
392-
return m_iFont;
392+
return m_sFontId;
393393
}
394394

395395
template<typename InheritType>
396-
void LabelTemplate<InheritType>::SetFont(int index)
396+
void LabelTemplate<InheritType>::SetFont(const std::wstring& strFontId)
397397
{
398-
m_iFont = index;
398+
m_sFontId = strFontId;
399399
this->Invalidate();
400400
}
401401

tool_kits/duilib/Control/RichEdit.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ RichEdit::RichEdit() :
11721172
m_iCaretPosY(0),
11731173
m_iCaretWidth(0),
11741174
m_iCaretHeight(0),
1175-
m_iFont(0),
1175+
m_sFontId(),
11761176
m_iLimitText(0),
11771177
m_lTwhStyle(ES_MULTILINE),
11781178
m_textVerAlignType(kVerAlignTop),
@@ -1274,16 +1274,16 @@ void RichEdit::SetWordWrap(bool bWordWrap)
12741274
if( m_pTwh ) m_pTwh->SetWordWrap(bWordWrap);
12751275
}
12761276

1277-
int RichEdit::GetFont()
1277+
std::wstring RichEdit::GetFont() const
12781278
{
1279-
return m_iFont;
1279+
return m_sFontId;
12801280
}
12811281

1282-
void RichEdit::SetFont(int index)
1282+
void RichEdit::SetFont(const std::wstring& strFontId)
12831283
{
1284-
m_iFont = index;
1284+
m_sFontId = strFontId;
12851285
if( m_pTwh ) {
1286-
m_pTwh->SetFont(GlobalManager::GetFont(m_iFont));
1286+
m_pTwh->SetFont(GlobalManager::GetFont(m_sFontId));
12871287
}
12881288
}
12891289

@@ -2745,7 +2745,7 @@ void RichEdit::SetAttribute(const std::wstring& strName, const std::wstring& str
27452745
else if (strName == _T("prompttext")) SetPromptText(strValue);
27462746
else if (strName == _T("prompttextid")) SetPromptTextId(strValue);
27472747
else if (strName == _T("focusedimage")) SetFocusedImage(strValue);
2748-
else if (strName == _T("font")) SetFont(_ttoi(strValue.c_str()));
2748+
else if (strName == _T("font")) SetFont(strValue);
27492749
else if (strName == _T("text")) SetText(strValue.c_str());
27502750
else if (strName == _T("textid")) SetTextId(strValue.c_str());
27512751
else if (strName == _T("wanttab")) SetWantTab(strValue == _T("true"));
@@ -2899,7 +2899,7 @@ void RichEdit::PaintPromptText(IRenderContext* pRender)
28992899

29002900
DWORD dwClrColor = GlobalManager::GetTextColor(m_sPromptColor);
29012901
UINT dwStyle = DT_NOCLIP;
2902-
pRender->DrawText(rc, strPrompt, dwClrColor, m_iFont, dwStyle);
2902+
pRender->DrawText(rc, strPrompt, dwClrColor, m_sFontId, dwStyle);
29032903
}
29042904

29052905
std::wstring RichEdit::GetFocusedImage()
@@ -2995,23 +2995,23 @@ void RichEdit::AddLinkColorText(const std::wstring &str, const std::wstring &col
29952995
GetDefaultCharFormat(cf);
29962996
SetSelectionCharFormat(cf);
29972997
}
2998-
void RichEdit::AddLinkColorTextEx(const std::wstring& str, const std::wstring &color, const std::wstring &linkInfo, int font)
2998+
void RichEdit::AddLinkColorTextEx(const std::wstring& str, const std::wstring &color, const std::wstring &linkInfo, const std::wstring& strFontId)
29992999
{
30003000
if (!m_bRich || str.empty() || color.empty()) {
30013001
ASSERT(FALSE);
30023002
return;
30033003
}
3004-
int ifont = font >= 0 ? font : m_iFont;
3004+
30053005
std::string link;
30063006
std::string text;
30073007
std::string font_face;
30083008
StringHelper::UnicodeToMBCS(linkInfo, link);
30093009
StringHelper::UnicodeToMBCS(str, text);
3010-
auto hFont = GlobalManager::GetFont(ifont);
3010+
auto hFont = GlobalManager::GetFont(strFontId);
30113011
if (hFont == NULL)
3012-
hFont = GlobalManager::GetFont(m_iFont);
3012+
hFont = GlobalManager::GetFont(m_sFontId);
30133013
if (hFont == NULL)
3014-
hFont = GlobalManager::GetFont(0);
3014+
hFont = GlobalManager::GetFont(L"");
30153015
LOGFONT lf;
30163016
::GetObject(hFont, sizeof(LOGFONT), &lf);
30173017
StringHelper::UnicodeToMBCS(lf.lfFaceName, font_face);

tool_kits/duilib/Control/RichEdit.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ class UILIB_API RichEdit : public ScrollableBox
118118
* @brief 获取当前设置的字体索引
119119
* @return 返回字体索引(对应 global.xml 中字体的顺序)
120120
*/
121-
int GetFont();
121+
std::wstring GetFont() const;
122122

123123
/**
124124
* @brief 设置字体索引
125125
* @param[in] index 要设置的字体索引(对应 global.xml 中字体的顺序)
126126
* @return 无
127127
*/
128-
void SetFont(int index);
128+
void SetFont(const std::wstring& strFontId);
129129
void SetFont(HFONT font);
130130
/**
131131
* @brief 根据字体名称设置字体
@@ -875,7 +875,7 @@ class UILIB_API RichEdit : public ScrollableBox
875875
* @param[in] font 字体索引
876876
* @return 无
877877
*/
878-
void AddLinkColorTextEx(const std::wstring& str, const std::wstring &color, const std::wstring &linkInfo = L"", int font = -1);
878+
void AddLinkColorTextEx(const std::wstring& str, const std::wstring &color, const std::wstring &linkInfo = L"", const std::wstring& strFontId = L"");
879879

880880
/**
881881
* @brief 添加一个范围用于 hittest 判断是否是链接信息
@@ -956,7 +956,7 @@ class UILIB_API RichEdit : public ScrollableBox
956956
int m_iCaretPosY;
957957
int m_iCaretWidth;
958958
int m_iCaretHeight;
959-
int m_iFont;
959+
std::wstring m_sFontId;
960960
int m_iLimitText;
961961
LONG m_lTwhStyle;
962962
VerAlignType m_textVerAlignType;

0 commit comments

Comments
 (0)