CEP extension to access text hyphenation and spelling features
I wanted to add hyphenation and spelling for specific language, I wonder if there is an option to achieve this using CEP. I mean the built-in hyphenation and spelling functionalities that InDesign has.
I've conducted some research and read some articles about this topic and found out that language specific hyphenation and spelling can be added to InDesign with dictionary files like "en_US.dic" and "hyph_en_US.dic". I assume these are developed with hunspell/aspell programs and no CEP extensions are needed for them to run.
But as I know, this approach is static, by static I mean, once user downloads these files, he/she can use and distribute them freely. But in my case, I want them to be expired after some time and become no longer usable, until new package is downloaded.
So I was thinking of making these as a third-party service where service launches locally at some port, and extension interacts with it via http protocol, providing dictionary and hyphenation dynamically to InDesign.
So I was interested if CEP has access to these built-in hyphenation and spelling features.
Another approach would be "DIY" approach where I create a "spellcheck" and "hyphenate" buttons in the extension window and process text inside TextFrames when buttons are clicked. But this approach comes with many difficulties:
Hyphenation:
I need to be calculating TextFrame dimensions, word positions inside TextFrame and deciding which words to hyphenate.
Spelling:
Fetching all text, processing it, returning wrongly spelled words with their suggestions, and mapping them correctly, so that InDesign draws red underlines properly and when right-clicked to the "red-underlined" word, suggestions pop-up in context-menu.
I'm afraid that these fields can't be accessed by CEP extension, but I'm hoping for.
