Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yellow notebook paper background (scales to fit font setting)
#17
And I add for you an accounting ledger, as per the ones which I remember seeing and using in my youth:

Code: (Select All)

'notebookpapers2.bas

'yellow, white & spiral background notebook paper.
'by Dav, OCT/2023
$COLOR:32
SCREEN _NEWIMAGE(800, 600, 32)

'Here's where you can load another font you want to use....
fnt& = _LOADFONT("lucon.ttf", 24, "monospace")
_FONT fnt&

'Call the SUB, with your title$ message
'YellowPaper "John's QB64-PE Code Notebook" '<< this one for yellow paper
'WhitePaper "John's QB64-PE Code Notebook" '<< this one for white paper
'SpiralPaper "John's Spiral Notebook" '<< use this one for spiral paper
Ledger "Steve's Accounting Ledger"
SLEEP
END

'You need to call below so PRINTing text doesn't destroy background.
_PRINTMODE _KEEPBACKGROUND

'=== show some sample information....
COLOR _RGB(64, 64, 64)
FOR y = 5 TO 16
LOCATE y, 2: PRINT DATE$;
LOCATE , 16: PRINT "Random Data ="; RND; RN;
NEXT: PRINT

'Use location 2 to print in left column, 16 for printing in the text lines.

PRINT
LOCATE , 16: PRINT "This is another line."
PRINT
LOCATE , 2: PRINT "Tuesday:"
LOCATE , 16: PRINT "Dear diary, today I wrote this...."
SLEEP

SUB YellowPaper (title$)

'This SUB draws yellow notebook paper, scaled to fit current font settings.
'It also prints and centers title$ in the top title area.

fw = _FONTWIDTH: fh = _FONTHEIGHT 'get current font width/height settings
'(the fw & fh we will use to calculate LINE drawing so they line up right with PRINT)

CLS , _RGB(255, 245, 154) 'clear screen to yellow color

'draw the two vertical brown lines, to make column/text area
LINE (fw * 12, 0)-(fw * 12, _HEIGHT), _RGB(205, 185, 98)
LINE (fw * 12.5, 0)-(fw * 12.5, _HEIGHT), _RGB(205, 185, 98)

'draw the text lines to bottom of screen
FOR y = fh - 1 TO _HEIGHT STEP fh
LINE (0, y)-(_WIDTH, y), _RGB(152, 160, 74)
NEXT

IF title$ <> "" THEN

'draw top brown tile area (remove this if not wanted)
LINE (0, 0)-(_WIDTH, fh * 3), _RGB(102, 19, 15), BF '<< enough for 3 lines
COLOR _RGB(255, 255, 0), _RGB(102, 19, 15)

'Next we print title$, centering the text in the top area
'For this we need to calcuale how many letters fit on one line, INT(_WIDTH/fw) / 2.
'I divided that by 2 to find the center spot on the line.
'So, subtract half of the title$ length from that spot to make it centered nice.
LOCATE 2, INT((_WIDTH / fw) / 2) - INT(LEN(title$) / 2)
PRINT title$; 'finally, PRINT the title$
END IF

END SUB

SUB WhitePaper (title$)
'This SUB draws white notebook paper, scaled to fit current font settings.

fw = _FONTWIDTH: fh = _FONTHEIGHT 'get current font width/height settings
'(the fw & fh we will use to calculate LINE drawing so they line up right with PRINT)

CLS , _RGB(240, 240, 240) 'clear screen to white color

'draw three holes
CIRCLE (fw * 8, fh * 8), fw * 2, _RGB(210, 210, 210)
PAINT (fw * 8 + 1, fh * 8 - 1), _RGB(210, 210, 210)

CIRCLE (fw * 8, fh * 20), fw * 2, _RGB(210, 210, 210)
PAINT (fw * 8 + 1, fh * 20 - 1), _RGB(210, 210, 210)

CIRCLE (fw * 8, fh * 32), fw * 2, _RGB(210, 210, 210)
PAINT (fw * 8 + 1, fh * 32 - 1), _RGB(210, 210, 210)

'draw the vertical line, to make column/text area
LINE (fw * 12, 0)-(fw * 12, _HEIGHT), _RGB(219, 135, 151)

'draw the text lines to bottom of screen
FOR y = fh * 5 TO _HEIGHT STEP fh
LINE (0, y)-(_WIDTH, y), _RGB(139, 179, 204)
NEXT

IF title$ <> "" THEN
'Next we print title$, centering the text in the top area
'For this we need to calcuale how many letters fit on one line, INT(_WIDTH/fw) / 2.
'I divided that by 2 to find the center spot on the line.
'So, subtract half of the title$ length from that spot to make it centered nice.
LOCATE 2, INT((_WIDTH / fw) / 2) - INT(LEN(title$) / 2)
COLOR _RGB(0, 0, 0), _RGB(240, 240, 240)
PRINT title$; 'finally, PRINT the title$
END IF

END SUB

SUB SpiralPaper (title$)
'This SUB draws spiral white notebook paper, scaled to fit current font settings.

fw = _FONTWIDTH: fh = _FONTHEIGHT 'get current font width/height settings
'(the fw & fh we will use to calculate LINE drawing so they line up right with PRINT)

CLS , _RGB(32, 32, 32)
LINE (fw * 3.5, 0)-(_WIDTH, _HEIGHT), _RGB(240, 240, 240), BF
FOR y = 0 TO _HEIGHT STEP fh
CIRCLE (fw * 4, y), fw * 2, _RGB(164, 164, 164), .6, _PI * 1.4
CIRCLE (fw * 5.6, y + (fh / 3)), fw / 2, _RGB(0, 0, 0)
PAINT (fw * 5.6 + 2, y + (fh / 3) - 2), _RGB(0, 0, 0)
NEXT

'draw the vertical line, to make column/text area
LINE (fw * 16, 0)-(fw * 16, _HEIGHT), _RGB(219, 135, 151)

'draw the text lines to bottom of screen
FOR y = fh * 5 TO _HEIGHT STEP fh
LINE (fw * 3.5, y)-(_WIDTH, y), _RGB(139, 179, 204)
NEXT

IF title$ <> "" THEN
'Next we print title$, centering the text in the top area
'For this we need to calcuale how many letters fit on one line, INT(_WIDTH/fw) / 2.
'I divided that by 2 to find the center spot on the line.
'So, subtract half of the title$ length from that spot to make it centered nice.
LOCATE 2, INT((_WIDTH / fw) / 2) - INT(LEN(title$) / 2) + 4 '<< added 4 for spiral offset
COLOR _RGB(0, 0, 0), _RGB(240, 240, 240)
PRINT title$; 'finally, PRINT the title$
END IF

END SUB

SUB Ledger (title$)
'This SUB draws a sepia accounting ledger, scaled to fit current font settings.

fw = _FONTWIDTH: fh = _FONTHEIGHT 'get current font width/height settings
'(the fw & fh we will use to calculate LINE drawing so they line up right with PRINT)

CLS , _RGB(32, 32, 32)

LINE (0, 0)-(_WIDTH, _HEIGHT), Sepia, BF

'draw the vertical line, to make column/text area
FOR x = 0 TO _WIDTH STEP fw
LINE (x, fh * 2)-STEP(0, _HEIGHT), _RGB(139, 179, 204)
NEXT
LINE (fw * 16, 0)-(fw * 16, _HEIGHT), _RGB(219, 135, 151)
LINE (_WIDTH - (fw * 16), 0)-STEP(0, _HEIGHT), _RGB(219, 135, 151)

'draw the text lines to bottom of screen
FOR y = fh * 2 TO _HEIGHT STEP fh
LINE (0, y)-(_WIDTH, y), _RGB(139, 179, 204)
NEXT

IF title$ <> "" THEN
'Next we print title$, centering the text in the top area
'I divided that by 2 to find the center spot on the line.
'So, subtract half of the title$ length from that spot to make it centered nice.
COLOR _RGB(64, 64, 64), 0
_PRINTSTRING ((_WIDTH - _PRINTWIDTH(title$)) / 2, 1), title$
END IF
COLOR _RGB(120, 120, 120), 0
_PRINTSTRING (0, fh), "Date"
_PRINTSTRING (fw * 16, fh), "Description"
_PRINTSTRING (_WIDTH - (fw * 16), fh), "Amount"
END SUB

The grids are so that amounts all align properly in the final column, all nice and neatly for folks who like to print in these things. I remember having to use these to track such things as mileage and expenses while out on project, so that I could turn them in all nice and neat to accounting when I got back home from being out on the road.

Honestly, I don't remember if the date/description/amount titles were centered, or not. I think, if my memory isn't failing, the booklets we had were printed cheaply and left centered as I've did these, but they'd be easy enough to center in their respective areas, if anyone ever wanted.
Reply


Messages In This Thread
RE: Yellow notebook paper background (scales to fit font setting) - by SMcNeill - 10-11-2023, 06:34 PM



Users browsing this thread: 9 Guest(s)