Author Topic: Digital font and numbers (based on segments)  (Read 3344 times)

0 Members and 1 Guest are viewing this topic.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Digital font and numbers (based on segments)
« on: October 31, 2020, 09:45:50 am »
I'm writing a bigger program, and this is a small part of it. I thought someone might be interested. The Base64.bm used for this source is my first, old and very slow version, but it has no effect on the program's operation. There is also a better and faster version for Base64 encoding of another author available on the forum (I don't know his name anymore).

There is a possibility to change the size of characters, change the colors of characters and change the background colors. The character set does not allow all characters, such as colons, because the program for which it is intended does not allow for it.

Code: QB64: [Select]
  1.  
  2.  
  3. TYPE segments
  4.     popis AS STRING * 1
  5. DIM SHARED Segments(1 TO 16) AS segments
  6. DIM SHARED test
  7. DIM RedPrint(255) AS LONG
  8. DIM OrangePrint(255) AS LONG
  9.  
  10. SCREEN _NEWIMAGE(1024, 768, 32)
  11.  
  12. test = LoadSeg(Segments())
  13. BUILDSEG Segments(), RedPrint(), &HFFFF0000, &HFF112222 '                                                         Build characters images in set colors
  14. BUILDSEG Segments(), OrangePrint(), _RGB32(255, 105, 0), _RGB32(28, 25, 28)
  15.  
  16.  
  17. statictext$ = "*** SOME TEXT MESSAGE WITHOUT NEED FOR UPDATE *** "
  18. statictext2$ = "SOME FASTEST TEXT            "
  19.  
  20.     PRINTSEG 5, 220, "CURRENT TIME IS " + TIME$ + " AND DATE IS " + DATE$, 20, RedPrint() '                       PRINTSEG X coordinate, Y coordinate, text$, characters size, Array with characters()
  21.  
  22.  
  23.     RUNPRINTSEG 5, 420, statictext$, 25, .6, OrangePrint() '                                                      RUNPRINTSEG in own run swap characters in string, therefore must string be defined as variable!
  24.     '   RUNPRINTSEG 5, 620, statictext2$, 35, .1, RedPrint() '                                                    RUNPRINTSEG X coorinate, Y coordinate, string variable$, size, speed, array with characters()
  25.  
  26.     '                                                                                                             because is not shift time calculated separately for all RUNPRINTSEG calls, can be run just one at once.
  27.     _LIMIT 30
  28.  
  29.  
  30.  
  31.  
  32.  
  33. SUB RUNPRINTSEG (x, y, t$, z, tfs, arr() AS LONG) 'time for step
  34.     SHARED cekat
  35.     prodleva = tfs
  36.     t = TIMER
  37.  
  38.     IF cekat = 0 THEN cekat = TIMER + prodleva
  39.     delka = LEN(t$)
  40.  
  41.     IF TIMER > cekat THEN
  42.         cekat = TIMER + prodleva
  43.         t$ = RIGHT$(t$, delka - 1) + LEFT$(t$, 1)
  44.     END IF
  45.     PRINTSEG x, y, t$, z, arr()
  46.  
  47.  
  48. SUB PRINTSEG (x, y, t$, Z, Arr() AS LONG)
  49.     oW = _WIDTH(Arr(32))
  50.     oH = _HEIGHT(Arr(32))
  51.  
  52.     IF oW > oH THEN R = oW / oH ELSE R = oH / oW
  53.  
  54.     W = Z
  55.     H = R * Z
  56.  
  57.     FOR t = 1 TO LEN(t$)
  58.         _PUTIMAGE (x + t * W, y)-((x + t * W + W), (y + H)), Arr(ASC(t$, t)), 0, (0, 0)-(oW, oH)
  59.     NEXT
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. SUB BUILDSEG (arr() AS segments, CH() AS LONG, c~&, bck~&) 'vytvori jednotlive znaky                                SUB build characters based on base picture
  67.     'vytvori pole znaku (do pole CH() )
  68.     Char$ = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-*/\=[]()0123456789_:<>"
  69.  
  70.     FOR ac = 1 TO LEN(Char$)
  71.         n = ASC(Char$, ac)
  72.         SELECT CASE MID$(Char$, ac, 1)
  73.             CASE " ": CH(n) = DoChar(" ", c~&, bck~&)
  74.             CASE "A": CH(n) = DoChar("HCABEIFG", c~&, bck~&)
  75.             CASE "B": CH(n) = DoChar("CFGHJLI", c~&, bck~&)
  76.             CASE "C": CH(n) = DoChar("ABCHJL", c~&, bck~&)
  77.             CASE "D": CH(n) = DoChar("ABDEIJKL", c~&, bck~&)
  78.             CASE "E": CH(n) = DoChar("ABCHJLF", c~&, bck~&)
  79.             CASE "F": CH(n) = DoChar("ABCHF", c~&, bck~&)
  80.             CASE "G", "g": CH(n) = DoChar("ABCHJLIG", c~&, bck~&)
  81.             CASE "H": CH(n) = DoChar("CHGFEI", c~&, bck~&)
  82.             CASE "I": CH(n) = DoChar("ABDKJL", c~&, bck~&)
  83.             CASE "J": CH(n) = DoChar("EILJH", c~&, bck~&)
  84.             CASE "K": CH(n) = DoChar("CHFNP", c~&, bck~&)
  85.             CASE "L": CH(n) = DoChar("CHJL", c~&, bck~&)
  86.             CASE "M": CH(n) = DoChar("CHMNEI", c~&, bck~&)
  87.             CASE "N": CH(n) = DoChar("CHMPIE", c~&, bck~&)
  88.             CASE "O": CH(n) = DoChar("ABEILJHC", c~&, bck~&)
  89.             CASE "P": CH(n) = DoChar("HCABEGF", c~&, bck~&)
  90.             CASE "Q": CH(n) = DoChar("ABEILJHCP", c~&, bck~&)
  91.             CASE "R": CH(n) = DoChar("HCABEGFP", c~&, bck~&)
  92.             CASE "S": CH(n) = DoChar("ABCFGIJL", c~&, bck~&)
  93.             CASE "T": CH(n) = DoChar("ABDK", c~&, bck~&)
  94.             CASE "U": CH(n) = DoChar("CHJLEI", c~&, bck~&)
  95.             CASE "V": CH(n) = DoChar("CHON", c~&, bck~&)
  96.             CASE "W": CH(n) = DoChar("CHOPIE", c~&, bck~&)
  97.             CASE "X", "x": CH(n) = DoChar("MNOP", c~&, bck~&)
  98.             CASE "Y", "y": CH(n) = DoChar("KMN", c~&, bck~&)
  99.             CASE "Z": CH(n) = DoChar("ABNOJL", c~&, bck~&)
  100.             CASE "0": CH(n) = DoChar("ABEILJHCNO", c~&, bck~&)
  101.             CASE "1": CH(n) = DoChar("DK", c~&, bck~&)
  102.             CASE "2": CH(n) = DoChar("ABEFGHJL", c~&, bck~&)
  103.             CASE "3": CH(n) = DoChar("ABEGILJ", c~&, bck~&)
  104.             CASE "4": CH(n) = DoChar("CEFGI", c~&, bck~&)
  105.             CASE "5": CH(n) = DoChar("ABCFGILJ", c~&, bck~&)
  106.             CASE "6": CH(n) = DoChar("ABCFGILJH", c~&, bck~&)
  107.             CASE "7": CH(n) = DoChar("ABNK", c~&, bck~&)
  108.             CASE "8": CH(n) = DoChar("ABEILJHCFG", c~&, bck~&)
  109.             CASE "9": CH(n) = DoChar("ABEILJCFG", c~&, bck~&)
  110.             CASE "+": CH(n) = DoChar("DGKF", c~&, bck~&)
  111.             CASE "-": CH(n) = DoChar("GF", c~&, bck~&)
  112.             CASE "*": CH(n) = DoChar("MDNFGOKP", c~&, bck~&)
  113.             CASE "/": CH(n) = DoChar("ON", c~&, bck~&)
  114.             CASE "\": CH(n) = DoChar("PM", c~&, bck~&)
  115.             CASE "(", "[": CH(n) = DoChar("ACHJ", c~&, bck~&)
  116.             CASE ")", "]": CH(n) = DoChar("BEIL", c~&, bck~&)
  117.             CASE "_": CH(n) = DoChar("JL", c~&, bck~&)
  118.             CASE "=": CH(n) = DoChar("FGJL", c~&, bck~&)
  119.             CASE "a": CH(n) = DoChar("FHJKL", c~&, bck~&)
  120.             CASE "b": CH(n) = DoChar("DKLIG", c~&, bck~&)
  121.             CASE "c": CH(n) = DoChar("GKL", c~&, bck~&)
  122.             CASE "d": CH(n) = DoChar("EILKG", c~&, bck~&)
  123.             CASE "e": CH(n) = DoChar("EBDGKL", c~&, bck~&)
  124.             CASE "f": CH(n) = DoChar("DKBFG", c~&, bck~&)
  125.             CASE "h": CH(n) = DoChar("DKGI", c~&, bck~&)
  126.             CASE "i": CH(n) = DoChar("K", c~&, bck~&)
  127.             CASE "j": CH(n) = DoChar("BEILK", c~&, bck~&)
  128.             CASE "k": CH(n) = DoChar("DKNP", c~&, bck~&)
  129.             CASE "l": CH(n) = DoChar("DKL", c~&, bck~&)
  130.             CASE "m": CH(n) = DoChar("HFKGI", c~&, bck~&)
  131.             CASE "n": CH(n) = DoChar("KGI", c~&, bck~&)
  132.             CASE "o": CH(n) = DoChar("KLIG", c~&, bck~&)
  133.             CASE "p": CH(n) = DoChar("KDEBG", c~&, bck~&)
  134.             CASE "q": CH(n) = DoChar("KDBEILP", c~&, bck~&)
  135.             CASE "r": CH(n) = DoChar("KDEBGP", c~&, bck~&)
  136.             CASE "s": CH(n) = DoChar("BDGIL", c~&, bck~&)
  137.             CASE "t": CH(n) = DoChar("DKLFG", c~&, bck~&)
  138.             CASE "u": CH(n) = DoChar("KLI", c~&, bck~&)
  139.             CASE "v": CH(n) = DoChar("PI", c~&, bck~&)
  140.             CASE "w": CH(n) = DoChar("HOPI", c~&, bck~&)
  141.             CASE "z": CH(n) = DoChar("FOJ", c~&, bck~&)
  142.             CASE ":": CH(n) = DoChar(" ", c~&, bck~&)
  143.             CASE "<": CH(n) = DoChar("NP", c~&, bck~&)
  144.             CASE ">": CH(n) = DoChar("MO", c~&, bck~&)
  145.         END SELECT
  146.     NEXT
  147.  
  148.  
  149. FUNCTION DoChar (cmd$, clr~&, clr2~&) '                                                             Function return character image build by cmd$
  150.     DoChar = _COPYIMAGE(test)
  151.     de = _DEST
  152.     _DEST DoChar
  153.  
  154.     FOR ext = 1 TO LEN(cmd$)
  155.         c$ = MID$(cmd$, ext, 1)
  156.         FOR d = 1 TO 16
  157.             IF Segments(d).popis = UCASE$(c$) THEN
  158.                 PAINT (Segments(d).X, Segments(d).Y), clr~&, &HFFFFFFFF
  159.             END IF
  160.         NEXT d
  161.     NEXT
  162.     _SOURCE DoChar
  163.     FOR d = 1 TO 16
  164.         IF POINT(Segments(d).X, Segments(d).Y) <> clr~& THEN
  165.             PAINT (Segments(d).X, Segments(d).Y), clr2~&, &HFFFFFFFF
  166.         END IF
  167.     NEXT
  168.     IF cmd$ = " " THEN _SETALPHA 0, _RGB32(190) TO _RGB32(255), DoChar ELSE _CLEARCOLOR _RGB32(255)
  169.     _SOURCE de
  170.     _DEST de
  171.  
  172.  
  173. FUNCTION LoadSeg (S() AS segments)
  174.     '                                                                                   function build base image writed in this source code as Base64 source. Then set character for every segment in picture.
  175.     '   --A-- --B--
  176.     '  I\    I    /I
  177.     '  C  M  D  N  E
  178.     '  I   \ I /   I
  179.     '  I--F-- --G--I
  180.     '  I   / I \   I
  181.     '  H  O  K  P "I"
  182.     '  I /   I   \ I
  183.     '   --J-- --L--
  184.     '
  185.     'definice segmentu (oznaceni pismenama)
  186.  
  187.     S(1).popis = "A"
  188.     S(1).X = 40
  189.     S(1).Y = 10
  190.  
  191.     S(2).popis = "B"
  192.     S(2).X = 97
  193.     S(2).Y = 10
  194.  
  195.     S(3).popis = "C"
  196.     S(3).X = 10
  197.     S(3).Y = 57
  198.  
  199.     S(4).popis = "D"
  200.     S(4).X = 72
  201.     S(4).Y = 57
  202.  
  203.     S(5).popis = "E"
  204.     S(5).X = 130
  205.     S(5).Y = 57
  206.  
  207.     S(6).popis = "F"
  208.     S(6).X = 37
  209.     S(6).Y = 98
  210.  
  211.     S(7).popis = "G"
  212.     S(7).X = 100
  213.     S(7).Y = 100
  214.  
  215.     S(8).popis = "H"
  216.     S(8).X = 10
  217.     S(8).Y = 140
  218.  
  219.     S(9).popis = "I"
  220.     S(9).X = 130
  221.     S(9).Y = 150
  222.  
  223.     S(10).popis = "J"
  224.     S(10).X = 40
  225.     S(10).Y = 190
  226.  
  227.     S(11).popis = "K"
  228.     S(11).X = 70
  229.     S(11).Y = 150
  230.  
  231.     S(12).popis = "L"
  232.     S(12).X = 100
  233.     S(12).Y = 190
  234.  
  235.     S(13).popis = "M"
  236.     S(13).X = 40
  237.     S(13).Y = 50
  238.  
  239.     S(14).popis = "N"
  240.     S(14).X = 100
  241.     S(14).Y = 50
  242.  
  243.     S(15).popis = "O"
  244.     S(15).X = 40
  245.     S(15).Y = 140
  246.  
  247.     S(16).popis = "P"
  248.     S(16).X = 100
  249.     S(16).Y = 150
  250.  
  251.  
  252.     DIM image(8) AS STRING
  253.     'Base64 record
  254.     image(0) = "iVBORw0KGgoAAAANSUhEUgAAAIwAAADHCAMAAAD8gUujAAAAYFBMVEVNTU0AAAD////5+fljY2N/f3+4uLjDw8Pt7e2IiIjz8/N8fHxRUVFUVFRYWFiwsLClpaX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4NcOmUZrihzwtLb949jMDnMcAWG2PJUzRXxO22BQa9xxmsr"
  259.     image(5) = "ohqNWL4JhvpJyTo9PsP2CkYivYUKRjbD1kJTKr2l2k42w1YMvc0LVa9chq31wHQaS/XATIaNmMLPWKqUZjJsrCGn0stgmAybSv3p9BYxbIZNmOLWLo87KGbYNCKjmENmREZpXQumvIcyY1VKW9Uyiqd87OJG8RQyrB9sxR3VufFNhZ9Fj+G+79iRX/RvWT8mjjsT4MfEkT2oMew5Ej9akNy26nGU7NmjYBwllTpt/Qx/Xi0YYUr9REqM4IpDMvaW+F0rMfx5rAhDnj9rMIIzfAGmcGWhGckuuPaRYajvfQVGclUowdBnRP/T2Q9+1bwQyIwZyH1C6YwZSIbrMNgdVPFcInmGqzDovWXxLCt5hqsw6F13+fwz2VGrBoM/j1DMzAM/umbOIvxJjWLOIpjhCgzxDEszmxPIsB1DPd3TzHMFMmzHUM89VTOApRk2Y8gnwrq5"
  260.     image(6) = "0ZJPN88aRz4r180ad2kxaxxdRaCcTy/OsBGTjce0YUCGjRj6qb0Ok2bYhinUM6gxEcCEgaOJKzBJhk2YUg2MHrNkWI7ZLy88KJcq6ed6XfrNH2ANgyDgIMDheYmsVcyCm53jDLPgQk2wfK+PkrbH5gfei1Zdf0PNMD9w/6uMK9xes2mE6fa684do2aeDfG70JzDp+TBT+722c9FoLECjsUDNfdb4sep10ugsiSZYLsj1mkgzzmA/1QNvTJaQsMuo0VpizTSb/lwpvTFZZo3esmjmmf2XGvKNyTJqLJZJs7xlIJrVf2OyDJqfH4vlroneeJCU+p8tlqr3HTyd/WJJB0EgkwpIWs2bIJI3z6TvyDCNqxjerWLUJG+lgG8PMWgeb/cvmytyT0dnyd6rotYMlmHVm1oDLPkbZ5Sa0WLSQAvyLh6VZrYYNJkFe0uRQhNZ1Jrc"
  261.     image(7) = "gr6/SaxJLEoNYsHfbCXUAItKg1mId37JW7NVCYymy4arhvYvfkKRPpGglR8AAAAASUVORK5CYIJC"
  262.  
  263.     DECODE64 image(), "loadsegimage.png" 'create file image.png
  264.     LoadSeg = _LOADIMAGE("loadsegimage.png", 32)
  265.     KILL "loadsegimage.png"
  266.  
  267.  
  268. '$include:'base64.bm'
  269.  

 
preview10.JPG

* base64.bm (Filesize: 4.38 KB, Downloads: 236)

FellippeHeitor

  • Guest
Re: Digital font and numbers (based on segments)
« Reply #1 on: October 31, 2020, 09:52:14 am »
Very good looking.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Digital font and numbers (based on segments)
« Reply #2 on: October 31, 2020, 12:13:07 pm »
Oh wow! Is that complicated. Richard Frost had nice system but only for digits.

I had thought BIN$ was added to QB64 but it's not in v1.4 stable. That .BM file pretty complicated too!


Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Digital font and numbers (based on segments)
« Reply #3 on: October 31, 2020, 01:02:51 pm »
Thanks for feedback. That Base64 record is an image in the attachment. I will describe this program in more detail: Each segment (see the attached picture) is marked with a letter. This description does the LOADSEG function. Right at the beginning of the LOADSEG function, a label is made, which show, as it is divided. Subsequently, SUB BUILDSEG calls the DOCHAR function, which uses a string to describe which segments to color with which color. The DOCHAR function then returns a colored image (that is, a image, that shows the required character). BUILDSEG saves this image in the RedPrint and OrangePrint fields (because BUILDSEG is called twice at the beginning of the program, there are two sets of characters, each in a different color.) Finally, PRINTSEG works similarly to _PRINTSTRING at position X, Y inserts text of the specified size.
How RUNPRINTSEG works. The principle is simple. After the specified time, the characters in the string change so that it does not change its length. First character is set to end in string and others characters are shift to left.

 
segb.png


RUNPRINTSEG principle:

Code: QB64: [Select]
  1. R$ = "HI, THIS STRING SHOW RUNPRINTSEG PRINCIPLE. "
  2.  
  3. prodleva = .1 '                                                       set delay
  4. t = TIMER
  5.  
  6. cekat = TIMER + prodleva '                                            wait time
  7. delka = LEN(R$) '                                                     string lenght
  8.  
  9.     IF TIMER > cekat THEN '                                           when is time to shift string
  10.         cekat = TIMER + prodleva '                                    set new time
  11.         R$ = RIGHT$(R$, delka - 1) + LEFT$(R$, 1) '                   shift characters
  12.     END IF
  13.     CLS
  14.     LOCATE 12, 20
  15.     PRINT R$ '                                                        print it
  16.     _LIMIT 10
  17.  

Base64 is writing binary files using 6 bites. Program read 3 bytes from binary file (24 bites) and write it as 4 byte record using 6 bites. It is so, because 6 bites records are standard printable and readable characters in all program editors.

« Last Edit: October 31, 2020, 01:04:07 pm by Petr »