Please help with adding some text into run with substring numbers (chemical formula) How to do this?
1 Answer, 1 is accepted
0
Yoan
Telerik team
answered on 18 Dec 2023, 10:04 AM
Hello Ivan,
From what I understand you would like to insert subscript (or superscript) numbers in text content. That can be achieved through the BaselineAlignment property of a Run.
However, the normal and subscript parts of the text must be separate runs, so that they each have different formatting.
Example:
paragraph.Inlines.AddRun("normal text");
var subscriptText = paragraph.Inlines.AddRun("1");
subscriptText.BaselineAlignment = BaselineAlignment.Subscript;