Announcement

Collapse
No announcement yet.

[ViSi] Working with several Strings Objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [ViSi] Working with several Strings Objects

    I'm using latest Workshop 4.1.0.28 and started a new Display Design with ViSi to get some results faster.

    I used several Strings Objects, because I need custom fonts. Unfortunately every strings Object get its own Font file although same fonts is used already. I suggest instead of font enumeration (hFont1, ...; proj.da1, ...: proj.gc1, ...) something like the font name (like it is used in *.gcn) is used for automatic generation of support files e.g. Arial40b.dat and Variable hArial40b.

    So the generated support files get fewer and the generated code is much more readable.

    best regards,
    Gregor

  • #2


    If you look carefully at the generated code you will see that only one copy of each font is ultimately used
    Mark

    Comment


    • #3


      Doesn't look like something is reused!

      // Form1 1.1 generated 28.01.2014 08:12:21
      gfx_BGcolour(0x3186) ;
      gfx_Cls() ;

      // Strings1 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont1) ; // Font index correct at time of code generation
      txt_FGcolour(0x632C) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(8 , 2) ;
      PrintDisk(hstrings, Strings1StartH, Strings1StartL, Strings1Size, i) ; // where i is Message 0 - Strings1Count-1

      // Rectangle1 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(0, 199, 479, 200, 0xCE79) ;

      // Rectangle2 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(203, 200, 204, 271, 0xCE79) ;

      // Rectangle3 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(279, 200, 280, 271, 0xCE79) ;

      // Rectangle4 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(351, 0, 352, 199, 0xCE79) ;

      // Rectangle5 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(352, 24, 479, 25, 0xCE79) ;

      // Rectangle6 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(352, 59, 479, 60, 0xCE79) ;

      // Rectangle7 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(352, 94, 479, 95, 0xCE79) ;

      // Rectangle8 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(352, 129, 479, 130, 0xCE79) ;

      // Rectangle9 1.0 generated 28.01.2014 08:12:21
      gfx_RectangleFilled(352, 164, 479, 165, 0xCE79) ;

      // Strings2 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont2) ; // Font index correct at time of code generation
      txt_FGcolour(WHITE) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(373 , 2) ;
      PrintDisk(hstrings, Strings2StartH, Strings2StartL, Strings2Size, i) ; // where i is Message 0 - Strings2Count-1

      // Strings3 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont3) ; // Font index correct at time of code generation
      txt_FGcolour(0x67E0) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(376 , 37) ;
      PrintDisk(hstrings, Strings3StartH, Strings3StartL, Strings3Size, i) ; // where i is Message 0 - Strings3Count-1

      // Strings4 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont4) ; // Font index correct at time of code generation
      txt_FGcolour(0x67E0) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(376 , 72) ;
      PrintDisk(hstrings, Strings4StartH, Strings4StartL, Strings4Size, i) ; // where i is Message 0 - Strings4Count-1

      // Strings5 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont5) ; // Font index correct at time of code generation
      txt_FGcolour(0x67E0) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(376 , 107) ;
      PrintDisk(hstrings, Strings5StartH, Strings5StartL, Strings5Size, i) ; // where i is Message 0 - Strings5Count-1

      // Strings6 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont6) ; // Font index correct at time of code generation
      txt_FGcolour(0x67E0) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(376 , 142) ;
      PrintDisk(hstrings, Strings6StartH, Strings6StartL, Strings6Size, i) ; // where i is Message 0 - Strings6Count-1

      // Strings7 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont7) ; // Font index correct at time of code generation
      txt_FGcolour(0x67E0) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(376 , 177) ;
      PrintDisk(hstrings, Strings7StartH, Strings7StartL, Strings7Size, i) ; // where i is Message 0 - Strings7Count-1

      // Strings8 1.0 generated 28.01.2014 08:12:21
      txt_FontID(hFont8) ; // Font index correct at time of code generation
      txt_FGcolour(WHITE) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(76 , 201) ;
      PrintDisk(hstrings, Strings8StartH, Strings8StartL, Strings8Size, i) ; // where i is Page 0 - Strings8Count-1

      // Strings9 1.0 generated 28.01.2014 08:12:22
      txt_FontID(hFont9) ; // Font index correct at time of code generation
      txt_FGcolour(WHITE) ;
      &
      nbsp; txt_BGcolour(0x3186) ;
      gfx_MoveTo(76 , 232) ;
      PrintDisk(hstrings, Strings9StartH, Strings9StartL, Strings9Size, i) ; // where i is Page 0 - Strings9Count-1

      // Strings10 1.0 generated 28.01.2014 08:12:22
      txt_FontID(hFont10) ; // Font index correct at time of code generation
      txt_FGcolour(0x67E0) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(343 , 216) ;
      PrintDisk(hstrings, Strings10StartH, Strings10StartL, Strings10Size, i) ; // where i is Message 0 - Strings10Count-1

      // Image1 1.0 generated 28.01.2014 08:12:22
      img_Show(hndl,iImage1) ;

      // Strings11 1.0 generated 28.01.2014 08:12:22
      txt_FontID(hFont11) ; // Font index correct at time of code generation
      txt_FGcolour(0xCE79) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(424 , 26) ;
      PrintDisk(hstrings, Strings11StartH, Strings11StartL, Strings11Size, i) ; // where i is Message 0 - Strings11Count-1

      // Rectangle10 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(4, 203, 5, 212, 0xE020) ;

      // Strings12 1.0 generated 28.01.2014 08:12:22
      txt_FontID(hFont12) ; // Font index correct at time of code generation
      txt_FGcolour(WHITE) ;
      txt_BGcolour(0x3186) ;
      gfx_MoveTo(18 , 203) ;
      PrintDisk(hstrings, Strings12StartH, Strings12StartL, Strings12Size, i) ; // where i is Page 0 - Strings12Count-1

      // Rectangle11 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(7, 203, 8, 212, 0xE460) ;

      // Rectangle12 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(10, 203, 11, 212, 0xE720) ;

      // Rectangle13 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(13, 203, 14, 212, 0x0720) ;

      // Rectangle14 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(4, 216, 5, 225, 0xE020) ;

      // Rectangle15 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(7, 216, 8, 225, 0xE460) ;

      // Rectangle16 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(10, 216, 11, 225, 0xE720) ;

      // Rectangle17 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(13, 216, 14, 225, 0x0720) ;

      // Rectangle18 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(4, 229, 5, 238, 0xE020) ;

      // Rectangle19 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(7, 229, 8, 238, 0xE460) ;

      // Rectangle20 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(10, 229, 11, 238, 0xE720) ;

      // Rectangle21 1.0 generated 28.01.2014 08:12:22
      gfx_RectangleFilled(13, 229, 14, 238, 0x0720) ;

      Comment


      • #4


        Ah sorry, ViSi.

        You will need to do it yourself.

        At the time you paste your code the font could be 'anything', similarly after you paste your code the font could be changed to 'anything else'.

        So there's really no way ViSi can detect this.

        What Genie does is checks fonts for being duplicates at build time and excludes the duplicates at that time.

        To do this in ViSi is outside the scope of ViSi as you do the coding and use the fonts yourself, so you will need to handle duplicates yourself.
        Mark

        Comment

        Working...
        X