[Solved for now] Getting the exact amount of text shown in a richtext editor
Posted: Tuesday 12th July 2022 1:01pm
Hi
I have previously posted about colors and backgrounds of richtext editor content. My goal is to create an IDE for a language I am working on. The IDE will have syntax highlighting in the text edit in the left hand pane, and a autogenerated program flowchart in the right hand side.
Now, I was lookign for efficient syntax highlight algorithms. I found this and this.
I would like to apply syntax highlighting only on the visible part of the text tho. I would like to find out if i can find out the exact amount of the text displayed in a richtextedit. See Image
.
I only want to extract the text that starts at eirmod at the beginning of the visible text block, and ends at Lorem at the end (depending on the scroll bar position). Please note, that there are strokes of a p and a g of the previous line only barely visible at the very top, but I dont want the text of that line.
How can I extract only the visible text block? Thank you.
I have previously posted about colors and backgrounds of richtext editor content. My goal is to create an IDE for a language I am working on. The IDE will have syntax highlighting in the text edit in the left hand pane, and a autogenerated program flowchart in the right hand side.
Now, I was lookign for efficient syntax highlight algorithms. I found this and this.
I would like to apply syntax highlighting only on the visible part of the text tho. I would like to find out if i can find out the exact amount of the text displayed in a richtextedit. See Image
.
I only want to extract the text that starts at eirmod at the beginning of the visible text block, and ends at Lorem at the end (depending on the scroll bar position). Please note, that there are strokes of a p and a g of the previous line only barely visible at the very top, but I dont want the text of that line.
How can I extract only the visible text block? Thank you.