LB Booster
« Font smoothing? »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 05:03am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 hotthread  Author  Topic: Font smoothing?  (Read 1642 times)
Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx 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 » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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):

User Image

The characters are not clipped in this case. huh

Richard.
User IP Logged

Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx 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 » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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:
Is there no easy way?

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.
User IP Logged

Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Re: Font smoothing?
« Reply #10 on: Jul 17th, 2015, 2:58pm »

Thanks Richard, I'll give it a whirl. smiley
User IP Logged

Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx 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?
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx 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.
User IP Logged

Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Re: Font smoothing?
« Reply #13 on: Jul 17th, 2015, 8:48pm »

I'm sure that conforums are very deserving too smiley
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Font smoothing?
« Reply #14 on: Jul 17th, 2015, 8:54pm »

on Jul 17th, 2015, 1:10pm, Richard Russell wrote:
Here's my program...

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.
User IP Logged

Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx Re: Font smoothing?
« Reply #15 on: Jul 18th, 2015, 07:17am »

That's okay, I don't use LB anymore wink
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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 wink

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. sad

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.
User IP Logged

Monkfish
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 104
xx 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.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »


This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls