LB Booster
Programming >> Compatibility with LB4 >> Courier font
http://lbb.conforums.com/index.cgi?board=compatibility&action=display&num=1421930653

Courier font
Post by tsh73 on Jan 22nd, 2015, 11:44am

It looks like LB uses Courier New even of asked for Courier. Or it's just my setup (XP Prof SP3, Russian Cyrillic locale)

User Image

Code:
nomainwin
'problem is, it looks like JB/LB uses "courier_new" even if explicitely said "courier"
'Other language does that told, so "courier_new" and "courier" - two different fonts
open "test" for graphics_nsb_nf as #gr
#gr "down"
#gr "trapclose [quit]"
#gr "home; posxy xc yc"

data 192,224,193,225,194,226,212,244,0

a$=""
a$="AaBbCcDd"
read a
while a>0
    a$=a$+chr$(a)
    read a
wend

a$=a$+"012345"
#gr "place 10 20"

#gr "font courier 15"
#gr "\font courier 15"
#gr "\"; a$
#gr "\1"
#gr "\2"
#gr "\3"
#gr "\4"

#gr "place 100 60"
for i = 10 to 15
#gr "font courier ";i
#gr "\font courier ";i
next

#gr "place 10 180"
#gr "font courier_new 15"
#gr "\font courier_new 15"
#gr "\"; a$
#gr "\1"
#gr "\2"
#gr "\3"
#gr "\4"

#gr "place 100 220"
for i = 10 to 15
#gr "font courier_new ";i
#gr "\font courier_new ";i
next


for i = 0 to 2*yc step 20
    #gr "line ";0;" ";i;" ";2*xc;" ";i
next



#gr "flush"
wait

[quit]
close #gr
end
 

Re: Courier font
Post by Richard Russell on Jan 22nd, 2015, 5:13pm

on Jan 22nd, 2015, 11:44am, tsh73 wrote:
It looks like LB uses Courier New even of asked for Courier.

Yes, interesting. Not surprisingly I won't be trying to emulate this behaviour. wink

Like everything else in LBB, the font command is just a 'thin wrapper' around the Windows API, so you can expect LBB to behave just the same as the native API does (in this case CreateFont).

There seem to be several respects in which commands in LB 4.04 don't behave like the equivalent Windows API function. FONT is one, and another that came up recently is NAME, which in LBB will rename a directory (folder) but in LB4 it won't.

It seems unlikely that Carl will have deliberately introduced these differences, so I must assume that SmallTalk does for some reason. Luckily in most cases the end result is that LBB has more functionality than LB4, so I don't really need to worry about it.

Richard.