Author |
Topic: Font smoothing? (Read 1641 times) |
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: Font smoothing?
« Reply #4 on: Jul 16th, 2015, 06:25am » |
|
Perhaps the ugliness is more to do with the SIZE parameter since this has an influence over resolution. What pixel width is your drawing and what SIZE parameter are you using to print the image?
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Font smoothing?
« Reply #5 on: Jul 16th, 2015, 08:55am » |
|
on Jul 16th, 2015, 06:25am, Rod wrote:| Perhaps the ugliness is more to do with the SIZE parameter since this has an influence over resolution. What pixel width is your drawing and what SIZE parameter are you using to print the image? |
|
I didn't realise the OP was doing any (hardcopy) printing; his only reference was to "printing text into a graphics box". If indeed output to a printer is involved then that puts a quite different complexion on the issue.
Richard.
|
|
Logged
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Font smoothing?
« Reply #6 on: Jul 16th, 2015, 2:55pm » |
|
Well I am using 8pt Lucida Console which has characters 7*11 pixels in size. Here is what they look like on the screen and when magnified 2x. Yes I am printing it too.
https://www.dropbox.com/s/3b26v49xrq4quxp/hello%20world.gif?dl=0
Got the antialiased and non-antialiased the wrong way round but you see what I mean. Look at the "W" for example. Not sure how I insert images into these posts.
|
| « Last Edit: Jul 16th, 2015, 3:00pm by Monkfish » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Font smoothing?
« Reply #7 on: Jul 16th, 2015, 8:43pm » |
|
on Jul 16th, 2015, 2:55pm, Monkfish wrote:| Here is what they look like on the screen and when magnified 2x. |
|
Was that created using LBB v3.00? What puzzles me is that several of the letters (including the W) appear to have been clipped, which is one reason why they look so ugly. But LBB is not supposed to clip characters printed to a graphics window.
Here is what I get with 8pt Lucida Console at 96 DPI (magnified 2x):

The characters are not clipped in this case. 
Richard.
|
|
Logged
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Font smoothing?
« Reply #8 on: Jul 17th, 2015, 11:21am » |
|
The word "clipped" got me thinking. Yes, I expect they are clipped, because I am drawing them with a 7 pixel spacing (as they should be) but the antialiasing seems to overlap from one character to the next, so when I print the following character it clips the previous one. I expect I can change the print options to merge with what is already there.
Anyway, for reasons to long to explain, I need the characters without antialiasing and ideally without the user needing to change their windows settings. Is there no easy way?
I suppose I could create a copy of the standard character set and copy each character into position using the drawbmp command?
Your characters still look different to mine. I'm using the statement:
print #main.gfx, "font Lucida_Console 0 11"
I need the characters to be 7x11
Yes I am using version 3.0
|
| « Last Edit: Jul 17th, 2015, 11:29am by Monkfish » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Font smoothing?
« Reply #9 on: Jul 17th, 2015, 1:10pm » |
|
on Jul 17th, 2015, 11:21am, Monkfish wrote:Your characters still look different to mine. I'm using the statement: print #main.gfx, "font Lucida_Console 0 11" |
|
Ah, you said you were drawing 8pt text so that's what I specified in my program.
Quote:| I need the characters to be 7x11 |
|
So why don't you explicitly specify a width of 7 pixels rather than allowing Windows to choose the width (which may be 7 pixels, but there's no guarantee):
Code:print #main.gfx, "font Lucida_Console 7 11" Quote: Well, as I said, the most straightforward way is to call the CreateFont API directly - I would class that as relatively easy, and it's the method I used to create the bitmap I uploaded. Here's my program, adapted to force the cell width and height; if it doesn't give identical results to yours now I'm mystified:
Code: open "Test" for graphics as #w
#w "font Lucida_Console 7 11"
#w "\\Hello World! (antialiased)"
calldll #gdi32, "CreateFontA", 11 as long, 7 as long, _
0 as long, 0 as long, 400 as long, 0 as long, 0 as long, _
0 as long, 0 as long, 0 as long, 0 as long, _
_NONANTIALIASED_QUALITY as long, 0 as long, _
"Lucida Console" as ptr, hf as ulong
hw = hwnd(#w)
calldll #user32, "GetDC", hw as ulong, hdc as ulong
calldll #gdi32, "SelectObject", hdc as ulong, hf as ulong, _
oldhf as ulong
calldll #gdi32, "DeleteObject", oldhf as ulong, ret as long
#w "\Hello World! (non-antialiased)"
#w "getbmp bitmap 0 0 210 24"
bmpsave "bitmap", "C:\temp\lbbaa.bmp"
wait Richard.
|
|
Logged
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Font smoothing?
« Reply #10 on: Jul 17th, 2015, 2:58pm » |
|
Thanks Richard, I'll give it a whirl.
|
|
Logged
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Font smoothing?
« Reply #11 on: Jul 17th, 2015, 7:48pm » |
|
I would like to make a donation Richard for all the help you have given me and all your efforts with LBB. Does that $6.99 at the bottom go to you?
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline


Posts: 91
|
 |
Re: Font smoothing?
« Reply #12 on: Jul 17th, 2015, 8:24pm » |
|
on Jul 17th, 2015, 7:48pm, Monkfish wrote:| ... Does that $6.99 at the bottom go to you? |
|
No, that goes directly to Conforums, this forum's host.
|
|
Logged
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Font smoothing?
« Reply #13 on: Jul 17th, 2015, 8:48pm » |
|
I'm sure that conforums are very deserving too
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Font smoothing?
« Reply #14 on: Jul 17th, 2015, 8:54pm » |
|
on Jul 17th, 2015, 1:10pm, Richard Russell wrote: Something to be aware of if you care about LB 4.04 compatibility: my program works but seemingly only once; thereafter the 'native' font selection seems to be broken. Perhaps it's necessary to select the original font back before exit; I don't know (and TBH I don't really care, since it works fine in LBB as is).
Richard.
|
|
Logged
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Font smoothing?
« Reply #15 on: Jul 18th, 2015, 07:17am » |
|
That's okay, I don't use LB anymore
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
LBB error reporting - an apology.
« Reply #16 on: Jul 18th, 2015, 10:09am » |
|
on Jul 18th, 2015, 07:17am, Monkfish wrote:That's okay, I don't use LB anymore |
|
In that case I need to apologise to you, and to other LBB users, for the shockingly poor error reporting of LBB compared with LB. Even I find myself occasionally running a program under LB 4.04 if LBB throws an incomprehensible error (typically with the line number given as zero!); usually LB will identify the cause.
In my, feeble, defence I would explain that in the early days LB Booster was envisaged only as something you ran to 'boost' an existing, tested and debugged, program. The assumption was that, as the program was known to run in LB, LBB didn't need to do comprehensive error checking.
Sadly, when LBB was developed into more of a standalone product the error reporting wasn't improved, as it should have been. My efforts went into checking for bugs and in maximising compatibility, all of which involved running only error-free programs, not programs with faults. 
I have a longish wish-list of possible enhancements to LBB's error reporting, if and when I release an upgrade. That's only likely to happen if the LB community change their attitude to LBB, and my ban from the forums is rescinded. As things stand that seems very unlikely.
Richard.
|
|
Logged
|
|
|
|
Monkfish
Full Member
member is offline


Gender: 
Posts: 104
|
 |
Re: Font smoothing?
« Reply #17 on: Jul 18th, 2015, 1:22pm » |
|
I'm surprised the entire LB community hasn't jumped ship!
I wish you had a link to allow those of us who appreciate your efforts to reward you in some small way. If there was some issue with that it could always be presented as a contribution for your support, rather than for the program itself.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Font smoothing?
« Reply #18 on: Jul 18th, 2015, 2:38pm » |
|
on Jul 18th, 2015, 1:22pm, Monkfish wrote:| I wish you had a link to allow those of us who appreciate your efforts to reward you in some small way. |
|
The greatest reward you can possibly offer is to spread the word about LBB. The efforts of the wider LB community to prevent users finding out about it, and if they do to knock it as being "not Liberty BASIC"*, are sadly all too successful.
But if you particularly want to make a monetary contribution - even though it doesn't go to me - you can click on the Donate button at the bottom of the page. Each donation gives us another ad-free month (the forum was ad-free for a long time owing to the generosity of one member, but his contributions have now run out).
Richard.
*I went to great trouble to make sure the OOP and SEH extensions to LBB did not affect compatibility with LB4, but that didn't stop Carl claiming that they do, and that, somehow, they make LBB less attractive to LB users.
|
|
Logged
|
|
|
|
|