Joke: You can't draw strings on a common base line

R

Ralph Sommerer

....unfortunately, it's not a joke.

In the .NET framework strings are drawn using the top of the bounding box as
the vertical coordinate, instead of the base line which is the *only*
sensible thing to do (and which, therefore, Java's AWT uses). And in the
compact framework the font metrics (that allowed for a work around by
shifting the string) are missing, which leads us to the conclusion: you
can't draw several strings properly aligned on their common base line.

Am I missing something here (suggestions are very welcome), or have I just
stumbled across another reason to abandon the .NET platform?
 
A

Alex Feinman [MVP]

I think you can use Graphics.MesaureString to get the bounding box and then
calculate topleft point based on the bounding box height
 
J

Jon Skeet

Alex Feinman said:
I think you can use Graphics.MesaureString to get the bounding box and then
calculate topleft point based on the bounding box height

But the bounding box doesn't give the base line, does it? For instance,
on a lower case g or j, the bounding box will extend below the base
line. Of course, it could be that my understanding of "base line" is
wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top