next up previous contents index
Next: Joining characters Up: contextCorrection Previous: Accessing text   Contents   Index


Splitting characters

GOCR provides a set of functions similar, or better, (almost) identical to those used to create characters to split them.

Let's take a look of the situation: you have added a character that you later find out is in fact composed of two (or more, but let's assume two for simplicity; you can take care of more applying this procedure several times) characters. How to split them? Although you could delete the box, taking care of saving its attributes, create two new characters, etc, there's an easier way to do it:

int gocr_charSplitBegin ( gocrBox *box );
box
the box to be splited.
Now you can work just as if you were adding a character. All the gocr_charSet functions can be used as usual. When you are done, call

int gocr_charSplitEnd ( void );
It's time for the fine print. First, what happens: all the pixels you select will be part of the a new box. This box is inserted in the list before the original one, which is updated to hold the rest of the pixels only. All attributes that were part of the original box are now transferred to the new one (so, the original one doesn't have any attributes anymore; but since they are applied to the box before it, they are applied to it too). You can call gocr_Abort just as if you were adding a character.

Future: there may be a flag to set which of the boxes goes before which.


next up previous contents index
Next: Joining characters Up: contextCorrection Previous: Accessing text   Contents   Index
root 2002-02-17