CString CMarkupBuilder::TextBuilder(IN CString text,CString MarkTag,CString font
,COLORREF textColor ,COLORREF backGround , COLORREF panelColor ,CString vertical ,CString horizontal,CRect& textmargin)
{
wstringstream textheader;
text.Replace(L"<",L" <");
text.Replace(L">",L" >");
if(MarkTag.IsEmpty())
MarkTag = text;
textheader<<L"<TextBlock Tag='"<<MarkTag.GetBuffer() <<"' " <<"FontWeight='"<<font.GetBuffer()<<"' ";
if(backGround != RGB(255,255,255)) textheader<<"Background='"<<colorrefToHexString(backGround).GetBuffer()<<"' ";
if(textColor != RGB(255,255,255) ) textheader<<"Foreground='"<<colorrefToHexString(textColor).GetBuffer()<<"' ";
textheader<<"VerticalAlignment='"<<vertical.GetBuffer()<<"' "<<"HorizontalAlignment='"<<horizontal.GetBuffer()<<"' ";
textheader<<"Margin= '"<<textmargin.left<<","<<textmargin.top<<","<<textmargin.right<<","<<textmargin.bottom<<"'";
//textheader<<"FontSize='"<<FontSize<<"' ";
textheader<<">";
wstring wtextheader(textheader.str());
wstringstream borderheader;
borderheader<<L"<Border";;
if(panelColor != RGB(255,255,255)) borderheader<<" Background='"<<colorrefToHexString(panelColor).GetBuffer()<<"' ";
borderheader<<">";
wstring wborder(borderheader.str());
TCHAR * tMark =
_T("<StackPanel>")
_T("%s") //border
_T("%s") //textheader
_T("%s") //text
_T("</TextBlock>")
_T("</Border>")
_T("</StackPanel>");
CString strMark;
strMark.Format(tMark,wborder.c_str(),wtextheader.c_str(),text);
return strMark;
}
TextBuilder인자중 Font에 Bold라는 속성을 넣으면 잘 적용되는데
italic 속성도 같이 주고 싶거든요? 여기서 추가로 넣을 수 있는 방법이 있을까요?