Custom FB Fonts

For other topics related to the FreeBASIC project or its community.
vdecampo
Posts: 2982
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Custom FB Fonts

Postby vdecampo » Feb 21, 2011 15:45

Has anyone created any custom fonts using the native Draw String font system? If so, would you be willing to share one for study and learning purposes?

-Vince
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Feb 21, 2011 16:23

You would be better off storing the letters in a bitmap and then blitting them to the screen. At least then you could scale them without creating an individual font type for every size.

You could even shear them for italics, and scale up a small portion for bold.

My opine. I don't like the draw string system for fonts.
vdecampo
Posts: 2982
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Postby vdecampo » Feb 21, 2011 16:52

@rollie
Thanks but I am well aware of that method. :)

-Vince
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Feb 21, 2011 21:10

dodicat
Posts: 5938
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Custom FB Fonts

Postby dodicat » Feb 22, 2011 1:03

vdecampo wrote:Has anyone created any custom fonts using the native Draw String font system? If so, would you be willing to share one for study and learning purposes?

-Vince


I've put this together after simplification from a 3d routine

Code: Select all

Type point2d
    As Single x,y
    As Uinteger col
End Type
Type retainer
    As Single minx,miny,maxx,maxy
    As Long pixels
End Type
declare function rotatepoint2d(pivot As point2d,_
                         _point as point2d,_
                          angle As Double,_
                        dilator as double=1) as point2d
declare Sub scan_for_image(background As Uinteger,c As retainer)
declare  Sub scaleimage(pivot As point2d,size As Single,angle As double)                       
declare sub drawfont(x as integer,_
                     y as integer,_
                     text as string,_
                     colour as uinteger,_
                     size as single,_
                    angle as single=0)
 
Redim Shared As point2d infoarray(0)           'required in all cases
dim shared as uinteger background               ' -''-
background=rgb(255,255,255)                    'optional colour

'__________________________________________________
Screen 19,32',,1                               'fullscreen if wanted
paint (0,0),background                         'optional

draw string (100,10),"normal size",rgb(0,0,200)
drawfont(100,50,"Two times size",rgb(200,0,0),2)
drawfont(100,100,"Four times size",rgb(255,200,0),4)
drawfont(10,200,"3.5 times size at 10 degrees",rgb(0,200,0),3.5,10)
drawfont(0,400,"GOODNIGHT! (5 Times)",rgb(0,0,0),5)
 sleep
 '________________________________________________

'To scale/rotate
function rotatepoint2d(pivot As point2d,_
                         _point as point2d,_
                          angle As Double,_
                        dilator as double=1) as point2d
      Dim pi As Double=4*Atn(1)
    #define rad *pi/180
dim as point2d np=_point
np.x=dilator*(Cos(angle rad)*(_point.x-pivot.x)-Sin(angle rad)*(_point.y-pivot.y)) +pivot.x
np.y=dilator*(Sin(angle rad)*(_point.x-pivot.x)+Cos(angle rad)*(_point.y-pivot.y)) +pivot.y
return np
End function
'pixel scan across text
 Sub scan_for_image(background As Uinteger,c As retainer)
                    Dim count As Long
                   
                    For x As Integer=c.minx To c.maxx Step 1
                        For y As Integer=c.miny To c.maxy Step 1
                            If Point(x,y)<>background Then
                                count=count+1
                                Redim Preserve infoarray(count)
                                infoarray(count).x=x
                                infoarray(count).y=y
                                infoarray(count).col=Point(x,y)
                            End If
                        Next y
                    Next x
                End Sub
               
         'draw the new font     
                Sub scaleimage(pivot As point2d,size As Single,angle As double)
                    Dim As point2d cpt(Ubound(infoarray))
                    For z As Integer=1 To Ubound (infoarray)
                        cpt(z)=rotatepoint2d(pivot,infoarray(z),angle,size)
                    Next z
                    'DRAW
                    dim sz as single=size/2
                    For z As Integer=1 To Ubound(infoarray)
                   
                        Line(cpt(z).x-sz,cpt(z).y-sz)-(cpt(z).x+sz,cpt(z).y+sz),cpt(z).col,BF
                    Next z
                End Sub
               
   sub drawfont(x as integer,y as integer,text as string,colour as uinteger,size as single,angle as single=0)
       dim as integer xres,yres
       'dim as uinteger background=rgb(0,0,1)
       screeninfo xres,yres
   dim c as point2d
   c=type<point2d>(x,y)
   Dim  scanline As retainer
   scanline= type<retainer>(x,y,8*size*len(text),y+8*size)
  Line(scanline.minx,scanline.miny)-(scanline.maxx,scanline.maxy),background,BF
        Draw String(x,y),text,colour
        scan_for_image(background,scanline)
        draw string(x,y),text,background
        scaleimage(c,size,angle)
    end sub
 
 
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Postby agamemnus » Feb 22, 2011 1:24

An old qb sub. I may have stolen some characters from some other game.

Code: Select all

SUB print2 (xloc%, yloc%, word$, wcolor%, char.size%, xsize%, ysize%, xadj%, yadj%)
x = xadj% + xloc% * xsize%
y = 2 + yadj% + yloc% * ysize%
IF CENTER = 1 THEN word$ = SPACE$(25 - LEN(word$) / 2) + word$

DRAW "S" + str2$(char.size%)
FOR t = 1 TO LEN(word$)
word$ = UCASE$(word$)
a$ = MID$(word$, t, 1)
SELECT CASE a$
CASE IS = "A"
LET$ = "u3erfd3u2l3"
CASE IS = "B"
LET$ = "u4r2fgl2r2fgl2"
CASE IS = "C"
LET$ = "BM" + STR$(x + 3) + "," + STR$(y) + "BRL2hu2er2"
CASE IS = "D"
LET$ = "u4r2fd2gl2"
CASE IS = "E"
LET$ = "u4r3l3d2r2l2d2r3"
CASE IS = "F"
LET$ = "u4r3l3d2r2"
CASE IS = "G"
LET$ = "u4r3l3d4r3u2l"
CASE IS = "H"
LET$ = "u4d2r3u2d4"
CASE IS = "I"
LET$ = "r2lu4rl2"
CASE IS = "J"
LET$ = "udr2u4rl3"
CASE IS = "K"
LET$ = "u4d2re2g2f2"
CASE IS = "L"
LET$ = "r3l3u4"
CASE IS = "M"
LET$ = "u4f2e2d4"
CASE IS = "N"
LET$ = "u4f3bfblu4"
CASE IS = "O"
LET$ = "u4r3d4l3"
CASE IS = "P"
LET$ = "u4r2fgl2"
CASE IS = "Q"
LET$ = "u4r3d4l3r3h"
CASE IS = "R"
LET$ = "u4r2fgl2rf2"
CASE IS = "S"
LET$ = "r2ehlher2"
CASE IS = "T"
LET$ = "BM" + STR$(x + 1) + "," + STR$(y) + "u4lr2"
CASE IS = "U"
LET$ = "BM" + STR$(x) + "," + STR$(y - 4) + "BU2d3freu3"
CASE IS = "V"
LET$ = "BM" + STR$(x) + "," + STR$(y - 4) + "BU2dfdfeueu"
CASE IS = "W"
LET$ = "BM" + STR$(x) + "," + STR$(y) + "BUU3d3feu2d2feu3"
CASE IS = "X"
LET$ = "e4g2h2f4"
CASE IS = "Y"
LET$ = "BM" + STR$(x + 1) + "," + STR$(y) + "u2hudfeu"
CASE IS = "Z"
LET$ = "r3l3e3ul3"
CASE IS = "1"
LET$ = "r2lu4g"
CASE IS = "2"
LET$ = "r3l3e3ul3d"
CASE IS = "3"
LET$ = "r2ehlrehl2"
CASE IS = "4"
LET$ = "BM" + STR$(x + 6) + "," + STR$(y) + "U4d2l3u2"
CASE IS = "5"
LET$ = "r2ehl2u2r3"
CASE IS = "6"
LET$ = "r3u2l3du3r3"
CASE IS = "7"
LET$ = "BM" + STR$(x + 4) + "," + STR$(y) + "u2eul3d"
CASE IS = "8"
LET$ = "r3u2l3d2u4r3d2"
CASE IS = "9"
LET$ = "r3u4l3d2r3"
CASE IS = "0"
LET$ = "r3u4l3d4e3"
CASE IS = "/"
LET$ = "E4"
CASE IS = ":"
LET$ = "BM" + STR$(x + 1) + "," + STR$(y - 1) + "ULDRBU2ULDR"
CASE IS = "."
LET$ = "BM" + STR$(x + 1) + "," + STR$(y) + "r"
CASE IS = " "
LET$ = ""
CASE IS = "?"
LET$ = "BM" + STR$(x + 1) + "," + STR$(y) + "NURULBUUR2U2L2D"
CASE IS = "'"
LET$ = "BM" + STR$(x + 1) + "," + STR$(y - 2) + "e2"
CASE IS = ","
LET$ = "BM" + STR$(x + 3) + "," + STR$(y) + "g2"
CASE IS = "!"
LET$ = "BM" + STR$(x + 2) + "," + STR$(y) + "URDLBU2U2RDNG"
CASE IS = "("
LET$ = "BM" + STR$(x + 1) + "," + STR$(y + 1) + "HU2E"
CASE IS = ")"
LET$ = "BM" + STR$(x + 1) + "," + STR$(y + 1) + "EU2H"
CASE IS = "-"
LET$ = "Bu2r4"
CASE IS = "#"
LET$ = "BRU4BGR4BHD4BEL4"
CASE IS = "$"
LET$ = "BR2BDU6BGNR2D2R2D2L2"
CASE IS = "%"
LET$ = "E4BG2BHULDRBF2DRUL"
CASE IS = "^"
LET$ = "BU3BREF"
CASE IS = "&"
LET$ = "BR3BDUH3UERFG3DFRE2"
CASE IS = "*"
LET$ = "BUE2GNFH"
CASE IS = "+"
LET$ = "BEU2DNRL"
CASE IS = "<"
LET$ = "H2E2"
CASE IS = ">"
LET$ = "E2H2"
CASE IS = "="
LET$ = "BU2R3BDL3"
END SELECT

IF LET$ <> "" THEN
DRAW "BM" + STR$(x) + "," + STR$(y) + "c" + STR$(wcolor%) + LET$
END IF
x = x + xsize%
NEXT
END SUB
Sisophon2001
Posts: 1704
Joined: May 27, 2005 6:34
Location: Cambodia, Thailand, Lao, Ireland etc.
Contact:

Postby Sisophon2001 » Feb 22, 2011 5:48

I have one program using a custom draw string font you can use.

The full source is here.
http://weekendcode.phatcode.net/files/fbskb_1.5.zip

if the direct link does not work you might have to follow the links on the website. http://weekendcode.phatcode.net

Garvan
HD_
Posts: 215
Joined: Jun 10, 2006 12:15
Contact:

Postby HD_ » Feb 22, 2011 7:59

I think there are some font converters out there. I made one, but mine was pretty cruddy.
vdecampo
Posts: 2982
Joined: Aug 07, 2007 23:20
Location: Maryland, USA
Contact:

Postby vdecampo » Feb 22, 2011 11:54

Sisophon2001 wrote:I have one program using a custom draw string font you can use.


Thanks! That is exactly what I needed!

-Vince
rdc
Posts: 1713
Joined: May 27, 2005 17:22
Location: Texas, USA
Contact:

Postby rdc » Feb 22, 2011 18:58

Jofers made a Win program to convert a TTF font to a DrawString font. Some folks here updated the prog to work on the updated version of FB. I use it all the time. You can grab it here:

http://www.freebasic.net/forum/viewtopic.php?t=4805

If you look at the code, you can see how to create the bitmap so it works with DrawString.
dodicat
Posts: 5938
Joined: Jan 10, 2006 20:30
Location: Scotland

Postby dodicat » Feb 22, 2011 19:39

rolliebollocks wrote:You would be better off storing the letters in a bitmap and then blitting them to the screen. At least then you could scale them without creating an individual font type for every size.

You could even shear them for italics, and scale up a small portion for bold.

My opine. I don't like the draw string system for fonts.

Hi Rollie
This is a thread for heros, so I'll butt out now, in the pink.

Code: Select all



#include "fbgfx.bi"
declare Sub rotate(Byval pivot_x As Double,_   'turns about this point
           Byval pivot_y As Double,_
           Byval first_x As Double,_    'centre for circles
           Byval first_y As Double,_
           Byval second_x As Double, _   'radius for circles
           Byval second_y As Double, _   'aspect
           byval arc_1 as double,_       'arcs only for circle, 0 for lines
           byval arc_2 as double,_
           Byval angle As Double, _      'all below for circles and lines
           Byval magnifier As Double,_
           Byval dilator as double,_
           Byval colour As Integer,_
           byval thickness as double,_
           Byref shape As String,_
           image as any pointer=0)
        Dim Shared np(1 To 4) As Double   
 declare  sub paintstring(x as double,_
           y as double,_
           s as string,_
           size as double,_
           c as uinteger,_
           line_angle as double=0,_
           char_angle as double=0,_
           thickness_tweak as double=1,_
           image as any pointer=0)
  ' ___________________________________________________________         
   Dim Shared As Integer topleftx,toplefty,wx,wy
   screencontrol fb.GET_DESKTOP_SIZE, wx, wy
   topleftx=wx-500:toplefty=wy/3
  Screenres 5000,300,32,1,FB.GFX_SHAPED_WINDOW Or FB.GFX_ALWAYS_ON_TOP         
   screencontrol fb.SET_WINDOW_POS,topleftx, toplefty       
  dim as any pointer image
 image= imagecreate (5000,300,rgb(255,0,255))
 dim s as string
 s="The moving finger writes; "
 s=s+"and, having writ moves on:"
 s=s+" nor all thy Piety nor wit "
 s=s+"shall lure it back to cancel half a line, "
 s=s+"Nor all thy Tears wash out a word of it."
 for n as double=.9 to 1 step .01
  paintstring(10+50*n,100-50*n,s,1,rgb(2550*(n-.9),100,2550*(n-.9)),0,0,n,image)
  next n
  do
      screenlock
      cls
  put(0,0),image,pset
  topleftx=topleftx-2
  screencontrol fb.SET_WINDOW_POS,topleftx, toplefty
  screenunlock
  if topleftx<-5000 then topleftx=wx
  sleep 1,1
loop until inkey=chr(27)
imagedestroy image
 '_____________________________________________________         
 sleep         
           
 'SUBS________________________________         
Sub rotate(Byval pivot_x As Double,_   'turns about this point
           Byval pivot_y As Double,_
           Byval first_x As Double,_    'centre for circles
           Byval first_y As Double,_
           Byval second_x As Double, _   'radius for circles
           Byval second_y As Double, _   'aspect
           byval arc_1 as double,_       'arcs only for circle, 0 for lines
           byval arc_2 as double,_
           Byval angle As Double, _      'all below for circles and lines
           Byval magnifier As Double,_
           Byval dilator as double,_
           Byval colour As Integer,_
           byval thickness as double,_
           Byref shape As String,_
           image as any pointer=0)
           'rotated line is  (np(1),np(2))-(np(3),np(4))
           'rotated circle centre is np(3),np(4)
           'shape:
           'line - draws the line
           'linepoint - does the calculation, draws nothing
           'linepointset - does the calculations, sets a pixel at the line ends
           'ALSO circle,circlepoint, circlepointset,box, boxfill, circlefill.
           'arcs from horizontal positive x axis in DEGREES
           'arc1<arc2 always e.g from 330 to 430
  shape=lcase$(shape)     
Dim p As Double = 4*Atn(1)  '(pi)
Dim radians As Double
Dim line_xvector As Double
Dim line_yvector As Double
Dim pivot_xvector As Double
Dim pivot_yvector As Double
Dim th As Double
  th=thickness
  Dim sx As Double=second_x
  angle=angle mod 360
radians=(2*p/360)*angle      'change from degrees to radians
#Macro thickline(t)
Dim As Double s,h,c
Dim As Uinteger prime=rgb(255,255,255)
h=Sqr(((np(1))-(np(3)))^2+((np(2))-(np(4)))^2)
s=((np(4))-np(2))/h
c=(np(1)-(np(3)))/h
line image, (np(3)+s*t/2,np(4)+c*t/2)-(np(1)+s*t/2,np(2)+c*t/2),prime
line image, (np(3)-s*t/2,np(4)-c*t/2)-(np(1)-s*t/2,np(2)-c*t/2),prime
line image, (np(3)+s*t/2,np(4)+c*t/2)-(np(3)-s*t/2,np(4)-c*t/2),prime
line image, (np(1)+s*t/2,np(2)+c*t/2)-(np(1)-s*t/2,np(2)-c*t/2),prime
paint image,((np(3)+np(1))/2, (np(4)+np(2))/2),prime,prime

line image, (np(3)+s*t/2,np(4)+c*t/2)-(np(1)+s*t/2,np(2)+c*t/2),colour
line image, (np(3)-s*t/2,np(4)-c*t/2)-(np(1)-s*t/2,np(2)-c*t/2),colour
line image, (np(3)+s*t/2,np(4)+c*t/2)-(np(3)-s*t/2,np(4)-c*t/2),colour
line image, (np(1)+s*t/2,np(2)+c*t/2)-(np(1)-s*t/2,np(2)-c*t/2),colour
paint image,((np(3)+np(1))/2, (np(4)+np(2))/2), colour, colour
#EndMacro

#macro thickcircle(t)
Dim As Uinteger prime=rgb(255,255,255)
dim as double xp1,xp2,yp1,yp2
dim arc1 as double=arc_1*p/180
dim arc2 as double=arc_2*p/180
arc1=2*p+(arc1-(radians))
arc2=2*p+(arc2-(radians))
sx=sx*magnifier
if arc1=arc2 then
     circle image,(np(3),np(4)),sx+t/2,prime,,,second_y
    circle image,(np(3),np(4)),sx-t/2,prime,,,second_y
    paint image,(np(3),np(4)+sx),prime,prime
    paint image,(np(3)+sx,np(4)),prime,prime
    circle image,(np(3),np(4)),sx+t/2,colour,,,second_y
    circle image,(np(3),np(4)),sx-t/2,colour,,,second_y
    paint image,(np(3),np(4)+sx),colour,colour
    paint image,(np(3)+sx,np(4)),colour,colour
end if
if arc1<>arc2 then
    xp1=np(3)+(sx)*cos(.5*(arc2+arc1))
yp1=np(4)-(sx)*sin(.5*(arc2+arc1))
circle image,(np(3),np(4)),sx+t/2,prime,arc1,arc2,second_y
    circle image,(np(3),np(4)),sx-t/2,prime,arc1,arc2,second_y
    line image,(np(3)+(sx+t/2)*cos(arc1),np(4)-(sx+t/2)*sin(arc1))-(np(3)+(sx-t/2)*cos(arc1),np(4)-(sx-t/2)*sin(arc1)),prime
    line image,(np(3)+(sx+t/2)*cos(arc2),np(4)-(sx+t/2)*sin(arc2))-(np(3)+(sx-t/2)*cos(arc2),np(4)-(sx-t/2)*sin(arc2)),prime

    paint image,(xp1,yp1),prime,prime
   
circle image,(np(3),np(4)),sx+t/2,colour,arc1,arc2,second_y
    circle image,(np(3),np(4)),sx-t/2,colour,arc1,arc2,second_y
    line image,(np(3)+(sx+t/2)*cos(arc1),np(4)-(sx+t/2)*sin(arc1))-(np(3)+(sx-t/2)*cos(arc1),np(4)-(sx-t/2)*sin(arc1)),colour
    line image,(np(3)+(sx+t/2)*cos(arc2),np(4)-(sx+t/2)*sin(arc2))-(np(3)+(sx-t/2)*cos(arc2),np(4)-(sx-t/2)*sin(arc2)),colour

    paint image,(xp1,yp1),colour,colour
   
end if
#endmacro

magnifier=dilator*magnifier     
pivot_xvector=first_x-pivot_x
pivot_yvector=first_y-pivot_y
pivot_xvector=dilator*pivot_xvector 
pivot_yvector=dilator*pivot_yvector
Dim mover(1 To 2,1 To 2) As Double
Dim new_pos(1 To 2) As Double
mover(1,1)=Cos(radians)
mover(2,2)=Cos(radians)
mover(1,2)=-Sin(radians)
mover(2,1)=Sin(radians)

line_xvector=magnifier*(second_x-first_x)                   'get the vector
line_yvector=magnifier*(second_y-first_y)                   'get the vector

new_pos(1)=mover(1,1)*pivot_xvector+mover(1,2)*pivot_yvector +pivot_x
new_pos(2)=mover(2,1)*pivot_xvector+mover(2,2)*pivot_yvector +pivot_y
Dim new_one(1 To 2) As Double            'To hold the turned value

new_one(1)=mover(1,1)*line_xvector+mover(1,2)*line_yvector +first_x
new_one(2)=mover(2,1)*line_xvector+mover(2,2)*line_yvector +first_y
Dim xx As Double   'translation
Dim yy As Double
xx=first_x-new_pos(1)
yy=first_y-new_pos(2)
np(1)=new_one(1)-xx 
  np(2)=new_one(2)-yy   
  np(3)=first_x-xx
 np(4)=first_y-yy
Select Case shape
Case "line"
    If th<2 Then
 line image,(np(3),np(4))-(np(1),np(2)),colour
Else
 thickline(th)   
 End If
Case "circle"
    dim arc1 as double=arc_1*p/180
dim arc2 as double=arc_2*p/180
    if arc1=arc2 then
    If th<=3 Then
        for n as double=magnifier*sx-1 to magnifier*sx+1 step .5
     circle image,(np(3),np(4)),n,colour,,,second_y       
 'circle image,(np(3),np(4)),magnifier*sx,colour,,,second_y
 next n
Else
 thickcircle(th)
End If
endif
if arc1<>arc2 then
If th<=3 Then
    arc1=2*p+(arc1-(radians))'new
arc2=2*p+(arc2-(radians))'new
    for n as double=magnifier*sx-1 to magnifier*sx+1 step .5
     circle image,(np(3),np(4)),n,colour,arc1,arc2,second_y   
   ' circle image,(np(3),np(4)),magnifier*sx,colour,arc1,arc2,second_y
    next n
else
    thickcircle(th)
end if
end if
Case "circlefill"
    dim as double xp1,xp2,yp1,yp2
Dim As Uinteger prime=rgb(255,255,255)
dim arc1 as double=arc_1*p/180
dim arc2 as double=arc_2*p/180
if arc1=arc2 then circle image,(np(3),np(4)),magnifier*sx,colour,,,second_y,F
if arc1<>arc2 then

 xp1=np(3)+magnifier*sx*cos(.5*(arc2+arc1))*3/4
yp1=np(4)-magnifier*sx*sin(.5*(arc2+arc1))*3/4   
circle image,(np(3),np(4)),magnifier*sx,prime,arc1,arc2,second_y
line image,(np(3),np(4))-(np(3)+magnifier*sx*cos(arc2),np(4)-magnifier*sx*sin(arc2)),prime
line image,(np(3),np(4))-(np(3)+magnifier*sx*cos(arc1),np(4)-magnifier*sx*sin(arc1)),prime
paint image,(xp1,yp1),prime,prime

circle image,(np(3),np(4)),magnifier*sx,colour,arc1,arc2,second_y
line image,(np(3),np(4))-(np(3)+magnifier*sx*cos(arc2),np(4)-magnifier*sx*sin(arc2)),colour
line image,(np(3),np(4))-(np(3)+magnifier*sx*cos(arc1),np(4)-magnifier*sx*sin(arc1)),colour
paint image,(xp1,yp1),colour,colour
end if
 Case"box"
 line image,(np(3),np(4))-(np(1),np(2)),colour,b
Case "boxfill"
 line image,(np(3),np(4))-(np(1),np(2)),colour,bf
        Case "linepoint","circlepoint"
  'nothing drawn
Case "linepointset","circlepointset"
 If shape="linepointset" Then
 Pset image,(np(1),np(2)),colour
 Pset image,(np(3),np(4)),colour
 Endif
 If shape="circlepointset" Then
     Pset image,(np(3),np(4)),colour
 End If

        Case Else
 Print "unknown rotation shape"
End Select
End Sub
dim shared as double next_x,next_y


sub paintstring(x as double,_
           y as double,_
           s as string,_
           size as double,_
           c as uinteger,_
           line_angle as double=0,_
           char_angle as double=0,_
           thickness_tweak as double=1,_
           image as any pointer=0)
dim l as integer=len(s)
dim px as double=16*size+x
y=y+16*size
dim py as double=y'16*size+y
dim z as integer=0
dim th as double'=4
th=((.5-size)/4.5+5)*thickness_tweak
dim sp as double=6
dim sp2 as double=6
dim pi as double=4*atn(1)
dim la as double=(line_angle *.5)
dim ca as double=(char_angle*.5)
sp2=sp2+30*abs(sin(ca*pi/180-la*pi/180))

#macro set(x1,y1,x2,y2,sarc,earc,shape,im)
rotate(px,py,x1,y1,x2,y2,sarc,earc,-char_angle,1,size,c,th*size,shape,im)
#endmacro

#macro spaces(xpixels,ypixels)
px=px+(xpixels*size+sp2*size)*cos(line_angle*pi/180)
py=py-(ypixels*size+sp2*size)*sin(line_angle*pi/180)
next_x=px-16*size
next_y=py-16*size
#endmacro

for n as integer=1 to l
   
    select case mid$(s,n,1)
    case " "
 spaces(30,30)

 
case "|"
 z=z+1
 px=(x+16*size+z*16*sin(line_angle*pi/180))+1.3*z*(24*size+size*sp*size)*sin(line_angle*pi/180)
 py=(y+z*16*cos(line_angle*pi/180))+1.3*z*(24*size+size*sp*size)*cos(line_angle*pi/180)
 next_x=px-16*size
next_y=py-16*size
case "1"
 set(px-8,py-18,px-8,py+16,.0,.0,"line",image)'vert
 set(px-8,py-16,px-12,py-8,.0,.0,"line",image)
 spaces(12,12)
case "2"
 set(px-2,py-8,9,1,310,530,"circle",image)'curve
 set(px-15,py+14,px+5,py-2,.0,.0,"line",image)
 set(px-16,py+14,px+10,py+14,.0,.0,"line",image)'base
 spaces(28,28)
case "3"
 set(px-2,py-7,9,1,300,530,"circle",image)'curve top
 set(px-2,py+6,9,1,190,395,"circle",image)'curve
 set(px-3,py,px+5,py,.0,.0,"line",image)
 spaces(28,28)
case "4"
 set(px-16,py+4,px+12,py+4,.0,.0,"line",image)'horiz
 set(px-14,py+4,px+4,py-16,.0,.0,"line",image)'slope
 set(px+4,py-18,px+4,py+16,.0,.0,"line",image)
 spaces(28,28)
case "5"
 set(px-14,py-16,px+6,py-16,.0,.0,"line",image)'top
 set(px-12,py-16,px-12,py+1,.0,.0,"line",image)'vert
 set(px-4,py+6,9,1,210,500,"circle",image)'curve
 spaces(28,28)
case "6"
 set(px-2,py+6,9,1,360,360,"circle",image)'curve base
 set(px+16,py+4,27,1,130,180,"circle",image)'curve edge
 spaces(28,28)
case "7"
 set(px-14,py-16,px+6,py-16,.0,.0,"line",image)'top
 set(px+5,py-16,px-12,py+16,.0,.0,"line",image)'slope
 spaces(26,26)
case "8"
 set(px-2,py-7,9,1,320,575,"circle",image)'curve top
 set(px-2,py+6,9,1,130,415,"circle",image)'curve
 set(px-9,py-1,px+6,py-1,.0,.0,"line",image)
 spaces(28,28)
 
case "9"
 set(px-2,py-6,9,1,360,360,"circle",image)'top
 set(px-20,py-4,27,1,310,360,"circle",image)
 spaces(28,28)
case "0"
 set(px,py-1,15,1,360,360,"circle",image)
 spaces(36,36)
case "."
 set(px-12,py+12,1,1,360,360,"circle",image)
 spaces(10,10)
case "A"
 set(px,py-16,px-12,py+16,.0,.0,"line",image)
 set(px,py-16,px+12,py+16,.0,.0,"line",image)
 set(px-8,py+3,px+8,py+3,.0,.0,"line",image)
 spaces(30,30)'36
 case "a"
 set(px-4,py+4,10,1,360,360,"circle",image)
 set(px+6,py-8,px+6,py+16,.0,.0,"line",image)
 spaces(26,26)
case "B"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px-12,py-14,px-5,py-14,.0,.0,"line",image)'top
  set(px-12,py+14,px-5,py+14,.0,.0,"line",image)'base
  set(px-5,py-6,8,1,290,450,"circle",image)'top loop
  set(px-5,py+6,8,1,270,430,"circle",image)'base loop
  set(px-12,py,px-2,py,.0,.0,"line",image)'middle
  spaces(24,24)
case "b"
    set(px-2,py+4,10,1,360,360,"circle",image)
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)
 spaces(28,28)
case "C"
    set(px,py,14,1,60,300,"circle",image)
    spaces(25,25)
case "c"
    set(px-4,py+4,10,1,60,300,"circle",image)
    spaces(20,20)
    case "D"
  set(px-12,py-16,px-12,py+16,.0,.0,"line",image)
 set(px-5,py,14,1,270,450,"circle",image)
 set(px-12,py-14,px-5,py-14,.0,.0,"line",image)
  set(px-12,py+14,px-5,py+14,.0,.0,"line",image)
 
  'rotate(px,py,px-24,py+20,px-24,py-20,0,0,-line_angle,1,size,rgb(255,0,0),1,"line",image)
 spaces(30,30)
case "d"
 set(px-4,py+4,10,1,360,360,"circle",image)
 set(px+6,py-16,px+6,py+16,.0,.0,"line",image)
 spaces(26,26)
case "E"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px-12,py-14,px+6,py-14,.0,.0,"line",image)'top
  set(px-12,py+14,px+6,py+14,.0,.0,"line",image)'base
  set(px-12,py,px-2,py,.0,.0,"line",image)'middle
  spaces(25,25)
case "e"
  set(px-4,py+4,10,1,0,320,"circle",image)
  set(px-12,py+3,px+8,py+3,.0,.0,"line",image)
  spaces(26,26)
case "F"
  set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px-12,py-14,px+6,py-14,.0,.0,"line",image)'top
  set(px-12,py,px-2,py,.0,.0,"line",image)'middle
  spaces(24,24)
case "f"
  set(px-2,py-8,10,1,0,170,"circle",image)'curve
 set(px-12,py-10,px-12,py+16,.0,.0,"line",image)'vert
 set(px-10,py,px-2,py,.0,.0,"line",image)'middle
 spaces(28,28)
case "G"
  set(px,py,14,1,50,350,"circle",image)
  set(px,py,px+16,py,.0,.0,"line",image)
    spaces(35,35)
case "g"
    set(px-4,py+4,10,1,360,360,"circle",image)
 set(px+6,py-6,px+6,py+20,.0,.0,"line",image)
 set(px-4,py+17,10,1,230,345,"circle",image)
 
 spaces(26,26)
case "H"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px+12,py-16,px+12,py+16,.0,.0,"line",image)'vert
 set(px-12,py,px+12,py,.0,.0,"line",image)'middle
 spaces(32,32)
case "h"
  'set(px-6,py+4,10,1,0,150,"circle",image)
  set(px-4,py+2,8,1,0,170,"circle",image)'curve right
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)
 set(px+4,py,px+4,py+16,.0,.0,"line",image)
 spaces(25,25)
case "I"
 set(px,py+16,px,py-16,.0,.0,"line",image)'vert
 set(px-12,py+14,px+12,py+14,.0,.0,"line",image)
 set(px-12,py-14,px+12,py-14,.0,.0,"line",image)
 spaces(30,30)
case "i"
  set(px-12,py-6,px-12,py+16,.0,.0,"line",image)
  set(px-12,py-14,1,1,360,360,"circle",image)
  spaces(10,10)
case "J"
    'set(px-2,py+4,12,1,200,270,"circle",image)
    set(px-7,py+8,7,1,220,355,"circle",image)
 set(px,py-16,px,py+9,.0,.0,"line",image)'vert
 set(px-12,py-14,px+12,py-14,.0,.0,"line",image)'top
 spaces(30,30)
case "j"
 set(px,py-6,px,py+20,.0,.0,"line",image)
 set(px-7,py+20,7,1,220,360,"circle",image)
 set(px,py-14,1,1,360,360,"circle",image)
 spaces(22,22)
case "K"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px+6,py-16,px-12,py,.0,.0,"line",image)'upper
 set(px+6,py+16,px-6,py-3,.0,.0,"line",image)
 spaces(25,25)
case "k"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px+3,py-6,px-12,py,.0,.0,"line",image)'upper
 set(px,py+16,px-8,py-3,.0,.0,"line",image)'lower
 spaces(20,20)
case "L"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px-12,py+14,px+6,py+14,.0,.0,"line",image)'base
 spaces(25,25)
case "l"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 spaces(10,10)
case "M"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px+12,py-16,px+12,py+16,.0,.0,"line",image)'vert
 set(px-12,py-16,px,py,.0,.0,"line",image)'left arm
 set(px+12,py-16,px,py,.0,.0,"line",image)'right arm
 
 spaces(32,32)
case "m"
 set(px-6,py+2,6,1,0,170,"circle",image)'curve left
 set(px+6,py+2,6,1,0,170,"circle",image)'curve right
 set(px-12,py-5,px-12,py+16,.0,.0,"line",image)'vert left
 set(px+12,py,px+12,py+16,.0,.0,"line",image)'vert right
 set(px,py+16,px,py,.0,.0,"line",image)'mid arm
 spaces(32,32)
case "N"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px+12,py-16,px+12,py+16,.0,.0,"line",image)'vert
 set(px-12,py-16,px+12,py+16,.0,.0,"line",image)'middle
 spaces(32,32)
case "n"
    set(px-4,py+2,8,1,0,170,"circle",image)'curve right
 set(px-12,py-5,px-12,py+16,.0,.0,"line",image)'vert left
 set(px+4,py+16,px+4,py,.0,.0,"line",image)'mid arm
 spaces(24,24)
case "O"
 set(px,py,14,1,360,360,"circle",image)
 spaces(36,36)
case "o"
 set(px-4,py+4,10,1,360,360,"circle",image)
 'set(px+6,py-16,px+6,py+16,.0,.0,"line",image)
 spaces(26,26)
case "P"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px-12,py-14,px-5,py-14,.0,.0,"line",image)'top
  'set(px-12,py+14,px-5,py+14,.0,.0,"line",image)'base
  set(px-5,py-6,8,1,280,450,"circle",image)'top loop
  'set(px-5,py+6,10,1,270,430,"circle",image)'base loop
  set(px-12,py+2,px-2,py+2,.0,.0,"line",image)'middle
  spaces(24,24)
case "p"
 set(px-5,py+4,10,1,270,435,"circle",image)' loop
  set(px-14,py-5,px-2,py-5,.0,.0,"line",image)'top
 set(px-12,py+14,px-5,py+14,.0,.0,"line",image)'base
 set(px-12,py-6,px-12,py+26,.0,.0,"line",image)'vert
 spaces(24,24)
case "Q"
 set(px,py,14,1,360,360,"circle",image)
 set(px+5,py+20,16,1,400,460,"circle",image)
 spaces(36,36)
case "q"
 set(px-5,py+6,10,1,110,270,"circle",image)' loop
 set(px-9,py-3,px+2,py-3,.0,.0,"line",image)'top
 set(px-8,py+16,px,py+16,.0,.0,"line",image)'base
 set(px,py-3,px,py+26,.0,.0,"line",image)'vert
 spaces(20,20)
case "R"
 set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
 set(px-12,py-14,px-5,py-14,.0,.0,"line",image)'top
  'set(px-12,py+14,px-5,py+14,.0,.0,"line",image)'base
  set(px-5,py-6,8,1,290,450,"circle",image)'top loop
  'set(px-5,py+6,10,1,270,430,"circle",image)'base loop
  set(px-12,py+2,px-2,py+2,.0,.0,"line",image)'middle
  set(px-8-1+3,py+1,px+12-8-1,py+16+1-2,.0,.0,"line",image)'slope
  spaces(24,24)
case "r"
  set(px-4,py+4,10,1,30,130,"circle",image)
 set(px-12,py-8,px-12,py+16,.0,.0,"line",image)
 spaces(24,24)
case "S"
 set(px-2,py-7,8,1,20,240,"circle",image)'curve top
 set(px-2,py+6,8,1,200,500,"circle",image)'curve
 'set(px-9,py-1,px+6,py-1,.0,.0,"line",image)
 spaces(26,26)
case "s"
 set(px-4,py+4,10,1,40,140,"circle",image)'top
 set(px-1,py-4,10,1,180,240,"circle",image)'topslant
 set(px-6,py+14,10,1,20,100,"circle",image)'baseslant
 set(px-4,py+4,10,1,220,325,"circle",image)'base
 'set(px-12,py-4,px+2,py+12,.0,.0,"line",image)
 'set(px+6,py-8,px+6,py+16,.0,.0,"line",image)
 spaces(26,26)
case "T"
 set(px,py-12,px,py+16,.0,.0,"line",image)'vert
 set(px-16,py-12-2,px+16,py-12-2,.0,.0,"line",image)
 spaces(34,34)
case "t"
 set(px-12,py-16,px-12,py+10,.0,.0,"line",image)'edge
 set(px-12,py-4,px-2,py-4,.0,.0,"line",image)
 set(px-4,py+4,10,1,210,320,"circle",image)
 spaces (24,24)
case "U"
 set(px-12,py-16,px-12,py+8,.0,.0,"line",image)'vert
 set(px+12,py-16,px+12,py+8,.0,.0,"line",image)'vert
 set(px,py,14,1,205,335,"circle",image)
 'set(px-12,py,px+12,py,.0,.0,"line",image)'middle
 spaces(33,33)
case "u"
 set(px-4,py+4,10,1,210,360,"circle",image)
 set(px+6,py-6,px+6,py+16,.0,.0,"line",image)
 set(px-12,py-6,px-12,py+10,.0,.0,"line",image)'left edge
 spaces(26,26)
case "V"
 set(px,py+16,px-12,py-16,.0,.0,"line",image)
 set(px,py+16,px+12,py-16,.0,.0,"line",image)
 'set(px-8,py+3,px+8,py+3,.0,.0,"line",image)
 spaces(32,32)'36
       Case "v"
  set(px-12,py-6,px-4,py+16,.0,.0,"line",image)'left
  set(px-4,py+16,px+4,py-6,.0,.0,"line",image)
  spaces(24,24)
       Case "W"
   set(px-12,py-16,px-8,py+16,.0,.0,"line",image)'vert left
 set(px+12,py-16,px+8,py+16,.0,.0,"line",image)'vert
 set(px-8,py+16,px,py,.0,.0,"line",image)'left arm
 set(px+8,py+16,px,py,.0,.0,"line",image)'right arm
 spaces(32,32)
       Case "w"
          set(px-14,py-6,px-8,py+16,.0,.0,"line",image)'vert left
          set(px+8,py+16,px+12,py-6,.0,.0,"line",image)'vert right
          set(px-8,py+16,px,py,.0,.0,"line",image)'left arm
 set(px+8,py+16,px,py,.0,.0,"line",image)'right arm
          spaces(33,33)
        case "X"
            set(px-12,py-16,px+12,py+16,.0,.0,"line",image)
            set(px+12,py-16,px-12,py+16,.0,.0,"line",image)
            spaces(32,32)
        case "x"
            set(px-12,py-6,px+2,py+16,.0,.0,"line",image)
            set(px+2,py-6,px-12,py+16,.0,.0,"line",image)
            spaces(22,22)
        case "Y"
            set(px-12,py-16,px,py,.0,.0,"line",image)
            set(px+12,py-16,px,py,.0,.0,"line",image)
            set(px,py,px,py+16,.0,.0,"line",image)
            spaces(32,32)
        case "y"
               set(px-4,py+4,8,1,180,380,"circle",image)'top
 set(px+4,py-6,px+4,py+20,.0,.0,"line",image)'right
 set(px-6,py+17,10,1,230,345,"circle",image)'base
 set(px-12,py-6,px-12,py+4,.0,.0,"line",image)'left
 spaces(24,24)
case "Z"
 set(px-12,py-14,px+12,py-14,.0,.0,"line",image)'top
 set(px-12,py+14,px+12,py+14,.0,.0,"line",image)
 set(px+10,py-14,px-10,py+14,.0,.0,"line",image)'slope
 spaces(30,30)
case "z"
 set(px-16,py-4,px+2,py-4,.0,.0,"line",image)'top
 set(px-16,py+14,px+2,py+14,.0,.0,"line",image)'base
 set(px+1,py-5,px-14,py+14,.0,.0,"line",image)'slope
 spaces(20,20)
           
 '************************************************       
case ","
 set(px-12,py+12,px-18,py+20,.0,.0,"line",image)
 set(px-12,py+12,1,1,360,360,"circle",image)
 spaces(10,10)

 case"£"
 set(px-5,py-5,8,1,40,220,"circle",image)'top
 set(px-19-5-5,py+10-5,18,1,320,390,"circle",image)
 set(px-16,py+16,px+8,py+16,.0,.0,"line",image)'base
 set(px-16,py+2,px,py+2,.0,.0,"line",image)
 spaces(28,28)
case "$"
  set(px-2,py-7,8,1,20,240,"circle",image)'curve top
 set(px-2,py+6,8,1,200,495,"circle",image)'curve
 set(px-2,py-17,px-2,py+17,.0,.0,"line",image)
 'set(px-9,py-1,px+6,py-1,.0,.0,"line",image)
 spaces(26,26)
case "%"
 set(px-10,py-10,6,1,360,360,"circle",image)
 set(px+10,py+10,6,1,360,360,"circle",image)
 set(px+8,py-8,px-8,py+8,.0,.0,"line",image)
 spaces(33,33)
case "^"
 set(px-14,py,px-7,py-16,.0,.0,"line",image)
 set(px-7,py-16,px,py,.0,.0,"line",image)
 spaces(20,20)
 case"&"
 set(px-2,py-7,8,1,70,220,"circle",image)'curve top
 set(px-2,py+6,8,1,110,415,"circle",image)'curve
 set(px-4-4-2,py-8,px+12-4,py+16,.0,.0,"line",image)
 'set(px-9,py-1,px+6,py-1,.0,.0,"line",image)
 spaces(28,28)
case "*"
 set(px-12,py-6-8,px+2,py+16-8,.0,.0,"line",image)
            set(px+2,py-6-8,px-12,py+16-8,.0,.0,"line",image)
            set(px-16,py-3,px+6,py-3,.0,.0,"line",image)
            spaces(24,24)
        case "("
            set(px+22,py,38,1,150,210,"circle",image)
            spaces(12,12)
        case ")"
       set(px-22-16-6,py,38,1,330,390,"circle",image)
            spaces(12,12)
        case "-"
            set(px-16,py,px+8,py,.0,.0,"line",image)
            spaces(26,26)
        case "_"
            set(px-16,py+16,px+16,py+16,.0,.0,"line",image)
            spaces(34,34)
            case "+"
            set(px-16,py,px+8,py,.0,.0,"line",image)
            set(px-4,py+12,px-4,py-12,.0,.0,"line",image)
            spaces(26,26)
        case "="
        set(px-16,py-4,px+8,py-4,.0,.0,"line",image)
        set(px-16,py+4,px+8,py+4,.0,.0,"line",image)
        spaces(26,26)
    case "!"
        set(px-12,py-16,px-12,py+6,.0,.0,"line",image)
        set(px-12,py+12,1,1,360,360,"circle",image)
        spaces(10,10)
    case "¬"
    set(px-16,py+4,px+8,py+4,.0,.0,"line",image)
    set(px+6,py+4,px+6,py+12,.0,.0,"line",image)
    spaces(26,26)
case "`"
    set(px-16,py-16,px-12,py-12,.0,.0,"line",image)
    spaces(8,8)
case ";"
    set(px-12,py-4,1,1,360,360,"circle",image)'top
  set(px-12,py+12,px-18,py+20,.0,.0,"line",image)
 set(px-12,py+12,1,1,360,360,"circle",image)
 spaces(10,10)
case ":"
   set(px-12,py-4,1,1,360,360,"circle",image)'top
  'set(px-12,py+12,px-18,py+20,.0,.0,"line",image)
 set(px-12,py+12,1,1,360,360,"circle",image)
 spaces(10,10)
case "@"
 set(px,py,14,1,0,290,"circle",image)
 set(px+6,py,7,1,100,365,"circle",image)
 spaces(36,36)
case "'"
 set(px-12,py-12,px-18,py-4,.0,.0,"line",image)
 set(px-12,py-12,1,1,360,360,"circle",image)
 spaces(10,10)
case "#"
 set(px-16,py-4,px+8,py-4,.0,.0,"line",image)
set(px-16,py+4,px+8,py+4,.0,.0,"line",image)
set(px-8,py-12,px-8,py+12,.0,.0,"line",image)
set(px,py-12,px,py+12,.0,.0,"line",image)
        spaces(26,26)
    case "~"
  set(px-8,py+16,14,1,60,120,"circle",image)
  set(px+4,py-8,14,1,240,300,"circle",image)
  spaces(30,30)
case "/"
  set(px+14,py-16,px-14,py+16,.0,.0,"line",image)
  spaces(34,34)
case ""
  set(px-14,py-16,px+14,py+16,.0,.0,"line",image)
  spaces(34,34)
case "["
  set(px-12,py-16,px-12,py+16,.0,.0,"line",image)'vert
  set(px-12,py-14,px-4,py-14,.0,.0,"line",image)'top
  set(px-12,py+14,px-4,py+14,.0,.0,"line",image)
  spaces(14,14)
case "]"
  set(px-4,py-16,px-4,py+16,.0,.0,"line",image)'vert
  set(px-4,py-14,px-12,py-14,.0,.0,"line",image)'top
  set(px-12,py+14,px-4,py+14,.0,.0,"line",image)
  spaces(16,16)
case "{"
  set(px+12,py-8,28,1,160,200,"circle",image)
  set(px+12,py+8,28,1,160,200,"circle",image)
            spaces(8,8)
case "}"
  set(px-12-16-6,py-8,28,1,340,380,"circle",image)
  set(px-12-16-6,py+8,28,1,340,380,"circle",image)
            spaces(14,14)
case "<"
    set(px-16,py,px+4,py-12,.0,.0,"line",image)
    set(px-16,py,px+4,py+12,.0,.0,"line",image)
    spaces(24,24)
case ">"
    set(px+4,py,px-16,py-12,.0,.0,"line",image)
    set(px+4,py,px-16,py+12,.0,.0,"line",image)
    spaces(24,24)
case "?"
     set(px-5,py-6,8,1,280,490,"circle",image)'top loop
     set(px-4,py,px-4,py+8,.0,.0,"line",image)
     set(px-4,py+15,1,1,360,360,"circle",image)
     spaces(24,24)
     case """"
  set(px-12,py-16,px-18,py-8,.0,.0,"line",image)
 set(px-12,py-16,1,1,360,360,"circle",image)
 
 set(px-4,py-16,px-10,py-8,.0,.0,"line",image)
 set(px-4,py-16,1,1,360,360,"circle",image)
 spaces(16,16) 
  case else
    draw string(px,py),"?",c
    spaces(24,24)
    end select
    next n
end sub
'************************* END OF PAINTSTRING ******************************
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Feb 22, 2011 23:07

@Dodicat

Heroes are just mercenaries in the public's favor. Really nice font though.
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Postby kiyotewolf » Mar 12, 2011 7:04

I ripped the 4x6, the 8x8 and the 8x16 off a DOS window.

I'm working on the neater 5x12 font, gotta dig up old QBasic utils to port it over.

Also gotta work on a better container for the final font data, or some automated source generator bizzare toaster machine.



~Kiyote!
TESLACOIL
Posts: 1769
Joined: Jun 20, 2010 16:04
Location: UK
Contact:

bizzare toaster machine.

Postby TESLACOIL » Apr 03, 2011 4:52

ref bizzare toaster machine.

i have a cunning plan "the mother of all spaghetti toasters"


1 bmp with the font is placed in the folder (pink boxed letters)

2 first code line of your prog calls font.exe (in same folder) using spawn, your prog then quits. but has compiled without error

3 font.exe copies the .bas file , hunts for all the print statements , comments them out & replaces them with a shedload of draw/line commands. deleting the spawn command that called it of course

4 font.exe then calls the compiler to compile and run the new code

the idea being that process would be invisible

fonts chosen would by adding 'fontx comment at the point you wished to change the font


'font1
?"hello"

'font2
'?"hello";a,b,c

while it would be quite a hefty prog to write, catching all possible ways of printing it would give the FB community unlimited high quality font potential with a totally intuitive & simple command 'fontx

new fonts can be added at any time, so long as the letter order is correct and the letter is bounded by a pink[z] box so font.exe knows its borders

the same mechanism can also be used to load in icon, sprites, or anything graphical. while draw speed is low, for 90% of applications this is not an issue on today's super fast computers

eg 'font99 might replace A with a star, b with a large FBlogo etc



just thinking out loud , FB realy needs a dozen fonts larger than stock. Im lazy and dont want to insert wads of code and fiddly commands to output the fonts i want.....let my cpu take the strain and my hd take the pain

'fontx F.T.W.

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 12 guests