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

  • Thread starter Thread starter Ralph Sommerer
  • Start date Start date
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?
 
I think you can use Graphics.MesaureString to get the bounding box and then
calculate topleft point based on the bounding box height
 
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.
 
Back
Top