Font Names
Posted: Tue Sep 19, 2017 2:27 am
Mr. K, I adapted your nice shading code for this demo, and added a hard black edge on the bottom and right of the letters.
Only some of the fonts I used are standard Windows fonts. The rest are available as free downloads from 1001fonts.com
Check the code for the line that names all of the fonts. Once you have them in your downloads folder, click on each .ttf font file. Windows will ask if you want to install it (if it is a .zip file you will be prompted to unpack it first.)
Only some of the fonts I used are standard Windows fonts. The rest are available as free downloads from 1001fonts.com
Check the code for the line that names all of the fonts. Once you have them in your downloads folder, click on each .ttf font file. Windows will ask if you want to install it (if it is a .zip file you will be prompted to unpack it first.)
Code: Select all
''
Font Names 2 by rbytes
September 2017
Only half of the fonts in the list below are standard windows fonts. You can download
the others free from 1001fonts.com
''
' Create a list of 10 varied fonts on your device and split them into an array. This is my list.
text = "Courier New,Arial,Papyrus,Comic Sans,Gill Sans,01 Digit,Ranchers,Script MT,Segoe Print,Stencil"
words = #.split(text, ",")
' These are y shift values to even out the varied vertical spacing of different fonts
' you start with them all at 0 and change them to plus or minus values as needed. They are also split to an array.
text = "0,0,0,5,15,35,20,25,0,30"
shifts = #.split(text, ",")
' Set the text and font size
t="The Quick Brown Fox"
#.fontsize(80)
' Create a nested loop. the outer loop draws each of the 10 fonts. The inner loop adds shading
' above and left of each row of text
z,n = 10
> y, 1..10
z=1
> i, 1..n
z *= 1.11
nam = words[y]
shift = #.val(shifts[y])
#.fontname(nam)
' the next two lines draw each row of the text in black
#.drawcolor(0,0,0)
#.drawtext(20+4+10,(y - 1) * 74 + shift+4+10,t)
' the next two lines draw on top of the black text, covering all except a black border
' below and to the right of the text
#.drawcolor(#.hsv2rgb(y*36,i/n,i/n):3,n/10)
#.drawtext(20+z+i,(y - 1) * 74 + shift+z+i,t) 'draws text t at point x,y using current drawing
#.delay(0.04)
<
<