
June 8th, 2005, 04:12 PM
|
|
Registered User
|
|
Join Date: Jun 2005
Posts: 2
Time spent in forums: 45 m 44 sec
Reputation Power: 0
|
|
|
Textextent problem
How one can find out in Delphi 6 for an arbitrary font and for its arbitrary Font.Size and Font.Style (e.g. italic, bold, underline) the most exact dimensions of an rectangle it will occupy in a bitmap?
I need it as I am working on a vector graphic editor. Each objet (circle, text,...) can be moved around. While an object is being moved around, it is framed by an red rectangle.
I’ve tried to use functions Image.Canvas.TextWidth and Image.Canvas.TextHeight and also Image.Canvas.TextExtent from libraries for VCL (Graphics.pas) and their analogies from CLX library (QGraphics.pas). But all these functions returned small values (some parts of the text weren’t visible) when using Font.Size > 40 (depending on the font type and on concrete font s well) and using Font.Style other than regular (i.e. italic or bold).
Does anybody have an idea how to work it arround?
Thank You in advance
Lubos Doborovda.
|