Mike Scott - [email protected] wrote:
On 17/05/11 02:57, Brian Barker wrote:
At 14:11 16/05/2011 +0100, Mike Scott wrote:
What /exactly/ is "anchor TO character" supposed to do in Writer?
Naively, I would suppose a graphic (or whatever) so marked would
"stick" to a given character, and move with it retaining a fixed
relative position. But not so, it appears.
[...]
create a small ellipse ... anchor to char, ...
But, if I then move the text around horizontally (space bar), the
ellipse stays still. If I adjust the vertical position (enter), the
ellipse follows.

It's anchored to the character, but it is still positioned according to
other options - and the default for horizontal appears to be to
"paragraph area". If you want the graphic to move horizontally with the
anchor character, go to Format | Object > | Position and Size... |
Position and Size | Position | Horizontal (or right-click | Position and
Size... | Position and Size | Position | Horizontal), and select
Character from the drop-down menu for "to".

Thanks for the comments. I'm afraid I'm still having trouble though,
even after your clear recipe. Sorry if this is a bit laboured, but I
think I need to be clear exactly what I'm doing.

Let's see:-
I enter some text,
12345 O 54321
all on a line by itself. I create my small ellipse, and manually place
it rather below the text and a bit off-centre.

I R-click on the ellipse, and 'anchor /to/ character' - I get my
cross-hairs, which I L-click on the 'O'.

Seems to work fine for me, once the anchor is positioned on the correct character (and the position is set relative to character). After setting anchor to character, you need to ensure the ellipse is selected (click on it if not). You should see an anchor icon, probably at the beginning of the line. Drag that to the character position you want to anchor it to - the cross-hairs are for drawing a new ellipse. Then, after...

Now I R-click again on the ellipse, and go to 'position and size' and
select the 'p&s' tab. 'Anchor' is listed as 'character' (good!), horiz
pos (as you said it would be) is set to 'paragraph area' - I change this
to 'character' - noting that position is set to 'from left' by '4.3cm'
(or whatever). Click 'OK' out of that.

I find that the ellipse _does_ then move with the character. This is using 3.2.0 on Windows Vista.

However, while the ellipse will follow the text vertically, horizontally
it still remains fixed. Fiddling with the 'position' boxes, I find that
'left' 'right' and 'center' grey out the number box, and align the
ellipse horizontally between margins as described; 'from left' merely
allows an absolute position relative to the page margin to be given.

Relevant parts of the xml generated look like this:

<style:style style:name="gr1" style:family="graphic">
<style:graphic-properties draw:textarea-horizontal-align="center"
draw:textarea-vertical-align="middle" style:run-through="foreground"
style:wrap="run-through" style:number-wrapped-paragraphs="no-limit"
style:vertical-pos="from-top" style:vertical-rel="paragraph"
style:horizontal-pos="from-left" style:horizontal-rel="char"/>
</style:style>

<text:p text:style-name="Standard"/>
<text:p text:style-name="Standard">
<text:s text:c="11"/>
12345 O 54321
</text:p>
<text:p text:style-name="Standard"/>
<text:p text:style-name="Standard">
<draw:ellipse text:anchor-type="char" draw:z-index="0"
draw:style-name="gr1" draw:text-style-name="P1" svg:width="0.883cm"
svg:height="1.043cm" svg:x="4.184cm"
svg:y="0.974cm"><text:p/></draw:ellipse>
</text:p>

I'd guess (haven't experimented to find out) the anchor position is determined by the position of the <draw> tag - so in this case it would be anchored a couple of paragraphs below your intended text.

This is for the ellipse definitely anchored /to/ character, and H-pos is
relative to char (by your comments above). But the xml shows no way that
I can see whereby the 'please position relative to the O' is defined.
(Although I don't know the significance of the '<text:s text:c="11"/>'
bit.)

I'm very puzzled.


Is 'anchor to character' just a misnomer for 'anchor to line'?

I don't think of that as a misnomer. Vertically, the position of a
character is simply that of the line of which it currently forms part.
But as text is edited, the line in which any character appears is not a
fixed quantity: you only have to add a single character, and the line
you had before no longer exists. So "anchor to line" would make no
sense, but vertically "anchor to character" is the same as "anchor to
line of which this character from time to time forms part".

I trust this helps.

It has certainly helped my understanding of the terminology. 'Anchor'
doesn't mean what at all I thought it meant - or perhaps wanted it to
mean :-)

OTOH, I still don't get the shape moving with the character, so am still
stumped.


I have two applications in mind. Both are for printing verses of songs.
For the one, I want to put small images of sign language above the
relevant words in the song; the second is similar, but I'm generating(*)
a musical "fake book" with chord names written above the text. In either
case, clearly the symbol needs to move with the word (eg when the text
is edited, or the font changed, or whatever) - absolute positioning on
the page/para is a non-starter. The chord one I'm currently faking with
a fixed width font - but it's a nasty thing to do; the sign language,
I'm stumped. Maybe ODF/OOo is simply the wrong tool.

I'm obviously not understanding something important here - would be very
grateful to be put on the right path!!



(*) With a perl program spewing out an ODF file.


--
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help

Reply via email to