|
-
Thread Starter
Frenzied Member
The character "1" appears to be handled differently with the Print statement
Unlike any other character, including all the other decimal digit characters, is handled weirdly by the Print statement, in what appears to be a bug. If you have the code:
Code:
Print "1"; "1"; "1"; "1"
Print "1111"
Those two lines of code SHOULD produce identical outputs. However (at least with VB6's default Font for Form1, which is Arial) the result is that the Print statement with 4 concatenated "1" characters is used the digits are displayed as separated slightly more from each other, compared to when the single string "1111" is displayed via the Print statement. I've tried the other numbers, and even skinny letters like "l", but none of those produce this same discrepancy. So I'm guessing this is a bug.
-
Re: The character "1" appears to be handled differently with the Print statement
Can't reproduce. Form font is using the default of MS Sans Serif. Using VB 6.0 SP5 on a VM running Windows 2000 Server w/ SP4.
The code produces "pixelly identical" output, verified in MSPaint at a ridiculous zoom level.
-
Re: The character "1" appears to be handled differently with the Print statement
I could reproduce it. Only with Arial normal. It didn't happen with:
Segoe UI
Arial Narrow
MS Sans Serif
Microsoft Sans Serif
Tahoma
Verdana
The VB6 default font for forms is MS Sans Serif, not Arial. Arial is the default font for the Printer object.
-
Re: The character "1" appears to be handled differently with the Print statement
 Originally Posted by Eduardo-
I could reproduce it. Only with Arial normal. It didn't happen with:
Segoe UI
Arial Narrow
MS Sans Serif
Microsoft Sans Serif
Tahoma
Verdana
The VB6 default font for forms is MS Sans Serif, not Arial. Arial is the default font for the Printer object.
Whoops, I didn't even catch the mention of Arial in the first post. I changed the font to Arial and was unable to reproduce it. But I'm using an old OS in a very standard "classic" video resolution. I would guess this is somehow related to modern high resolution monitors and DPI scaling.
-
Re: The character "1" appears to be handled differently with the Print statement
Code:
Private Sub Form_Load()
Me.Font.Name = "Arial"
Me.Font.Size = 16
Me.AutoRedraw = True
Print "1"; "1"; "1"; "1"
Print "1111"
Print
Print "TwipsPerPixel: " & Screen.TwipsPerPixelX
End Sub
96 DPI (100%):

120 DPI (125%)

Windows 11 22H2
-
Thread Starter
Frenzied Member
Re: The character "1" appears to be handled differently with the Print statement
 Originally Posted by OptionBase1
Whoops, I didn't even catch the mention of Arial in the first post. I changed the font to Arial and was unable to reproduce it. But I'm using an old OS in a very standard "classic" video resolution. I would guess this is somehow related to modern high resolution monitors and DPI scaling.
I'm using Windows 10 (yes VB6 works even on that), and MS Sans Serif isn't even an available font (maybe is obsolete/discontinued on modern versions of Windows), so VB6 must have picked the next best option, Arial. I'm not sure what Windows version you were using to test this.
I don't have a DPI setting (such as 96 DPI) in Windows 10. Instead I have a scale factor (such as 100%). I'm using the default of 100% for the scale factor.
Last edited by Ben321; Today at 03:23 PM.
-
Re: The character "1" appears to be handled differently with the Print statement
 Originally Posted by Ben321
I'm using Windows 10 and MS Sans Serif isn't even an available font
Yes, it is. It is on every Windows version.
Maybe there is a problem with your Windows 10 installation.

 Originally Posted by Ben321
I don't have a DPI setting (such as 96 DPI) in Windows 10. Instead I have a scale factor (such as 100%). I'm using the default of 100% for the scale factor.
That is, 100% is 96 DPI.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|