_TITLE "Bplus font" 'B+ 2019-11-29 trans from ' Plasma Deluxe.bas SmallBASIC 0.12.6 [B+=MGA] 2016-05-16
CONST xmax
= 1200, ymax
= 600, pi
= 3.141592654 clr = &HFFAACCFF
post i, i, 10, clr, "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZz1234567890?!.,"
post 0, i + 20, 20, clr, "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZz1234567890?!.,"
post 0, i + 50, 30, clr, "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZz1234567890?!.,"
post 0, i + 90, 40, clr, "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvXxYyZz1234567890?!.,"
post i, i, 100, clr, "Bplus Font"
clr
= _RGB32(127 + 127 * SIN(b
* i
), 127 + 127 * SIN(c
* i
), 127 + 127 * SIN(d
* i
))
'local lm,i,c,p1,p2,p3,p4,px,gf
thick = 1 / 40 * scale
dr = scale / 6 - thick / 2
gf = .04 * scale
p1 = .16 * scale: p2 = .32 * scale: p3 = .48 * scale: p4 = .64 * scale
lm
= LEN(mess$
): py
= y
+ .5 * thick
IF lm
* scale
* .5 + x
- xmax
> 0 THEN BEEP 'draw it anyway px = x + (i - 1) * scale * .5 + .5 * thick
CASE "a": ac px
+ p1
, py
+ p3
, 0, 360: lx
= px
+ p2: ly
= py
+ p2
- gf: tl
0, p2: tl
0, 2 * gf
CASE "b": ac px
+ p1
, py
+ p3
, 0, 360: lx
= px: ly
= py: tl
0, p4
CASE "c": ac px
+ p1
, py
+ p3
, 40, 320 CASE "d": ac px
+ p1
, py
+ p3
, 0, 360: lx
= px
+ p2: ly
= py: tl
0, p4
CASE "e": ac px
+ p1
, py
+ p3
, 45, 360: lx
= px: ly
= py
+ p3: tl p2
, 0 CASE "f": ac px
+ p2
, py
+ p1
+ gf
, 180, 270: lx
= px: ly
= py
+ p2: tl p2
, 0: lx
= px
+ p1: ly
= py
+ p1: tl
0, p3
CASE "g": ac px
+ p1
, py
+ p3
, 0, 360: lx
= px
+ p2: ly
= py
+ p2: tl
0, p2: ac px
+ p1
, py
+ p4
, 0, 90: lx
= px: ly
= py
+ p4
+ p1: tl p1
, 0 CASE "h": ac px
+ p1
, py
+ p3
, 180, 360: lx
= px: ly
= py: tl
0, p4: lx
= px
+ p2: ly
= py
+ p3: tl
0, p1
CASE "i": lx
= px
+ p1
- gf: ly
= py
+ p2: tl gf
, 0: tl
0, p2: tl
-gf
, 0: tl
2 * gf
, 0 lx = px + p1 - gf: ly = py + p1: tl gf, 0: tl 0, -gf: tl -gf, 0: tl 0, gf
CASE "j": lx
= px
+ p1
- gf: ly
= py
+ p2: tl gf
, 0: tl
0, p2: ac px
, py
+ p4
, 0, 120 lx = px + p1 - gf: ly = py + p1: tl gf, 0: tl 0, -gf: tl -gf, 0: tl 0, gf
CASE "k": lx
= px: ly
= py: tl
0, p4: lx
= px
+ p2: ly
= py
+ p2: tl
-p2
, p1: tl p2
, p1
CASE "l": lx
= px
+ p1
- gf: ly
= py: tl gf
, 0: tl
0, p4: tl gf
, 0: tl
-2 * gf
, 0 CASE "m": lx
= px: ly
= py
+ p2: tl
0, p2: lx
= px
+ p1: ly
= py
+ p4: tl
0, -p2: tl
-p1
, p1: lx
= px
+ p2: ly
= py
+ p4: tl
0, -p2: tl
-p1
, p1
CASE "n": ac px
+ p1
, py
+ p3
, 180, 360: lx
= px: ly
= py
+ p2
- gf: tl
0, p2
+ gf: lx
= px
+ p2: ly
= py
+ p3: tl
0, p1
CASE "o": ac px
+ p1
, py
+ p3
, 0, 360 CASE "p": ac px
+ p1
, py
+ p3
, 0, 360: lx
= px: ly
= py
+ p2
- gf: tl
0, p4
- 2 * gf
CASE "q": ac px
+ p1
, py
+ p3
, 0, 360: lx
= px
+ p2: ly
= py
+ p2
- gf: tl
0, p4
- 2 * gf: tl
2 * gf
, 0 CASE "r": lx
= px: ly
= py
+ p2: tl
0, p2: ac px
+ p1
, py
+ p3
, 180, 340 CASE "s": dr
= 1 / 12 * scale: ac px
+ .5 * p1
, py
+ p2
+ dr
, 90, 270: ac px
+ 1.5 * p1
, py
+ p3
+ dr
, 270, 450: dr
= 1 / 6 * scale
lx = px + .5 * p1: ly = py + p2: tl p1 * 1.5, 0: lx = px: ly = py + p4: tl p1 * 1.5, 0: lx = px + .5 * p1: ly = py + p3: tl p1, 0
CASE "t": lx
= px
+ p1: ly
= py: tl
0, p4: tl
2 * gf
, 0: lx
= px: ly
= py
+ p2: tl p2
, 0 CASE "u": ac px
+ p1
, py
+ p3
, 0, 180: lx
= px: ly
= py
+ p2: tl
0, p1
* 1.5: lx
= px
+ p2: ly
= py
+ p2: tl
0, p2
+ gf
CASE "v": lx
= px: ly
= py
+ p2: tl p1
, p2
+ gf: tl p1
, -p2
- 1.5 * gf
CASE "w": lx
= px
- gf: ly
= py
+ p2: tl gf
+ p1
* .5, p2: tl
.5 * p1
, -p2: tl p1
* .5, p2: tl p1
* .5 + gf
, -p2
CASE "x": lx
= px: ly
= py
+ p2: tl p2
, p2: lx
= px: ly
= py
+ p4: tl p2
, -p2
CASE "y": lx
= px: ly
= py
+ p2: tl p1
, p2: lx
= px
+ p2: ly
= py
+ p2: tl
-p2
, p3
+ gf
CASE "z": lx
= px: ly
= py
+ p2: tl p2
, 0: tl
-p2
, p2: tl p2
, 0 CASE "A": lx
= px: ly
= py
+ p4: tl p1
- gf
, -p4: tl
2 * gf
, 0: tl p1
- gf
, p4: lx
= px
+ p1
- 2 * gf: ly
= py
+ p2: tl p1
, 0 CASE "B": ac px
+ p1
, py
+ p1
, 270, 450: ac px
+ p1
, py
+ p3
, 270, 450 lx = px: ly = py: tl 0, p4: tl p1, 0: lx = px: ly = py + p2: tl p1, 0: lx = px: ly = py: tl p1, 0
CASE "C": ac px
+ p1
, py
+ p1
, 180, 320: ac px
+ p1
, py
+ p3
, 40, 180: lx
= px: ly
= py
+ p1: tl
0, p2
CASE "D": ac px
+ p1
, py
+ p1
, 270, 360: ac px
+ p1
, py
+ p3
, 0, 90 lx = px + p1: ly = py: tl -p1, 0: tl 0, p4: tl p1, 0: lx = px + p2: ly = py + p1: tl 0, p2
CASE "E": lx
= px
+ p2: ly
= py: tl
-p2
, 0: tl
0, p4: tl p2
, 0: lx
= px: ly
= py
+ p2: tl p1
+ 2 * gf
, 0 CASE "F": lx
= px
+ p2: ly
= py: tl
-p2
, 0: tl
0, p4: lx
= px: ly
= py
+ p2: tl p1
+ 2 * gf
, 0 CASE "G": ac px
+ p1
, py
+ p1
, 180, 345: ac px
+ p1
, py
+ p3
, 0, 180 lx = px: ly = py + p1: tl 0, p2: lx = px + p2: ly = py + p4 + gf: tl 0, -p2 - gf: tl -p1, 0
CASE "H": lx
= px: ly
= py: tl
0, p4: tl
0, -p2: tl p2
, 0: tl
0, p2: tl
0, -p4
CASE "I": lx
= px
+ p1
* .5: ly
= py: tl p1
, 0: lx
= px
+ p1
* .5: ly
= py
+ p4: tl p1
, 0: lx
= px
+ p1: ly
= py: tl
0, p4
CASE "J": ac px
+ p1
, py
+ p3
, 0, 180: lx
= px
+ p1
* 1.5: ly
= py: tl p1
* .5, 0: tl
0, p3
CASE "K": lx
= px: ly
= py: tl
0, p4: lx
= px
+ p2: ly
= py: tl
-p2
, p2: tl p2
, p2
CASE "L": lx
= px: ly
= py: tl
0, p4: tl p2
, 0 CASE "M": lx
= px: ly
= py
+ p4: tl
0, -p4: tl p1
, p2: tl p1
, -p2: tl
0, p4
CASE "N": lx
= px: ly
= py
+ p4: tl
0, -p4: tl p2
, p4: tl
0, -p4
CASE "O": ac px
+ p1
, py
+ p1
, 180, 360: ac px
+ p1
, py
+ p3
, 0, 180: lx
= px: ly
= py
+ p1: tl
0, p2: lx
= px
+ p2: ly
= py
+ p1: tl
0, p2
CASE "P": ac px
+ p1
, py
+ p1
, 270, 450: lx
= px
+ p1: ly
= py: tl
-p1
, 0: tl
0, p4: lx
= px: ly
= py
+ p2: tl p1
, 0 CASE "Q": ac px
+ p1
, py
+ p1
, 180, 360: ac px
+ p1
, py
+ p3
, 0, 180 lx = px: ly = py + p1: tl 0, p2: lx = px + p2: ly = py + p1: tl 0, p2: lx = px + p1: ly = py + p2: tl p1 + gf, p2 + gf
CASE "R": ac px
+ p1
, py
+ p1
, 270, 450: lx
= px
+ p1: ly
= py: tl
-p1
, 0: tl
0, p4: lx
= px: ly
= py
+ p2: tl p1
, 0: tl p1
, p2
CASE "S": ac px
+ p1
, py
+ p1
, 90, 360: ac px
+ p1
, py
+ p3
, 270, 540 CASE "T": lx
= px: ly
= py: tl p2
, 0: lx
= px
+ p1: ly
= py: tl
0, p4
CASE "U": ac px
+ p1
, py
+ p3
, 0, 180: lx
= px: ly
= py: tl
0, p3: lx
= px
+ p2: ly
= py: tl
0, p3
CASE "V": lx
= px: ly
= py: tl p1
, p4: tl p1
, -p4
CASE "W": lx
= px
- gf: ly
= py: tl gf
, p4: tl p1
, -p2: tl p1
, p2: tl gf
, -p4
CASE "X": lx
= px: ly
= py: tl p2
, p4: lx
= px
+ p2: ly
= py: tl
-p2
, p4
CASE "Y": lx
= px: ly
= py: tl p1
, p2: tl
0, p2: lx
= px
+ p2: ly
= py: tl
-p1
, p2
CASE "Z": lx
= px: ly
= py: tl p2
, 0: tl
-p2
, p4: tl p2
, 0
CASE "0": ac px
+ p1
, py
+ p1
, 180, 360: ac px
+ p1
, py
+ p3
, 0, 180: lx
= px: ly
= py
+ p1: tl
0, p2: tl p2
, -p2: tl
0, p2
CASE "1": lx
= px: ly
= py
+ p1: tl p1
, -p1: tl
0, p4: tl
-p1
, 0: tl p2
, 0 CASE "2": ac px
+ p1
, py
+ p1
, 180, 360: lx
= px
+ p2: ly
= py
+ p1: tl
-p2
, p3: tl p2
, 0 CASE "3": ac px
+ p1
, py
+ p1
, 180, 450: ac px
+ p1
, py
+ p3
, 270, 540 CASE "4": lx
= px
+ p1: ly
= py: tl
-p1
, p2: tl p2
, 0: tl
0, p2: lx
= px
+ p2: ly
= py: tl
0, p2
CASE "5": ac px
+ p1
, py
+ p3
, 270, 520: lx
= px
+ p1: tl
-p1
, 0: tl
0, -p2: tl p2
, 0 CASE "6": ac px
+ p1
, py
+ p3
, 0, 360: lx
= px: ly
= py
+ p3: tl p1
, -p3
CASE "7": lx
= px: ly
= py: tl p2
, 0: tl
-p1
, p4
CASE "8": ac px
+ p1
, py
+ p1
, 0, 360: ac px
+ p1
, py
+ p3
, 0, 360 CASE "9": ac px
+ p1
, py
+ p1
, 0, 360: lx
= px
+ p2: ly
= py
+ p1: tl
-p1
, p3
CASE ".": lx
= px: ly
= py
+ p4: tl gf
, 0: tl
0, -gf: tl
-gf
, 0: tl
0, gf
CASE "!": lx
= px: ly
= py
+ p4: tl gf
, 0: tl
0, -gf: tl
-gf
, 0: tl
0, gf:: lx
= px: ly
= py: tl
0, p2
CASE ",": lx
= px
+ gf: ly
= py
+ p4: tl
-gf
, 0: tl
0, -gf: tl gf
, 0: tl
0, gf: tl
-gf
, .5 * p1
+ gf
CASE "?": lx
= px
+ p1: ly
= py
+ p4: tl gf
, 0: tl
0, -gf: tl
-gf
, 0: tl
0, gf: ac px
+ p1
, py
+ p1
, 180, 450: lx
= px
+ p1: ly
= py
+ p2: tl
0, p1
- gf
'ac is for arc, x,y is radius center, das=degree angle start, dae=degree angle end
'note dr, drawing radius has to be global, use COLOR globally sets color
'note thick also made globals by POST sub
'local a,x1,y1,stepper
IF INT(thick
) = 0 THEN stepper
= 1 / (dr
* pi
) ELSE stepper
= (thick
/ 2) / (dr
* pi
/ 2) 'IF INT(thick) < 1 THEN PSET (x + x1, y + y1) ELSE fcirc x + x1, y + y1, thick, _DEFAULTCOLOR
'tl stands for thick line in the LINE STEP x,y format
SUB tl
(stepx
, stepy
) 'tl=thickline 'lastx, lasty globals for last drawn position
'thick has to be global
'note thick=0 still draws a line, use COLOR so line is drawn from this global
'local length,dx,dy,i
length = ((stepx) ^ 2 + (stepy) ^ 2) ^ .5
dx = stepx / (length * 2): dy = stepy / (length * 2)
lx = lx + stepx: ly = ly + stepy
Radius
= ABS(R
): RadiusError
= -Radius: X
= Radius: Y
= 0 LINE (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
LINE (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
LINE (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
LINE (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
LINE (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF