Announcement

Collapse
No announcement yet.

Characters with accents

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

  • Characters with accents

    Hello,
    Is it possible to display characters with accents or character like degree sign ?

    Using : uLCD-32032-P1T

    Thanks.

  • #2


    No, these extended characters are not built into the internal fonts. However, you can make your own characters by using the gfx_Bitmap() function.
    Atilla

    Comment


    • #3


      Thank you for the quick response, I missed this feature.

      Vincent.

      Comment


      • #4


        Use the following format, it's easier to understand and implement.

        HTML Code:
        #DATA
        byte myBitmap1 0x01, 0x08, 0xFE, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xFE, 0x00 // "Z" as byte data
        #END
        
        ....
        ....
        
        gfx_Bitmap(myBitmap1, x, y, WHITE); // draw the bitmap
        Atilla

        Comment


        • #5


          Well, I have the same problem.
          I need for an application greek letters like alpha, beta ... omega. A function to implement own fonts or special characters would be very useful in 4DGL because the world have many other languages with special characters (German, Chech, Kyrillic, Chinese).
          I think the available fonts are stored in the PMMC file, isn't it? Is it possible to develop a tool that stores the fonts on the uSD card? So you can include a font editor in the Graphicscomposer to build your own user-fonts. At startup you can overload the existing fonts with that stored on the uSD and all would be fine. You can then use the new fonts with the same commands you use the internal fonts. It is difficult to use the bitmap command when you habe a longer text to display . This may work if you only want to change a single char (like ° in teperature) but not to develop expedient applications in foraign languages with many many characters.

          Comment


          • JPL
            JPL commented
            Editing a comment
            After 11 years because the above is dated Oct 2008, I have the same problem .... I need the greek letters like Omega, Beta and deg for Celsius and some math symbols. Does exist a font editor and possibility to create custom font editor and upload it into uSD card? I am using Diablo 16, uLCD43DT.

          • sherwin4D
            sherwin4D commented
            Editing a comment
            Hi JPL,

            Please refer to this for thread for the solution:
            https://forum.4dsystems.com.au/node/65448

            Kind regards,
            Sherwin

        • #6


          Ok for chinese you would need unicode characters with 2 bytes to display all tha possible characters, but for the most other languages like german, greek ... fonts with 256 characters are sufficient.

          Comment


          • #7


            Take a look at BitFontCreator, this fantastic program allows you to create or preload any font and generate C code that can be used in 4DGL for bitmaps. An example of the code output for a letter 'A':

            /* character 0x0041 ('A'): (width=9, offset=576) */
            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00,
            0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x22, 0x00,
            0x22, 0x00, 0x7F, 0x00, 0x41, 0x00, 0x80, 0x80,
            0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

            Check it out at:
            http://www.iseasoft.com/

            Kev

            Comment


            • #8
              Hi JPL,

              Does exist a font editor and possibility to create custom font editor and upload it into uSD card?
              Yes, a Font Tool program is available for creating/editing fonts. You may use the tool to generate an *.inc file which you
              can inherit on your program. You may also copy and paste the #DATA block from the include file to your
              program if you so prefer.

              FONT TOOL:
              FontTool Rev 0.3.0.2.zip

              To set the custom font:
              Code:
              #inherit "myfont.inc"
              
              // or
              
              #DATA
              //place myfont here
              #END
              func main()
              
                  set_FontID(myfont);    //set font
              
                  repeat
                  forever
              
              endfunc
              You could also store fonts into FLASHBANK if you need to save RAM space for your program.
              Code:
              txt_FontBank(FLASHBANK_3, 7);
              Attached is a Designer program which makes use of an include font file to show certain characters, e.g.
              alpha, beta, omega, etc.
              FontInclude.zip

              Should you have any questions regarding these, please don't hesitate to ask.

              Best of luck and kind regards,
              Sherwin

              Comment


              • #9
                Hi Sherwin
                I think I understand how the program works, but it gives me this problem:
                - I open an installed font (eg 4DFont1), I modify the bitmap by a couple of characters above 127 (ex. 128 and 129), then export it with a different name from the original.
                - I tried all the available combinations ("save as" and "output format"), but, in the .inc file that creates, the characters above 127 are always cleared, so "putch (128);" does not work.
                - if I go to "Load saved font" and load the modified font, it shows it with the correct 128 and 129 characters!
                - Instead in your "customfontVerdana" file I see that the characters exist.
                in my file:
                Code:
                    0,    // width of character 128
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                    0x00, 0x00, 0x00, 0x00, 
                    0,    // width of character 129
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                    0x00, 0x00, 0x00, 0x00,
                in "customfontVerdana":
                Code:
                    13,    // width of character 128
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                    0x00, 0x00, 0x00, 0x00, 0x3A, 0x00, 0x46, 0x00, 
                    0x42, 0x00, 0x42, 0x00, 0x42, 0x00, 0x46, 0x00, 
                    0x3A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
                    13,    // width of character 129
                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 
                    0x42, 0x00, 0x42, 0x00, 0x42, 0x00, 0x5C, 0x00, 
                    0x42, 0x00, 0x42, 0x00, 0x42, 0x00, 0x62, 0x00, 
                    0x5C, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00,
                I can't understand where I'm wrong!
                Best regards, Valter

                Comment


                • #10
                  P.S.:
                  Since I can't save the changes on the characters above 127 ascii, I tried with the ascii characters between 0 and 31, which can be modified graphically, but it is not possible to export them, since "First character" does not fall below 32.
                  Best regards, Valter

                  Comment


                  • #11
                    Hi Valter,

                    If you look closely in your file, the width of character 128 and 129 is 0, please change it to 10, 11, or any number suitable to your needs.

                    Kind regards,
                    Sherwin

                    Comment


                    • #12
                      Hi Sherwin,
                      I post the result of "FontTool" because also for me the lenght and the data aren't correct (all at zero!). It seems the program don't export the changes (as per option All in the export).
                      Please take a look at the screenshot and say me where I wrong.
                      Best regards, Valter
                      Attached Files

                      Comment


                      • sherwin4D
                        sherwin4D commented
                        Editing a comment
                        Hi Valter,

                        "I post the result of "FontTool" because also for me the lenght and the data aren't correct (all at zero!). It seems the program don't export the changes (as per option All in the export)."

                        Indeed, as a workaround, you could manually change the value of the width using any text editor.

                        Best regards,
                        Sherwin

                    • #13
                      Hi Sherwin,
                      Sorry but I do not understand. Even if I change the width value manually, I would like to point out that even the following data is zero, and I wouldn't know how to find them / invent them / insert them.
                      I noticed that:
                      - If I change a character between 32 and 127, the file created in export shows the changes (as I expected).
                      - If I change a character between 0 and 31, I can't go below 32 as the limit of the first character, so the export is useless.
                      - Needless to say that the characters above 127 always give zero result.
                      More info:
                      - I use Win7. I tried to run the program both in compatibility mode and as an administrator -> nothing changes.
                      - The version of FontTool is 0.3.0.2.
                      What can I do?
                      Can you suggest a similar program to solve my problem?
                      Best regards, Valter

                      Comment


                      • #14
                        FontTool is pretty unique, and it has a lot of warts, it appears it is not often used, and so these warts were not uncovered before it became obsoleted by this 'disuse'.

                        Before you did your export, did you remember to change the width of the characters?

                        Just looking at some of the quirks that might seem applicable to what you are trying.
                        1. The block 'Traditional' is 0x20-0xfF so won't pick up anything beneath 0x20
                        2. The block 'Basic Latin' is 0x00-0x7f so wont pick up anything above 0x7f (It also won't do 0x00-0x1F, due to several warts)

                        So would 'Traditional' serve your purposes if it 'worked'?

                        Can you outline just what you are trying to do (i.e. Font, changes, export format) so I can work out how to achieve what you are after?
                        Mark

                        Comment


                        • #15
                          Hi Mark & Sherwin
                          I think I made all the possible attempts.
                          Now, following your suggestion, I also tried to change the width of the characters both on the main page and on the Export page. But it still does not work.
                          I note that it is a program with some bugs and that it is no longer updated.
                          Do you have an alternative program to suggest me?
                          In the past I have used GLCD Font Creator, but it was created for Basic and is not suitable for C ++.
                          Thanks for your help!
                          Best regards, Valter

                          Comment

                          Working...
                          X