ITextContentService textContentService = textDocument.getTextService().getTextContentService();
ITextDocumentTextShape textDocumentTextShape = null;
try {
textDocumentTextShape = textContentService.constructNewTextShape(textInfo);
textContentService.insertTextContent(textRange, textDocumentTextShape);
insertRenderedRTF(textDocument, textDocumentTextShape, textInfo);
} catch (TextException e) {
textDocumentTextShape = null;
e.printStackTrace();