Skip to content

How to add text content to a view using a decorator? #7151

Answered by pmconne
MYDJH asked this question in Q&A
Discussion options

You must be logged in to vote

TextString represents text in a geometry stream. Doing anything useful with the text requires access to C and C++ libraries like freetype, which are not accessible from the front-end.

Browsers are really, really good at rendering text. You can use canvas decorations or HTML decorations to get the browser to efficiently render text into your Viewport.

If you really, truly need to render a TextString because the above options do not meet your requirements, and you have access to an iModel on the backend containing the required fonts, you can produce graphics from it using requestElementGraphics.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@MYDJH
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MYDJH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants