Text Positioning in TextField, TextArea and Canvas

My question is: "is there a science behind text positioning for desktop controls, or is it an art (ie lots of guesswork)?

I would like to get alignment between text in TextFields, TextAreas and Canvas (g.drawstring) - but find that the starting origin for text in each of the controls is different. Why do I want alignment? 1. Because I would expect alignment, 2. because I generally use a canvas to show the content of a field, but use a textField or textArea to edit that field - switching between the two on the fly.

Further more, the pitch of the text (same font, same font size) is different depending which control you are using.

For example, using Arial 14, and comparing a TextField with a canvas, to get the same origin (for the first letter) I have to use g.drawstring( txt, 4, g.textAscent + 7), ie an offset of (4,7) from what would be expected.

Whilst for TextArea the equivalent offset is (6,1).

What is more is that these offsets vary both by Font and Fontsize.

WIth regard the pitch, I note that the IDE often has misalignment between the text and the cursor position - especially for longer pieces of text - I wonder if this is the same issue being seen.

Does anyone have a logical solution to these alignment issues or do I have to issue bug report about it?