Difference between revisions of "Documentation/OOo3 User Guides/Draw Guide/Advanced Draw Techniques"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Drawing a logic circuit diagram using the Gallery)
(Configuring the dimensioning style)
Line 185: Line 185:
 
As is usual with OOo, you configure dimensioning using its own style.
 
As is usual with OOo, you configure dimensioning using its own style.
  
After opening a drawing, press ''F11'' to access the Styles and Formatting window. In the Graphic Styles list, right-click on the style Dimension Line and select '''Modify'''. The dialog that opens contains the current settings. Click the Dimensioning tab (Figure 14).
+
After opening a drawing, press ''F11'' to access the Styles and Formatting window. In the Graphic Styles list, right-click on the style Dimension Line and select '''Modify'''. The dialog that opens contains the current settings. Click the Dimensioning tab.
 +
 
 +
[[Image:DG3Ch10F14.png|none|thumb|500px|''Configuring dimension lines'']]
  
 
You can configure all the properties you see in this window to suit your own needs. The left section includes the basic settings for dimension lines and dimension guide lines (these indicate where on the object the dimension is referenced):
 
You can configure all the properties you see in this window to suit your own needs. The left section includes the basic settings for dimension lines and dimension guide lines (these indicate where on the object the dimension is referenced):
Line 195: Line 197:
 
You can individually set the line lengths of the right and left guide lines and use positive or negative values to have the line above or below the reference point. The direction of the line with positive or negative distances depends on the setting of the '''Measure below object''' option (box checked or not), but this is easy to check by referring to the example dimension line in the bottom window of the dialog. For this current exercise click the box and activate this option.
 
You can individually set the line lengths of the right and left guide lines and use positive or negative values to have the line above or below the reference point. The direction of the line with positive or negative distances depends on the setting of the '''Measure below object''' option (box checked or not), but this is easy to check by referring to the example dimension line in the bottom window of the dialog. For this current exercise click the box and activate this option.
  
In the right section you can change the settings for the Legend, the text of the dimension line. You can use the Text position choices to change the location of the text – but only if one or both of the AutoVertical and AutoHorizontal checkboxes are unchecked. Use the various options on the Text and Alignment tabs to further change the text format.
+
In the right section you can change the settings for the Legend, the text of the dimension line. You can use the Text position choices to change the location of the text — but only if one or both of the AutoVertical and AutoHorizontal checkboxes are unchecked. Use the various options on the Text and Alignment tabs to further change the text format.
 
+
<center>[[Image:|thumb|''Figure 14: Configuring dimension lines'']]</center>
+
  
 
Calculation of dimensions always takes into account the scale and 0.64 dimension units contained in '''Tools > Options > Draw > General'''. If you set a scale of 1:10 and a unit of centimeter, then a 6&nbsp;cm long object in the drawing will be shown with a dimension of 60 cm when the option Show meas. unit is activated and the selection window is set to Automatic. Deselecting this option turns off the display of units. You can change the units displayed from Centimeters to (for example) Millimeters by choosing Millimeter instead of Automatic in the selection window.
 
Calculation of dimensions always takes into account the scale and 0.64 dimension units contained in '''Tools > Options > Draw > General'''. If you set a scale of 1:10 and a unit of centimeter, then a 6&nbsp;cm long object in the drawing will be shown with a dimension of 60 cm when the option Show meas. unit is activated and the selection window is set to Automatic. Deselecting this option turns off the display of units. You can change the units displayed from Centimeters to (for example) Millimeters by choosing Millimeter instead of Automatic in the selection window.
Line 207: Line 207:
  
 
{{Documentation/Note| The dimensioning style Dimension Line is always linked and stored with the current work page. All the changes that you make apply only to this page. New drawings are started with the standard properties of Draw. If you want to use the amended style for future drawings, save the page as an additional template.}}
 
{{Documentation/Note| The dimensioning style Dimension Line is always linked and stored with the current work page. All the changes that you make apply only to this page. New drawings are started with the standard properties of Draw. If you want to use the amended style for future drawings, save the page as an additional template.}}
 +
 
== Dimensioning objects ==
 
== Dimensioning objects ==
 
In this exercise you will dimension some logic blocks (see Figure 15). They are used here to demonstrate the technique; you can use your own drawing or fetch a picture from the Gallery.
 
In this exercise you will dimension some logic blocks (see Figure 15). They are used here to demonstrate the technique; you can use your own drawing or fetch a picture from the Gallery.

Revision as of 20:21, 1 April 2011




This is Chapter 10 of the OpenOffice.org 3 Draw Guide, produced by the OOoAuthors group. A PDF of this chapter is available from this wiki page.

Drawing to scale

Draw is not a CAD (computer-aided design) program but a graphics program with which you can produce drawings to a scale. The example used for this chapter is a drawing of a Logic Circuit Diagram. The exact meaning of the individual symbols is not described here as we are only interested in the drawing techniques used to produce the diagram.

The logic symbols shown below form the building block library for our scale drawing.

Logic Symbol library

Working with the Position and Size dialog

So that the edges of the building block symbols do not coincide with the wiring, they should be 8 mm wide and 8 mm high. The connections to the symbols should have a length and separation of at least 5 mm. These values are all random values and you would normally substitute values that suit your own needs.

For the drawing we used a measurement unit of millimeters, a grid spacing of 5 mm, and a grid subdivision of 4 points. In addition you should probably activate Display grid and Guides when moving as well as Snap to grid (see Positioning objects with snap functions). This drawing will serve later as a collection of available symbols and you should not only draw the symbols but fully detail them as well.

The first step is to draw a base element, an AND gate block. You can then dimension and detail this element (use the Position and Size dialog, as shown below; double-click on the status bar or context menu to help with dimensioning). For this example, the left upper corner of the block is at x=10 mm and y=5 mm.

Positioning and dimensioning a Draw object

Draw the first connection lead by eye and dimension and position it using the Position and Size dialog.

Setting the position and dimension of the upper input

Use the same method to draw the remaining two leads. For positioning the input leads, fix the right end points; for the output lead, fix the left one. The first wire lies 1.5 mm below the upper edge of the block. The leads have a 5 mm spacing between them. The following table shows the relevant coordinates of the upper corner points and the leads.


left (X/Y) [mm] right (X/Y) [mm] Input 1 (X/Y) [mm] Output (X/Y) [mm]
10 / 5 18 / 5 10 / 6.5 (right EP.) 18 / 6.5 (left EP.)

For the lower input lead, increase the Y coordinate of Input 1 by 5 mm to 11.5.

The AND gate block is almost finished. We can use it as the basis for all the other gates. So that the drawing gives a good visual impression, use Edit > Duplicate to ensure uniformity of shape and size.

Because we want to copy the block vertically downwards, use a Placement on the X Axis of 0 mm and on the Y Axis 15 mm.

Duplicating an object

With the same method, copy both blocks twice more to the right. Select both blocks, call up the Duplicate dialog, and use placement values of 30 mm (X) and 0 mm (Y). Your drawing should look similar to the one below.

The blocks after duplication

For the INVERTER or NOT gate the connection leads must be amended. Move one input and one output lead to the middle of the block and delete the superfluous input lead.

Draw the missing circle for negation with a diameter of 2 mm, place it by eye in the center and then position it and dimension the connections from the Position and Size dialog as described above.

You can copy the circle to the Clipboard and then paste it as many times as you need, positioning it and adjusting the lead lengths as above.

A wiring diagram also needs a symbol to show a connection point. Draw a filled circle for this.

Next add text to the symbols (&, =1 etc.). Activate the icon DG3Ch10F0a.png on the Options Toolbar. Double-clicking a symbol will now put you in a special text input mode. This integrates the text as an element in the object (see also Chapter 2 of this guide). You will find the OR symbol (≤) in the list of special characters (Insert > Special Characters).

It is probably a good idea to create a group for each type of gate. This will make it easier to use them in a diagram. Your diagram should now resemble the logic symbol library at the beginning of this section; save it to disk.

If you want you can add a name to each of the gate symbols (AND, OR ..), use a separate layer to add this text so that you can switch it off when necessary.

You can place glue points at the end of each connection lead. This will simplify the actual "€œwiring up" later when you add in the connectors.

Setting glue points

This instruction assumes a basic knowledge of connectors and glue points. For additional information refer to Chapters 2, 8, and 9 of this guide.


Template:Documentation/Note The glue points on the connection leads must be placed exactly at the ends of the lines (otherwise the wires will not be properly aligned).Unfortunately you cannot set the position of glue points using numerical values. It is necessary to do it by hand.

The best solution is to use the Zoom toolbar to enlarge the diagrams. You can find this as a tearoff toolbar on the standard Drawing toolbar. It contains (among others) tools for zooming in and for zooming out (enlarging the view/making the view smaller) of the current view. If you click on the Zoom In tool and then click on the page, the scale is doubled and the view is centered on the place where you clicked.

As the ends of the connection leads in this example do not lie on grid points, you must switch off Snap to Grid and activate Snap to Object Points.

When you have done this, you can open the Glue Points toolbar with the Insert Glue Point icon InsertGluePointIcon.png on the Drawing toolbar or using View > Toolbars from the menu bar.

The Glue Points toolbar

Select the block on which you want to insert a glue point. Click the Insert Glue Point icon InsertGluePointIcon.png. It is now activated and appears with a different background. The mouse cursor changes to a small cross and you can set the first glue point. Click the mouse at the desired location. If the point is not exactly where you want it, move it by dragging with the mouse.

When you are satisfied with the location, click on the Glue Points toolbar the icon with the exit direction you want (left, right, top or bottom). The selected icon now has a different (lighter or darker) background. Set the exit direction of the input connection leads to the left and the output leads to the right.

When you have set a glue point at the end of each gate'€™s connection lead, you can copy it into the Gallery.

Copying individual pictures to the Gallery

The Gallery is a very convenient way of controlling building blocks for drawings. It also functions as a symbol library.

First open the Gallery using Tools > Gallery or by clicking on the GalleryIcon.png icon if it is present in one of the toolbars.

The Gallery appears above the drawing page. The left pane shows the folders available for use and the right pane shows the images contained in the current folder. Choose an image by clicking on it; additional information about the image appears in the header bar.

In the left pane, click the New Theme button to create a new folder. A new window opens. Click on the General tab and give the new theme a meaningful name (for example Logic) to replace the default of New Theme. You can rename a theme by right-clicking it in the folders pane on the left.

To import existing images into the Gallery, click on the Files tab and then on the Find Files... button. It is possible to bring in complete folders or individual files; the procedure is self-evident from the dialog windows that open, or see Chapter 14 (Working with the Gallery) in the Getting Started guide.

You can drag and drop Draw objects straight into the Gallery. (The Properties window can be closed after typing in the name.) First select the destination folder, then click on the first symbol that you wish to add to the Gallery. Position the mouse cursor inside the selection frame of the symbol. When the crossed arrows are visible, click on the symbol and keep the mouse button pressed. After about 1 or 2 seconds the cursor will briefly blink and change to the drag symbol. Drag the object into the Gallery and release the mouse button. When you move the mouse into the Gallery field, the cursor shape changes once more.

Crossed arrows > Drag symbol > Gallery symbol


Template:Documentation/Tip When you have placed all the symbols in the Gallery they can be titled. Right-click on a symbol, choose Title from the menu and type the symbol name (AND, OR).

The symbol library is available to all OOo modules, at least for users who have the permission/rights to access it. Making available the drawing collection as a Draw file is the simplest way to distribute a symbol library to other users. After opening the drawing, other users can easily transfer the drawing objects into their own Gallery, as described above.

Drawing a logic circuit diagram using the Gallery

The use of the symbol library which you have created and placed in the Gallery can be illustrated by using the blocks to draw a half adder (see http://en.wikipedia.org/wiki/Half_adder#Half_adder). You can precisely place all the drawing objects with the help of Draw's snap functions. The following instructions are only one way to achieve this objective.

Half adder drawn using logic symbol building blocks

Begin with a new drawing. Set the unit of measurement to centimeter, a grid point spacing of 0.5 cm and subdivision of 4 points. Activate the grid, guiding lines, and associated snap functions.

In the first part of the exercise you should draw only the two signal leads a and b, the two INVERTER gates and the two AND gates.

Begin by drawing the two signal leads. To make it a bit easier, you can use the values in the following table.


Start point Length
Signal wire a X = 2 cm / Y = 3.0 cm 5.5 cm
Signal wire b X = 3 cm / Y = 3.0 cm 5.5 cm

After drawing the two signal leads, you begin the hardest part. With grouped objects the snap function works only on points on the outside contours. The only way to work with these blocks as a unit, however, is as a grouped object. The input and output leads must lie right on grid points if the connecting lines are to be exactly horizontal or vertical.

Position two horizontal guiding lines (A, B) on the grid with Y=4.0 cm and Y=6.0 cm. With Snap to Grid active, this should be no problem. With an INVERTER gate the input and output leads lie in the middle of the block, 4 mm below the upper edge. In order that the input and output are docked to the guiding line, the upper edges of the INVERTER gate must be positioned (for a 5 mm grid spacing) at Y=4.1 cm and Y=6.1 cm. Right-click on the guiding line, select Edit guiding line from the context menu and set the guiding lines to 4.1 cm and 6.1 cm.

In order that the blocks lie exactly underneath each other, insert vertical guiding lines at X=5.0 cm (INVERTER gate) and X=8.0 cm (AND gate).

Now open the Gallery and drag the Inverter gate into approximately 0.64, the position desired. If the function Snap to guiding line is still active, you will be able to accurately position both blocks in the correct location. Your diagram should now look like the figure below and you can save it.

Drawing a half adder &mdash' Step 1

The input and output leads of the INVERTER lie at Y=4.5 cm and Y=6.5 cm. Move the mouse over a guiding line. When the mouse cursor changes to a double arrow, drag the guiding line (with the left mouse button pressed) onto the input and output leads of the block. If the grid snap is still active, this should be exactly positioned without much effort.

The leads of the AND gate lie 1.5 mm below the upper edges of the two horizontal guiding lines. They must be moved up for the next step. The Y coordinates are reduced to 4.35 cm and 6.35 cm (the top edges of the AND gates). When you have moved the lines, you can drag both AND gates from the Gallery and position them. Your drawing should now resemble that in the next figure.

Drawing a half adder — Step 2

Next drag the horizontal guiding lines again over the input and output of the gates (Y=4.5/6.5 cm), so that when you position the connection point of the leads (a small black circle) it will sit exactly on top of the leads from the gates.

To position the two last gates, you need to set the following additional guiding lines: a vertical line with X=11 cm and two horizontal lines (C,D) at Y=5.5 cm and Y=7.5 cm respectively. Shift the horizontal lines C and D each 1.5mm upwards (so that Y=5.35 cm and Y=7.35 cm).

Drag the OR and the last AND gate from the gallery and position them as shown below.

Drawing a half adder — Step 3

Since the OR gate will be connected to the two previously positioned AND gates, you can delete the guiding line of the OR gate. Drag the0.64 horizontal guiding line C and D over the inputs of the AND gates (Y=7.0 and 7.5 cm) and put two other lines (E,F) on the remaining connections (Y=5.0 and 8.0 cm) as shown in Step 4 below.

Deactivate all snap functions except snap to grid. It is a good idea to zoom in so that you can place the lead connections exactly over the intersection points. Drag the connections singly from the Gallery to where you want to position them. You will need to adjust their position with the mouse. The easiest way is to move the connection diagonally to the desired location (See the "Setting connections" figure at the bottom of this section).

The guiding lines are no longer needed and can be hidden (it is better to wait until you have finished the drawing before you delete them). Your drawing should now start to look like this and can be again saved.

Drawing a half adder — Step 4

The individual blocks must now be joined up so that the gates function as a half adder system. To do this, you use connectors. Open the Connector toolbar. Use the standard connector StandardConnectorIcon.png to join the OR to the two AND gates. All the other leads run horizontally and you can use the direct connector DirectConnectorIcon.png.

When all six lead connections have been positioned, both signal wires should have a small black circle added to their connection points. You can use the symbol for NOT from the Gallery as the basis for this.

Setting the connections

If you have correctly positioned the symbols in the drawing, all the connection leads will be straight lines. At this time you can delete all the guiding lines, add text to the drawing and your finished drawing should resemble Step 4 above.

Dimensioning a drawing

Configuring the dimensioning style

As is usual with OOo, you configure dimensioning using its own style.

After opening a drawing, press F11 to access the Styles and Formatting window. In the Graphic Styles list, right-click on the style Dimension Line and select Modify. The dialog that opens contains the current settings. Click the Dimensioning tab.

Configuring dimension lines

You can configure all the properties you see in this window to suit your own needs. The left section includes the basic settings for dimension lines and dimension guide lines (these indicate where on the object the dimension is referenced):

  • Line distance: the distance of the dimension arrow from the object edge
  • Guide overhang: the distance the guide line extends past the arrow
  • Guide distance: the distance of the guide line from the object edge

You can individually set the line lengths of the right and left guide lines and use positive or negative values to have the line above or below the reference point. The direction of the line with positive or negative distances depends on the setting of the Measure below object option (box checked or not), but this is easy to check by referring to the example dimension line in the bottom window of the dialog. For this current exercise click the box and activate this option.

In the right section you can change the settings for the Legend, the text of the dimension line. You can use the Text position choices to change the location of the text — but only if one or both of the AutoVertical and AutoHorizontal checkboxes are unchecked. Use the various options on the Text and Alignment tabs to further change the text format.

Calculation of dimensions always takes into account the scale and 0.64 dimension units contained in Tools > Options > Draw > General. If you set a scale of 1:10 and a unit of centimeter, then a 6 cm long object in the drawing will be shown with a dimension of 60 cm when the option Show meas. unit is activated and the selection window is set to Automatic. Deselecting this option turns off the display of units. You can change the units displayed from Centimeters to (for example) Millimeters by choosing Millimeter instead of Automatic in the selection window.

Adjust the font type and size for the text of a dimension line by means of the Text tab.

The Standard button at the bottom of the dialog sets all the properties of the dimension line to the (inherited) standard properties of the style.


Template:Documentation/Note

Dimensioning objects

In this exercise you will dimension some logic blocks (see Figure 15). They are used here to demonstrate the technique; you can use your own drawing or fetch a picture from the Gallery.

[[Image:|thumb|Figure 15: Dimensioned logic blocks]]

So that Draw can clearly recognize the edges to be measured, you should set a number of guide lines delineating the edges. The previous sections explain how to do this. To place the guide lines exactly and easily, change the resolution of the Grid. Suitable values for this work are a resolution of 5 mm and a subdivision of 4 points. With this setting you should have a snap to grid function with 1 mm point separation.

We will begin by dimensioning the NOT gate. For this block we want the total width (18 mm) and the width of the block itself (8 mm) to have dimension lines. The first step is to add guide lines to delimit the dimension lines. With Snap to grid activated, you can position these quite accurately (see Figure 16a). Watch that the function Snap to guide lines is active and zoom in to the part of the block to be dimensioned. The block should not be selected.

Start the dimensioning command by clicking the Dimension Line icon [[Image:]] on the Lines and Arrows dialog. The dimension line is placed automatically on the Dimension Lines layer so you can hide the dimension lines if you wish.

[[Image:|thumb|Figure 16: a) Delimiting the edges with guide lines b) Dragging the dimension line (anticlockwise) c) Finished dimension line]]

After clicking the Dimension Line icon, the mouse cursor changes into a small cross. As we activated the option Dimension Line – Measure below Object, the dimensioning should be made in a counterclockwise direction. Place the mouse cursor at the left dimensioning point. Press the left mouse button and drag the mouse to the right dimensioning point. Release the mouse button. If you press the Shift key while dragging the mouse, you will restrain the dimensioning line in a horizontal (or vertical) direction (see Figure 16 b).

In the same way you can draw a vertical dimension line on the AND gate. The dimensioning of the NEGATION symbol should also be simple to accomplish, but it is important that for such small components you zoom in enough to accurately position the lines.

Editing dimension lines

Dimension lines can be subsequently edited. You can select single dimension lines which are displayed with four handles, located at the end of the dimension lines (Figure 17).

[[Image:|thumb|Figure 17: Editing dimension lines]]

With the upper handles you can (only) change the length of the guide lines. With the lower handles you can move the points that are being dimensioned. If you select the dimension text, you can edit the font type and size as well as changing the dimension units of the text.

If you only want to edit the text of the dimension, double-click on an unselected dimension line to enter text edit mode.

All the changes that you make relate only to the selected dimension line. They are stored and persistent, but do not affect the settings of the Dimension Line style. If you insert other dimension lines, they will have the settings contained in the style.

If you want to make general setting changes to the Dimension Lines style, change the appropriate style. As soon as you confirm the changes with OK, the new settings will be applied to all dimension lines.

Working with text in Draw

You can use text in Draw in various ways:

  • as a text element
  • as text associated with a picture
  • as an element out of the Fontwork gallery
  • as a Writer OLE object

Configuring text elements with styles

Text, like all drawing objects, can be associated with styles. The text settings in styles always affect the whole text element. You can format individual parts of a text element, but only by using manual formatting, which does not relate at all to styles and templates. Styles for characters and paragraphs do not exist in Draw.

Open the Styles and Formatting dialog by pressing F11. Access the formatting dialogs using the toolbar icons, the context menu, or the Format menu.

The Indents and Spacing, Text, Text effects, Tabs and Alignment tabs of the style dialog function the same as in text documents, although some options are not available in Draw. Specific to drawing objects are the tabs Text and Text Animation.

Text animation

On the Text Animation tab, you can set how the text moves within the object frame. Such effects are interesting mainly for documents that are to be shown on the screen. They are therefore more commonly used in the Impress module. For printed text they do not make any real sense and are not dealt with further in this guide.

Text

On the Text tab, you can determine the behavior of the text block in relation to the border of the drawing object. The same settings can be altered—as manual formatting—under the Text... command in the Format menu or in the context menu.

The type of drawing object determines which settings are active and what effect they have on the text. Shapes behave differently to other drawing objects. To experiment with the settings, use objects with rounded edges so that differences in spacing and alignment show up better.

[[Image:|thumb|Figure 18: Text tab of Graphic Styles dialog]]

Anchoring text

To try out the different settings possible for text anchors, start by drawing an ellipse from the Basic Shapes toolbar [[Image:]] , change into Text edit mode by double-clicking on the ellipse and write several, not too long lines of text. Repeat with an ellipse from the Circles and Ovals toolbar (a classical drawing object).


In the Text tab of the Edit Style dialog, set the values of the Spacing to Borders to 0 cm for all four directions. [[Image:]]
Set Options as Left in the tab Alignment. [[Image:]]

Now we can try out some of the different possibilities of text anchoring.


Shapes Classical drawing objects
[[Image:]]

Text anchored to left middle – the text block is placed on the left side and centered vertically.

[[Image:]]

“Left edge” here means the edge of the text frame whose left side fits totally within the figure.

[[Image:]]

“Left edge” here means the left side of the object frame – the frame with the green handles which is visible when you click on the object.

[[Image:]]

Text anchor to lower right.

[[Image:]]

The lower right corner of the text block sits against the edge of the figure.

[[Image:]]

The lower right corner of the text block lies in the lower right corner of the (invisible) object frame.

The text anchoring always relates to the entire block, even when single lines are set differently to the other text through manual formatting. [[Image:]] [[Image:]]

If you checked the option Full width, the text block is always centered horizontally. The area of the text block is as great as possible; here it extends either to the edge of the figure or object frame or (when not that wide) the width that is necessary to fit the length of the longest line. The difference becomes clear if you position the text on the left, but you set single lines through hand formatting to be aligned on the right.

In the examples below, the first line of text was shortened to “First line with”, spacings were set to 0 and text anchor to middle left.


Shapes Classical drawing objects
Without option “Full width” [[Image:]] [[Image:]]
With option “Full width” [[Image:]] [[Image:]]

Fitting text in frames

Here you find that shapes and classic Draw objects behave completely differently.

For shapes the options on the right are active.

[[Image:|thumb|Figure 19: Options active for shapes]]

These have the following effects.


Word wrap text in shape:

[[Image:]]


[[Image:]]


No automatic hyphenation is available and you cannot insert a fixed hyphen.

If the text does not fit in the shape it hangs over or under the outside of the shape.

Resize shape to fit text:

[[Image:]]

Watch out! If you turn on this option it is not possible to undo the size changes – neither using the Undo function on the menu nor by switching off the option in the dialog.

For the classic drawing objects, both lower left options in the dialog are active.

[[Image:]]

These options have the following effects.


Fit to frame:

[[Image:]]

The text is widened and compressed so that it fills out to the object frames.
Adjust to contour:

[[Image:]]

[[Image:]]

All the text is contained within the figure. It is split over several lines if necessary. Any text which does not fit in the figure is not shown, but is still retained.

Note that even if you have activated hyphenation, words will be split without regard to the hyphenation rules.

Distance from frame

Spacing settings are added to the text. In this way the text block is invisibly reduced or (with negative values) made bigger.

In the examples below, the text (M) is centered horizontally and the text block is anchored in the upper middle part of the frame.


Value for spacing “Above” -2 cm -1 cm 0 cm 1 cm 2 cm 3 cm
[[Image:]]The behavior is the same for classic drawing objects and shapes. [[Image:]] [[Image:]] [[Image:]] [[Image:]] [[Image:]]

If you anchor the text above, below, right or left, a positive spacing value positions the text in such a way that it sits close to the outside of the object frame at the anchoring point. Anchoring in the middle does not result in this movement.

It is easier to add text to a straight line if the line is created as a very thin rectangle. Choose an anchor point in the middle of the rectangle and then determine the exact position of the text by setting the spacing accordingly.

Text added to open line types such as Bézier curves (curves and freehand lines), Polylines (polygon and polygon 45°), and Arcs is also positioned in relation to the enclosing object frame. If you want to see the extent of this frame, just click on the object. To add text along one of these lines, you can use the Fontwork tool described on page 24.

Text added as described above is rotated when the object is rotated. The property settings, particularly those dealing with spacing relative to the frame, relate only to situations where the object is not rotated.

Text frames and callouts

To test the range of setting possibilities, use a text frame or a callout with rounded corners. For text frames, as for rectangles, you can set the rounding in the Position and Size dialog (Slant & Corner radius) or in Points mode. The latter makes sense only if you have a visible outline. With callouts (as with text frames in Points mode), drag the larger marker in the left upper corner with the mouse to give the desired amount of rounding. An example of this is shown in Figure 20.

[[Image:|thumb|{| style="border-spacing:0;" | style="border:none;padding:0in;"| <center>
| style="border:none;padding:0in;"|
| style="border:none;padding:0in;"|
| style="border:none;padding:0in;"|
| style="border:none;padding:0in;"|
|} Figure 20: Legend with rounded corners]]</center>

Unlike drawing objects, text frames and callouts support automatic line breaks and you can switch on automatic hyphenation under Tools > Language > Hyphenation.

Non-breaking dashes and protected separators are however not available. For a manual line break use, as elsewhere, the key combination Shift+Enter.

With the text and callout icons ( [[Image:]] and [[Image:]] ) you can create text frames and callouts with vertical text. You need to activate Enhanced language support > Enabled for Asian languages in Tools > Options > Language Settings > Languages. Text frames can be rotated like drawing objects, but it is not possible to rotate callouts.

Text frames and callouts do not have a separate text element, but you still use the Text dialog to set formatting properties. As soon as you have input text, the upper three settings on the left side become active (Figure 21). The settings for Spacing to Borders and Text anchors in the lower window area function in a similar manner to normal drawing objects and are not dealt with further here.

[[Image:|thumb|Figure 21: Text options active for text frames and callouts]]


All options off

[[Image:]]

The text is broken at the object frame. You do not see text that does not fit within the object frame. It is still available and if you enlarge the object it will be visible.

As with normal drawing objects the text positioning relates not to the figure itself but to the object frame. Observe that the text frame in the example at left extends outside the ellipse.

Fit width to text

[[Image:]]

[[Image:]]

The width of the text frame or callout is enlarged so that the longest line fits, without a line break, inside the object frame.


A previously inserted manual line break (here after the word “longer”) remains in effect.

Fit height to text

[[Image:]]

The height of the text frame or callout is enlarged so that all lines fit within the height of the object frame.
Fit to frame

[[Image:]]

The text is widened or compressed so it fits within the entire object frame. This effect is the same as with normal drawing objects.

With the symbols [[Image:]] and [[Image:]] you can produce a text frame that has this property already set.

Pictures and text

Pictures also possess a text element. You can use this text element to place lettering over the picture or to give the picture a caption. To format this text, proceed in the same way as for a normal rectangle. Usually you produce text as a separate object and then group it with the picture, because this gives you more flexibility.

Here are two examples showing what is technically possible with text elements.


[[Image:]] tab: Font, Comic Sans MS, Bold, 40pt

tab: Font Effect, color white, with shadows

tab: Alignment, Options Right

tab: Text, Text anchor “upper right” and Spacing to borders right 0.5 cm, top 0.5 cm, others 0.0 cm

[[Image:]] tab: Font, Bitstream Vera Serif, 14pt

tab: Alignment, Options Left

tab: Text, Text anchor “lower left” and Spacing to borders bottom -1.3 cm

Note: the line break after the word “sea,” was inserted manually.

The construction of each example was carried out using a graphics style. Right-click on the picture and choose Edit Style to open the Graphics Styles dialog (Figure 18). You may first wish to choose a different style to edit for the picture, or create a new style for a special purpose. For more about styles, see Chapter 4 (Changing Object Attributes).

If you store the picture using File > Export, the text is exported along with the graphic. If you use the context menu option Save as graphic, then the text is not exported.

Fontwork Gallery

Click the icon [[Image:]] to open the Fontwork Gallery (Figure 22) which you can use to insert an eye-catching caption to an image. Fontwork drawing objects belong to the shape category. The Gallery contains a selection of popular text forms.

[[Image:|thumb|Figure 22: The Fontwork Gallery]]

You are not limited to these samples; you can subsequently edit and customize the chosen caption type. Proceed as follows.


Choose a caption type from the Gallery and click OK. The caption is then inserted into the middle of your document.

Use the green handles to drag and resize the caption.

[[Image:]]
Double-click to enter text editing mode and replace the placeholder text “Fontwork” with your own text.
[[Image:]][[Image:]]
Click outside the object or press the Esc key to leave editing mode.
[[Image:]]
With the Area dialog from the Format menu or the context menu, you can set fill and shadow properties. Use the Line dialog to set a frame around the lettering.
[[Image:]]
For further adjustments use the Fontwork toolbar. If this does not open automatically turn it on with View > Toolbars > Fontwork.

The left symbol is already familiar. It opens the Fontwork Gallery.

[[Image:]]
Use the small triangle on the symbol [[Image:]] to open the tearoff Fontwork Shape toolbar and choose the shape of the frame of your caption.
[[Image:]]
Use the yellow handle to modify the form of the caption.
[[Image:]]
With the other icons you can further customize the text direction and spacings.
[[Image:]]
To change the font type of the caption, use (as for other text) the dialog from the Format > Character menu or the context menu.
[[Image:]]

If you want to give the text a 3D appearance, refer to the relevant section in Chapter 7 (Working with 3D Objects).

Writer OLE object

In some cases, text frames are not flexible enough to meet your needs and offer too few possibilities for adjustment. For example, you may want to show a figure in Draw in exactly the form it was created in Writer. The best solution might be to insert an OLE object. This means that the object is linked or connected to the application that created it. Draw makes available to other applications (only) one viewing window. The object itself is not edited in Draw but in the other application.

Insert

Use Insert > Object > OLE Object to open the dialog as shown in Figure 23. Use the Create new option to embed the OLE object in the Draw document. With the Create from file option, you can choose whether the object should be embedded or linked. With a linked file any change in the stored file will be shown in Draw and vice versa: any change you make in Draw will be stored in the file on disk.

If you have decided to embed the object you can still create an independent text document from the OLE object. For this use the Save Copy as command from the context menu.

[[Image:|thumb|
Figure 23: Inserting an OLE Object]]
=== Editing mode ===


As soon as you click on OK, the object is created and opens in editing mode. You can recognize this mode by the gray frame around the object and the small black handles.

Take special note of the toolbars. These are no longer those of the Draw module but of the Writer module. You input your text and format it almost the same as if you were in Writer itself. In particular you now have available all the format styles from Writer.

[[Image:|thumb|Figure 24: Writer OLE object in editing mode]]

With the handles of the gray frame you can determine which section of the entire text document is visible. You should switch off the ruler view.

[[Image:|thumb|Figure 25: Editing in Writer as an OLE object]]

Click outside the object to leave editing mode. Double-click on the object or use Edit > Object > Edit to change again into editing mode.

In an embedded Writer OLE object, you can connect to further “sub” OLE objects. You cannot edit a linked Writer “sub” OLE object directly in Draw; you must open it as a text document in Writer. This limitation can be illustrated by the use of formulas. Such formulas are technically OLE objects that belong to the Math module. To use mathematical formulas inside flowing text, save the text in a separate text document and insert it as a linked OLE object in Draw.

Object mode

Click on an object to enter object mode, recognizable by the presence of the green handles. In object mode you remain in the Draw module.

Possibly you noticed that in edit mode there is no Zoom. Set the size of the OLE object on the Draw page in Object mode from the Position and Size dialog. In the left image of Figure 26 the object was inserted at the original size, at right the size was reduced. If you change the size, take care that the option Keep ratio is checked or else the object will become distorted. Line and Area properties are not available for OLE objects, nor is it possible to rotate objects as with text frames.

[[Image:|thumb|Figure 26: Zoom vs resizing of an OLE Writer object]]

OLE objects can be overlaid just like other drawing objects. In Figure 27 a drawing object from the basic shapes menu has been placed behind the OLE object.

[[Image:|thumb|Figure 27: Draw object behind an OLE object]]

The page with the text document has the background property set to transparent. If you change the background color of the OLE object in Edit mode, it will also show in the Draw document.

The Format menu has the entries Area and Line grayed out because they are not usable, but the menu entries Paragraph, Character, Text, and Bullets and Numbering are all available. These relate not to the text object which you are currently editing but rather to a text element within the object, which you can open by pressing F2. (This is similar to the way that pictures are linked with an OLE object.) The double-click, which opens the text element in images, does not work here because it puts you into the OLE object’s edit mode. Whether it makes sense to use a text element within text like this is questionable!

Guide to Bézier curves

Bézier curves — what are they?

[[Image:]] OpenOffice.org uses cubic Bézier curves. A curve is defined by means of a start point P0, an end point P3, and two control points P1 und P2 (see the figure at left). For points on the curve the terms nodes or anchors are often used.

For the mathematical background of Bézier curves, see http://en.wikipedia.org/wiki/Bezier_curve.

Bézier curves are very useful for experimenting with the shape and form of curves. In point mode you can change the curve alignment by dragging the points with the mouse. The curve leaves the start point P0 in the direction of the control point P1 and arrives at the end point P3 from the direction of the control point P2. These directions are shown in Draw by blue lines. The more distant a control is from its start or end point the smaller the curvature at that point. If a control point lies directly on one of these points, it has no influence on the curve.

Direct drawing of a Bézier curve

[[Image:]] Open the Curve toolbar by clicking on the small black triangle of the [[Image:]] symbol on the Drawing toolbar. Click on the Curve icon [[Image:]]. The mouse cursor changes to [[Image:]].
[[Image:]] Click on the start point of the curve and keep the mouse button pressed (start and end points are shown here in the figures as snap points).
[[Image:]] Drag the mouse to approximately the position of your first control point. It does not matter if this is not exactly right as you can move the control point location later. If you hold the Shift key down while dragging, the control point will lie on a 45 degree grid.
[[Image:]] Release the mouse button and move the mouse to the position of the end point of the curve. You can see that the line of the curve follows the movement of the mouse. Double-click at the end position.
[[Image:]] Turn on point mode with the [[Image:]] icon from the Draw toolbar.

At the end of the curve you will see not only the end point but also an associated control point, the round handle. Hover the mouse cursor over this point; the cursor shape changes to show that you are in edit mode of a control point.

[[Image:]] Now you can drag the control point to its correct position, if necessary.

Point mode of the Bézier curve

After drawing a curve using the [[Image:]] icon from the Draw toolbar or with the Edit points command from the context menu, you can bring the curve into a point mode from which you edit individual points on the curve. Points on the curve are shown with a square handle [[Image:]]; the control points with a round handle [[Image:]]. The starting point of a curve appears somewhat larger than the other points. When you hover the mouse over a curve point the mouse cursor changes to [[Image:]] - over a control point it changes to [[Image:]]. In point mode the toolbar Edit Points should appear. If not, turn it on from View > Toolbars > Edit Points.

You can switch on the option All control points in Bézier editor under Tools > Options > OpenOffice.orgDraw > View. The default is to see the control points and guide lines only when a point is marked by clicking the point. By holding the Shift key down as you mark, you can select and mark several points at the same time. A marked point is shown a little darker [[Image:]].

Drawing a succession of Bézier curves

Several lines or Bézier curves can be linked together. The single parts are referred to as segments. Technically such a succession of Bézier curves and lines is known as a path.

Begin the drawing as with a simple Bézier curve. At the end position of the first segment, end not with a double-click but with one of the following:

  • Click on the end point of the first segment but do not keep the mouse button pressed. In this way you produce a curve point which is both a control point for the first segment and a control point for the second segment. This control point lies, however, on the actual curve point and so does not influence the direction of the following curve segment. Move the mouse to the end position of the second segment. This segment appears to be a straight line but is in fact a Bézier curve. Either double-click to finish the curve or repeat the above procedure to add successive segments.

or

  • Go back and click once on the end point of the first segment and keep the mouse button pressed. Now you can drag the initial control point for the second segment into place, as described above. Release the mouse button at the desired position of the control point and move the mouse to the end position of the second segment. The curve follows the line of movement of the mouse.

You can either end the drawing here with a double-click or continue and link in further segments.

To generate a closed curve, select the curve and click on the Close Bézier icon [[Image:]] on the Edit Points toolbar, or right-click and select Close object from the context menu.

Transition points

For the transition from one segment to the next, there are three different types of points, each with its own properties.

Corner points

This is the only common point between two segments which are otherwise independent of each other. It is likely that the curve has a kink at this point (depending on the angle of the tangents, the lines from the corner point to each control point; see Figure 28).

[[Image:|thumb|Figure 28: Corner point]]

Smooth transition points

The tangent lines to the common point have the same angle and form a straight line. If you change the position of one of the control points the other also moves, so that the tangents remain in a straight line. This also applies to the case where a Bézier curve meets a straight line: the tangent line lies on the straight line and cannot be moved sideways.

[[Image:|thumb|<center>
Figure 29: Smooth transition point]]</center>

Symmetric transition points

In this case the tangents not only lie on a straight line but the distance of the control points from the curve point is the same. The segments have the same direction and the same curvature at the transition point.

[[Image:|thumb|<center>
Figure 30: Symmetric transition point]]</center>

Changing point types

When a point is selected, the Edit Points toolbar activates the three corner point icons.

[[Image:]]

The circled icons are, from left to right, Corner point, Smooth transition, and Symmetric transition. The latter two icons appear the same but you can identify them by looking at the tooltip. At any time only one of the three icons will be active. To change the type of point, click on one of the other two icons.

Closing the curve

To close an open curve, use Close object from the context menu or the Close Bézier icon [[Image:]] from the Edit Points toolbar. A straight line is drawn between the start and end points if these points are Corner points.

If the start and end points are Smooth points or Symmetric points and the control point does not lie directly on the curve point, it changes position so it is in a straight line with the line segment and the closing line will be a curve (see Figure 31 for a comparison).

To prevent this happening, change the curve point type before closing to a corner point.

[[Image:|thumb|Figure 31: Close curve – start and end points are corner points (left), smooth or symmetric points (right)]]

Transformation between straight line and Bézier curve

Transform a straight segment into a Bézier curve

Select the larger of the two handles at the ends of the straight line; this will be the starting point of the curve. After a short time the Convert to curve icon [[Image:]] on the Edit Points toolbar becomes active. It starts in the "out" position. Click the icon to turn on the function. The straight line is transformed into a Bézier curve. The type of the segment end point remains as it was. Using this function you can convert one side of a polygon or a part of a polyline into a Bézier curve.

Transform a Bézier curve into a straight segment

Select the larger of the two handles at the ends of the curve; this will be the starting point of the straight segment. After a short time the Convert to curve icon [[Image:]] on the Edit Points toolbar becomes active. It starts in the "in" position. Click the icon to turn off the function. The Bézier curve segment is transformed into a straight line. The type of the segment end point remains as it was. If all segments are straight lines, Draw converts the object to a polygon or a polyline.

Transform complete curves, polylines and polygons

Transform a polygon or a polyline into a curve

Select the whole polygon or polyline. The object does not need to be in point mode. Choose Convert to curve from the context menu or the Modify menu. The points in the resulting curve are all of the type Corner point and the control points lie on the curve segments. All the segments thus appear as straight lines.

[[Image:]]

Transform a curve into a polygon or a polyline

Select the whole curve. Choose Convert to polygon from the context menu or the Modify menu. The curve does not need to be in point mode to do this. The individual segments are not replaced by straight lines. Instead additional points are generated on the curve so that the line of the polygon/polyline matches that of the curve as closely as possible. These points are placed closer together as the curvature increases.

before [[Image:]] after [[Image:]]

Freehand lines

You can also produce a curved line from a Bézier curve using the freehand line tool [[Image:]]. This tool automatically inserts anchor points and control points to render the curve as close as possible to the original Bézier curve.

Place the mouse cursor at the beginning point and keep the mouse button pressed until you reach the end of the curve. As soon as you release the mouse button, the curve is complete.

Normal view [[Image:]]Point mode [[Image:]]

Combining closed curves

If you draw a Bézier curve segment and, at the end point of the segment, click and hold the mouse button, followed by a single press of the Alt key, the curve is closed with a straight line and you are placed in Combining mode. You can now begin a second curve at an arbitrary point. Ending the drawing with a double-click also closes this curve. If you end it with an Alt-click as described above, you can draw further curves. The curves that you have just drawn form a common object, a so-called Combination. You can use this (for example) to place holes in filled curves.

If you want to bind two curves together into a Combination at some stage, select both curves and use Modify > Combine.

Even if you use a Combination, the individual curves are still available as objects. You can use Modify > Split to convert the Combination back to single objects.

You can create Combinations only from closed curves. Other objects, such as rectangles or polygons, will be automatically transformed into curves, and curves that are not closed will be closed with a straight line.

Connecting curves

To join curves together, select them and use Modify > Connect. A connection is only possible with open curves. If you use this tool on closed curves, they are first opened and an additional end point inserted at the starting point. A straight line is used to connect the curves.

The behavior of connected curves cannot (at present) be modified. It is not obvious in advance how the transition properties of the connected curves are calculated, nor which end points will be connected. It is therefore a good idea to work on a copy and try out the effect with different positions of the end points of the individual curves. To avoid changes to a shape, first set the property of the new connection point to the type Corner point.

Adding comments to a drawing

Starting with OOo 3.2, Draw supports comments (formerly called notes) similar to those in Writer and Calc.

Choose Insert > Comment from the menu bar. A small box containing your initials appears in the upper left-hand corner of the Draw page, with a larger text box beside it. Draw has automatically added your name and the date at the bottom of this text box.

[[Image:]]

Type or paste your comment into the text box. You can optionally apply some basic formatting to parts of the text by selecting it, right-clicking, and choosing from the pop-up menu. From this menu, you can also delete the current comment, all the comments from the same author, or all the comments in the document.

You can move the small comment markers to anywhere you wish on the page. Typically you might place it on or near an object you refer to in the comment.

To show or hide the comment markers, choose View > Comments.

Select Tools > Options > User Data to configure the name you want to appear in the Author field of the comment, or to change it.

If more than one person edits the document, each author is automatically allocated a different background color.

Connecting and breaking lines

It is possible in Draw to join separate line elements into one line. Select a number of lines and choose Modify > Connect. The lines are converted to curves and adjacent end points are joined together. The resulting shape is a polyline, not a closed shape.

To add text to the polyline, press F2 and type the text. To make a closed shape from the polyline, right-click the polyline and choose Close Object. You can add text and also change area properties and edit the object as with any polygon object. Note that you can only use the Close Object command on connected lines, freehand lines and unfilled curves.

If you select a shape and choose Modify > Break, this does not reverse the Connect process but simply converts the polygon into a collection of individual lines. Text added to the shape will be associated with one of the lines (often the last one). You cannot apply a fill to a closed shape made up of lines resulting from the Break command.



Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools