Hi,
>>
I need to insert spaces between the words to align them, but I can't find any function that will give me the real length in inches of a given text. TXTWIDTH and FONTMETRIC works in pixels. Any function to convert from pixels to inches?
>>
The number of pixels per inch depends on the device that will display/print the field (presumably you will be doing this at some point - otherwise why format the text ?)
The basic API is:
DECLARE Integer GetDeviceCaps IN WIN32API Integer iHDC, Integer Index
liPixelsPerInchX = GetDeviceCaps(liDeviceHandle,88)
liPixelsPerInchY = GetDeviceCaps(liDeviceHandle,90)
where liDeviceHandle is the Window or Printer handle for the output. Needless to say if the text will be displayed on different devices there's no point in formating the field...
HTH,
Viv