ok, a lot of text to reply to
First things first. We never spoke about which version of SynEdit you use. SynEdit has undergone major changes since Lazarus 0.9.26; even since 0.9.26.2.
I suggest if you want to work on it to use the latest version from SVN. Which is what I have.
Downloading a nightly snapshot should do. You can have more than one lazarus installation, but must use --primary-config-path="..." to ensure they use different config dirs.
1)
> "Note that a few characters still come out as ?, not sure exactly which ones."
Do you mean SynEdit does not display them correct? I tried the German sharp s, which displays fine in my SynEdit. But it may have had issues in older revisions)
2)
> "I'm still struggling trying to locate "DoubleWidth View" in the SynEdit directory."
<lazdir> \components\synedit\synedittextdoublewidthchars.pas
There are several of those View classes, doing different work preparing the about displaying of the text. The are in something like a linked-list.
You would have to replace this one, by your one.
the function returns an array of how many display cells each char needs for display (some Chinese chars need 2 cells). In this case it does not depend on the font used. so it can be told by simply looking at the unicode.
Each unicode-byte is mapped into this len-string. The display width is always on the 1st byte of a char. Continues bytes of multibyte chars are filled with 0.
eg ä is one char, but 2 bytes => would result in 1,0 in the len-string ( 1 cell, continued byte)
Now if you force lazarus to assume that each cell is one pixel width (by overriding the font detection, well then you can return what you need here.
(Make sure you know what font overhang is, and do not include it)
You can call TextWidth or similar function each time, but it takes a lot of time. Best would be to find a smart way to store char widths.
If you do find a smart way (let say store pages of 128 or 256 chars, in a tree) then you can submit the result, and I look at integrating it into SynEdit for everyone, if you want to contribute)
3)
There is an example called SynPositionHighlighter. I thing this may help.
Otherwhis you can look at the different Markup-Modules, and write your own code as Markup module:
syneditmarkupselection.pp for marking position based
syneditmarkuphighall.pp for all instances of a word.
Note some times coordinates, are screen coords, sometimes bytes in the line.
I don't know all the conditions you need to test for your highligting. So I do not know if this will be out of the box, or how quick it will work... or if SynEdit is the best choice.
***
There is a RichEdit for Lazarus somewhere. You may want to give that a try. it may be easier
***
Good Luck