}
// render all runs inside this range
for(int i=startRun;i<=lastRun && i
{
ScriptRun* run=line->scriptRuns[i].Obj();
int start=i==startRun startRunOffset:0;
int end=i==lastRun lastRunOffset:run->length;
int length=end-start;
Color color=run->documentFragment->color;
dc->SetFont(run->documentFragment->fontObject);
dc->SetTextColor(RGB(color.r, color.g, color.b));
dc->DrawBuffer(x+cx, y+cy+(maxHeight-run->documentFragment->size), run->runText+start, length);
cx+=run->SumWidth(start, length);
}
cx=0;
cy+=maxHeight+lineDistance;
}
startRun=lastRun;
startRunOffset=lastRunOffset;
}
}
}
cy+=paragraphDistance;
}
}
else
{
dc->SetFont(messageFont);
WString message=L"Initializing uniscribe data...";
SIZE size=dc->MeasureString(message);
int x=bounds.Left()+(bounds.Width()-size.cx)/2;
int y=bounds.Top()+(bounds.Height()-size.cy)/2;
dc->DrawString(x, y, message);
}
}
public:
TestWindow()
:GuiWindow(GetCurrentTheme()->CreateWindowStyle())
{
SetText(L"GacUISrc Test Application");
SetClientSize(Size(640, 480));
GetBoundsComposition()->SetPreferredMinSize(Size(320, 240));
MoveToScreenCenter();
{
GuiGDIElement* element=GuiGDIElement::Create();
element->Rendering.AttachMethod(this, &TestWindow::element_Rendering);
GuiBoundsComposition* composition=new GuiBoundsComposition;
composition->SetOwnedElement(element);
composition->SetAlignmentToParent(Margin(0, 0, 0, 0));
GetContainerComposition()->AddChild(composition);
messageFont=new WinFont(L"Segoe UI", 56, 0, 0, 0,FW_NORMAL, false, false, false, true);
}
GetApplication()->InvokeAsync([=]()
{
List
BuildDocumentFragments(L"..\\GacUISrcCodepackedTest\\Resources\\document.txt", fragments);
Ptr<ScriptDocument> scriptDocument=BuildScriptParagraphs(fragments);
GetApplication()->InvokeInMainThreadAndWait([=]()
{
document=