I have written a routine to justify text for output using the following method:
1) SET MEMOWIDTH to the desired length
2) Use MEMLINES to get the Number of Lines
3) For each line, calculate the number of spaces between words
4) Insert extra spaces evenly based on the above calculation so that the LEN(line(1)) equals to the desired length.
5) Rearrange the "processed" lines by inserting a "CHR(13)" for single space or "CHR(13)+CHR(13)" for double space and resave the text block to the memo field.
The above method has been successful for the font of type "Courier New" of any size but when used with other fonts, the result is the normal "wrapped text" style. I come to understand that different fonts has different characteristics which will affect the end result and the function FONTMETRIC() is used to measure these characteristics.
The question is:
Is there anybody who has used FONTMETRIC()extensively for the purpose of character type data manipulation and the tricks involved to arrive at the text justification method described above.
Any suggestion would be appreciated.
1) SET MEMOWIDTH to the desired length
2) Use MEMLINES to get the Number of Lines
3) For each line, calculate the number of spaces between words
4) Insert extra spaces evenly based on the above calculation so that the LEN(line(1)) equals to the desired length.
5) Rearrange the "processed" lines by inserting a "CHR(13)" for single space or "CHR(13)+CHR(13)" for double space and resave the text block to the memo field.
The above method has been successful for the font of type "Courier New" of any size but when used with other fonts, the result is the normal "wrapped text" style. I come to understand that different fonts has different characteristics which will affect the end result and the function FONTMETRIC() is used to measure these characteristics.
The question is:
Is there anybody who has used FONTMETRIC()extensively for the purpose of character type data manipulation and the tricks involved to arrive at the text justification method described above.
Any suggestion would be appreciated.