FontView 3
Posted: Sat Sep 23, 2017 9:42 pm
This is a big update. I am hoping this program can now run universally on all Windows devices. But it may need more tweaking.
Please give it a try and let me know how it works for you.
As you can see in the screenshot, I told FontView 3 to run on a 96 dpi screen instead of my actual tablet dpi of 144. Everything shrank by the right amount to fit.
Please give it a try and let me know how it works for you.
As you can see in the screenshot, I told FontView 3 to run on a 96 dpi screen instead of my actual tablet dpi of 144. Everything shrank by the right amount to fit.
Code: Select all
''
FontView 3 by rbytes
September 2017
View all of the fonts on your device
at any size you wish.
V3 resizes the interface to work
on any Windows 10 device
V2 improves the layout and improves
the button functions
''
' hide the control menu
'#.scrview(#.normal)
x,y = #.scrsize()
dp = #.scrdpi()
rw = dp/144 ; rh = dp/144
z = #.int(46*rw)
q = 0 ; base = 0
#.scrclear(.8,.8,.8)
#.drawcolor(0,0,1)
#.fillcolor(.8,.8,.8)
'p = #.array(300)
e = "The Quick Brown Fox Jumps Over The Lazy Dog"
l = #.fontlist() ; n = #.size(l,1)
'#.output(n)
#.drawsize(2)
#.drawrect(20*rw,20*rh,360*rw,366*rh)
t = #.textbox
> g, 1..n
d += g+": "+ l[g] + #.lf
<
t.width = 360*rw ; t.height = 346*rh ; t.text = d
t.x = 20*rw ; t.y = 20*rh ; t.multi = 1
#.show(t)
' create button template
h = #.button ; h.height = 50*rh
h.width = 100*rw ; h.y = 70*.rh
' create buttons from template
f,j,k = h ; f.x = 600*rw
j.x = 750*rw ; k.x = 900*rw
f.text = "S T O P" ; j.text = "P R E V"
k.text = "N E X T"
#.show(f,j,k)
' create sliders
sh,sv = #.slider ' font name slider and size slider
sh.x = 360*rw ; sh.y = 710*rh
sh.size = 600*rw ; sv.x = 360*rw
sv.y = 760*rh ; sv.value = 18*rw
sv.size = 600*rw
#.show(sh,sv)
#.fontsize = #.int(35*rw)
#.drawtext(180*rw,690*rh,"FONT NAME")
#.drawtext(180*rw,740*rh,"FONT SIZE")
' show first font in list
#.drawrect(450*rw,265*rh,1200*rw,365*rh)
#.fontname(l[1])
#.fontsize(#.int(46*rw))
#.drawtext(460*rw,275*rh,l[1])
#.drawtext(20*rw,400*rh+base,e)
' show font reference number and point size
#.drawrect(450*rw,205*rh,1200*rw,265*rh)
#.fontsize(#.int(35*rw))
#.fontname(#.default)
#.drawline(825*rw,205*rh,825*rw,265*rh)
#.drawtext(460*rw,205*rh,"Font Ref. #:")
#.drawtext(835*rw,205*rh,"Font Size:")
#.drawtext(695*rw,205*rh,q+1)
#.drawtext(1060*rw,205*rh,z)
' main program loop
>
? #.act(sh) ' font name slider
q = #.int((sh.value*(n-1))/100)
print <->
.
? #.act(sv) ' size slider
z = #.int((sv.value*2 + 10)*rw)
print <->
.
? #.act(f) ' stop button
#.end()
.
? #.act(j) ' prev button
? q > 0
q -= 1
sh.value=(q*100)/(n-1)
print <->
.
.
? #.act(k) ' next button
? q < n -1
q += 1
sh.value=(q*100)/(n-1)
print <->
.
.
<
:print ' draw font subroutine
#.fillrect(452*rw,267*rh,1198*rw,363*rh)
#.fontsize(46*rw)
#.fontname(l[q+1])
? l[q+1] = "Gabriola" & z > 120
base=-90*rh
!
base=0
.
#.drawtext(460*rw,275*rh,l[q+1])
#.fillrect(0*rw,390*rh,x,y-120)
#.fontsize(z)
#.drawtext(20*rw,400*rh+base,e)
#.fillrect(680*rw,210*rh,820*rw,260*rh)
#.fillrect(1020*rw,210*rh,1198*rw,260*rh)
#.fontsize(#.int(35*rw))
#.fontname(#.default)
#.drawtext(695*rw,205*rh,q+1)
#.drawtext(1060*rw,205*rh,z)
<-