Announcement

Collapse
No announcement yet.

Change the text font.

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

  • Change the text font.

    Hi everyone,

    I would like to set all my project as Verdana font.

    Ex: This project 4D-CD-00024 Designer ListBox with verdana font.

    Best regards,
    Toragan.

  • #2
    Hello Toragan,

    Please do understand that there's no silver bullet to make every object instantly use Verdana
    as font. For some objects in ViSi-Genie, you could manually set their fonts to Verdana, i.e. Fancy Buttons,
    StaticText.

    In order to display Third Party Fonts, you may consult this appnote to be guided further:
    ViSi Displaying Third Party Fonts FAT16

    With those in mind, I've created a simple ViSi-Genie project that uses Magic Codes to print texts
    in the display using Verdana as font. Do note that this project follows the Magic Code Insertion Points
    appnote to be created.

    To generate Verdana font:
    1. Insert a String widget from the Labels tab.
    Click image for larger version

Name:	step1.PNG
Views:	283
Size:	12.2 KB
ID:	68833
    2. At the Object Inspector, click on the circled icon to change to
    Verdana font. This will generate your desired font after compiling your project.
    Click image for larger version

Name:	step2.PNG
Views:	195
Size:	6.2 KB
ID:	68834
    3. Follow the rest of the steps provided in this appnote: ViSi-Genie Magic Code Insertion Points

    Attached is the project file you could use as your reference.
    [ATTACH]n68835[/ATTACH]

    I hope this helps, and should you have other inquiry feel free to ask.

    Good luck and best regards,
    Sherwin

    Comment


    • #3
      Hi Sherwin,

      I know the string object exist, but I forget to say, that I have a compatibility problem with "string object" and "the listbox" (in exemple).
      I asked the question 1 or 2 months ago, but nobody has a solution.
      I finally delete all my strings object.

      It's the reason why I'm looking for another solution, to set my text in Verdana.

      Best Regards,
      Toragan

      Comment


      • #4
        Hi,

        I try exactly like in example "VerdanaFontProject.zip" but my text still to be in FONT3 or 1/2 if I set txt_FontID(FONT2) / txt_FontID(FONT1), but i'd like txt_FontID(Verdana) or txt_FontID(hFont1) like in the example, but it doesn't work.

        Best Regards,
        Toragan
        Last edited by Toragan; 4 July 2019, 05:15 PM.

        Comment


        • #5
          Hello Toragan,

          First off, the project("VerdanaFontProject.zip") requires that you create a Strings object initially so that you can generate
          your desired font. The *.d01 and *.g01 font files will be generated once you compile your project. See my last post above
          for the steps on how to generate Verdana font.

          Once you have generated your font, the only thing left to do is mount those file using Magic Codes. If you haven't read
          the ViSi-Genie Magic Code Insertion Points appnote, please do so as it is imperative to mount the font files first in order to
          use them inside your project.

          TO MOUNT THE FONT:

          1. Navigate to Magic tab and select "Code" to insert Magic Code.

          Click image for larger version  Name:	magic code.PNG Views:	1 Size:	15.0 KB ID:	68879

          2. At the Object Inspector, make sure that InsertPoint is set to "Constant/Global/Data". After that, declare the
          variable for your font.


          Click image for larger version  Name:	magic code 0.PNG Views:	1 Size:	4.0 KB ID:	68880
          Click image for larger version  Name:	code magic code 0.PNG Views:	1 Size:	3.1 KB ID:	68881

          continued...
          Last edited by sherwin4D; 4 July 2019, 06:48 PM.

          Comment


          • #6
            3. For our Main Loop, we're going to print some text just to check if the font has been changed to Verdana.

            Click image for larger version

Name:	mainloop.PNG
Views:	215
Size:	3.5 KB
ID:	68882

            Click image for larger version

Name:	printtexts.PNG
Views:	183
Size:	6.0 KB
ID:	68883

            4. You may opt to skip creating PreActivateForm magic code if you don't have anything to do before entering the main routine.
            At this point, the most important thing to do now is mount the Verdana font files. You can mount your font by creating a
            PreGenieInit magic code.

            Click image for larger version

Name:	pregenieinit.PNG
Views:	181
Size:	3.8 KB
ID:	68884

            Click image for larger version

Name:	pregenieinitcode.PNG
Views:	181
Size:	5.9 KB
ID:	68885

            Please verify that you're font's file names matches that with what is within your code. You should be able
            to use Verdana font for your project if you follow these steps.

            I hope this helps. If you have further inquiries don't hesitate to ask.

            Good luck and best regards,
            Sherwin
            Last edited by sherwin4D; 4 July 2019, 06:53 PM.

            Comment


            • #7
              Hi Sherwin,

              Thank you for your answer, but I can't see your pictures.

              Best regards,
              Toragan

              Comment


              • #8
                Hi Toragan,

                I've re-uploaded the image files, could you please try refreshing your browser?

                Best regards,
                Sherwin

                Comment


                • Toragan
                  Toragan commented
                  Editing a comment
                  It's ok, thank you !
                  I going to have a look.

              • #9
                I'm stuck, because it works when i'm make the example but when i'm delete the string object, my text is changing in FONT3.
                I can't use string object because I have a conflict with the "listbox".

                But I imagine I have to keep a string object to change le font ?

                Ps: To have more information about the conflict https://forum.4dsystems.com.au/node/68147

                Best Regards,
                Toragan
                Last edited by Toragan; 4 July 2019, 10:53 PM.

                Comment


                • #10
                  Hi,

                  It works well after using 2 user buttons and changing twice a form.
                  I haven't the clue of this problem.

                  Best Regards,
                  Toragan

                  Comment


                  • #11
                    Hi Toragan,

                    I can't use string object because I have a conflict with the "listbox".
                    I've read the thread that you have mentioned. I can confirm that the garbled text appears in the listbox
                    if the strings object at Form8, Form9, and Form10 are not removed.[post #10]

                    But I imagine I have to keep a string object to change le font?
                    Yes, the solution provided requires that you have at least one strings object to use the generated
                    font.

                    By the way, I've downloaded Sources_Edited.rar from the thread that you have provided. I'd like to
                    know if you're still working on the same project. I noticed that a strings object at Form1 remains and
                    somehow doesn't mess up the text on your listbox.And from what I saw, that strings object is also
                    generating a Verdana font.

                    I went ahead and modified that project and mounted the font files. Please download the attached file below:
                    L_NexTgenClassic4DSystem.zip

                    I also made some changes on the last project that I sent you. I've added the listbox that you have integrated
                    to your project, please check attached file below:
                    VerdanaFontProject.zip

                    It works well after using 2 user buttons and changing twice a form.
                    I haven't the clue of this problem.
                    I'm not really sure what you meant here, could you please provide more details?

                    Best regards,
                    Sherwin
                    Attached Files
                    Last edited by sherwin4D; 8 July 2019, 09:15 AM.

                    Comment


                    • #12
                      Hi,

                      I tried my project, I have 24 forms and different object.
                      I create a string object without caption in Verdana. All strings are ok just the listbox is scrambled, to solve this problem I have to switch twice in specific Form. After that it works well but I can't do that all the time.
                      It's very strange.

                      EDIT: It works well when I first run form 24 or form 25, they only contain a return button.

                      Best Regards,
                      Toragan
                      Last edited by Toragan; 8 July 2019, 06:03 PM.

                      Comment


                      • #13
                        I am just going to start working. As I know Verdana is a general font that is used by different software and so on. But what about any font downloaded from any websites such as https://fontsly.com/ and uploaded to the environment?

                        Comment

                        Working...
                        X