Text Clipping
Various techniques are used to provide text clipping in a computer graphics. It depends on the methods used to generate characters and the requirements of a particular application. There are three methods for text clipping which are listed below −
- All or none string clipping
- All or none character clipping
- Text clipping
The following figure shows all or none string clipping –
In all or none string clipping method, either we keep the entire string or we reject entire string based on the clipping window. As shown in the above figure, STRING2 is entirely inside the clipping window so we keep it and STRING1 being only partially inside the window, we reject.
The following figure shows all or none character clipping –
This clipping method is based on characters rather than entire string. In this method if the string is entirely inside the clipping window, then we keep it. If it is partially outside the window, then −
- You reject only the portion of the string being outside
- If the character is on the boundary of the clipping window, then we discard that entire character and keep the rest string.
The following figure shows text clipping –
This clipping method is based on characters rather than the entire string. In this method if the string is entirely inside the clipping window, then we keep it. If it is partially outside the window, then
- You reject only the portion of string being outside.
- If the character is on the boundary of the clipping window, then we discard only that portion of character that is outside of the clipping window.
(2) Curve Clipping :-
- Curve clipping procedures will involve non-linear equarions however this requires more processing than for object with linear boundries.
- The bounding rectangle for a circle or other curved object cab be used first to test for overlap with a rectangle clip window.
- If the bounding rectangle for the objects is completely inside the window we save the object.
- If the boundary rectangle for the object is determined to be completely outside the window, we discard the object.
- This procedure can be applied when clipping a curved object against a general polygon clip region. On the first pass we can clip the bounding rectangle of the clip region.
- If the region overlaps, we will need to store the simulations line-curve equation to obtain the clip intersection points.
0 Comments