I am using GRX with DJGPP.
I am working on a routine for numerical input. I am using the helve15 font. The problem I have is that the width of a space character is less than a numerical character. When a leading space is replace by a number the displayed number does a right shift on the screen.
Is there a way to cause a proportional width font to be printed in fixed width?
I thought of using right justify but that would only work if I only had one leading space.
I can make this come out correctly by displaying a character at a time but if GRX has a solution there is no point in me re inventing the wheel.
Cheers Richard
On Sat, 29 Jan 2000, Richard Sanders wrote:
I am using GRX with DJGPP.
I am working on a routine for numerical input. I am using the helve15 font. The problem I have is that the width of a space character is less than a numerical character. When a leading space is replace by a number the displayed number does a right shift on the screen.
Is there a way to cause a proportional width font to be printed in fixed width?
I thought of using right justify but that would only work if I only had one leading space.
I can make this come out correctly by displaying a character at a time but if GRX has a solution there is no point in me re inventing the wheel.
Either - Load/build a converted font by GrLoadConvertedFont(), GrBuildConvertedFont() which looks quite ugly - do the charachter placement yourself using max( GrFontCharWidth(fnt,Ž0Ž),GrFontCharWidth(fnt,Ž1Ž),, ..., GrFontCharWidth(fnt,Ž9Ž),GrFontCharWidth(fnt,Ž+Ž), GrFontCharWidth(fnt,Ž.Ž),GrFontCharWidth(fnt,Ž-Ž),...) +1 as the ŽfixedŽ character width or fnt->maxwidth (using maxwidth is the same as converting propotional -> fixed) - use a fixed font (Courier, Lucida?)
Hartmut
There are two characteristics about Helvetica which make aligning numbers fairly easy:
1. All ten digits are exactly the same width. 2. The space character is exactly half the width of the digits.
Ben
On Fri, 28 Jan 2000, Richard Sanders wrote:
I am using GRX with DJGPP.
I am working on a routine for numerical input. I am using the helve15 font. The problem I have is that the width of a space character is less than a numerical character. When a leading space is replace by a number the displayed number does a right shift on the screen.
Is there a way to cause a proportional width font to be printed in fixed width?
I thought of using right justify but that would only work if I only had one leading space.
I can make this come out correctly by displaying a character at a time but if GRX has a solution there is no point in me re inventing the wheel.
Cheers Richard