My opinion and this only comes after working with Liblouis on Braille plus 18. Is that when you translate to braille the spaces should not just be removed. That should be done with a separate function or let the coder deal with it on their own. The compressing of the spaces seems to cause a lot of bugs and confusion. It also Doesn't allow us to easily support already laid out text for example a simple financial table from an email. So I would rather the translation just translate. Then as mentioned leave the cursor pointing where it should. Then maybe a function called removeSpaces(buffer,cursorPos); This way it would be much clearer what exactly was going on. ken -----Original Message----- From: liblouis-liblouisxml-bounce@xxxxxxxxxxxxx [mailto:liblouis-liblouisxml-bounce@xxxxxxxxxxxxx] On Behalf Of John J. Boyer Sent: Tuesday, January 29, 2013 12:17 PM To: liblouis-liblouisxml@xxxxxxxxxxxxx Subject: [liblouis-liblouisxml] Re: Calculation of cursorPos It's an interesting idea. However, it would require that space should always be provided for the outputPos array. A possible solution would be to use this technique if outputPos is not NULL, but if it is fall back on the existing code. John On Tue, Jan 29, 2013 at 04:16:34PM +0100, Bert Frees wrote: > Hi Jamie, > > AFAICS your reasoning is correct. But I may be overlooking something too. > > Bert > > > On 01/29/2013 04:06 PM, James Teh wrote: > > outputPos maps input positions to output positions. At the beginning > > of the call, cursorPos is the cursor position in the input. Therefore, > > unless I'm missing something, the output cursorPos should just be > > outputPos[cursorPos]. Is there a reason this isn't the case? This > > would simplify the code a great deal and thereby eliminate existing bugs. > > > > Jamie > > > > On 30/01/2013 1:03 AM, John J. Boyer wrote: > >> I don't understand this question. outputPos is an array. cursorPos is a > >> single value. What would be the ideal value of cursorPos? There may be > >> differing opinions on this. > >> > >> John > >> > >> On Tue, Jan 29, 2013 at 05:53:28PM +1000, James Teh wrote: > >>> Hi all, especially John, > >>> > >>> Currently, there are still some bugs in the calculation of the output > >>> cursor position in lou_translate. I can detail these in a separate > >>> email > >>> if necessary. However, I'm wondering whether it is simpler to just set > >>> cursorPos based on outputPos just before returning the translation, > >>> rather than having separate code for it. Is there any reason cursorPos > >>> is currently determined separately from outputPos? To put it another > >>> way, is there any reason that cursorPos should ever be different to > >>> outputPos[inputCursorPos], where inputCursorPos is the value of > >>> cursorPos when the function was called? > >>> > >>> Thanks, > >>> Jamie > >>> > >>> -- > >>> James Teh > >>> Director, NV Access Limited > >>> Email: jamie@xxxxxxxxxxxx > >>> Web site: http://www.nvaccess.org/ > >>> Phone: +61 7 5667 8372 > >>> For a description of the software, to download it and links to > >>> project pages go to http://www.abilitiessoft.com > >> > > > > For a description of the software, to download it and links to > project pages go to http://www.abilitiessoft.com -- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com For a description of the software, to download it and links to project pages go to http://www.abilitiessoft.com