Announcement

Collapse
No announcement yet.

How to use fonts

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

  • How to use fonts

    Hi,
    Is there a simple (very simple please :-) tutorial telling how to use different fonts please?
    I only want to 'Print' some text to the screen in different fonts.

    I'm using a uOLED32038

    Thanks,
    Kevin

  • #2

    Is the sample FontTest.4DG in the sample sub folder PICASO GFX2\PICASO - GENERAL too hard to understand, or are you trying to use fonts differently?
    Mark

    Comment


    • #3


      Ah yes ... thank you, I'd forgoten about that one - I'll have a go, cheers,
      Kevin

      Comment


      • #4


        message removed
        Kevin

        Comment


        • #5


          Gee you only get that sort of message from the GFX1 compiler.

          Is that a mistake on your part of selecting the platform, or are you really still using GFX1?

          Upgrade your PmmC to GFX2, select the GFX2 platform for your display and try again
          Mark

          Comment


          • #6


            yep - sorry, my mistake

            Kevin

            Comment


            • #7


              I'm using the 4DFont tool to fill the character generator of a PICASO card. It works fine.Now I have to change the characters to cyrillic. There are some desirable fonts in the Win TTF fonts, but the cyrillic chars appear only on the UNICODE part (0x409 and up).The 4DFont tool displays only the first 256 characters.Is there a tool or method to move the cyrillics to the 0-255 area? Or any way to get them into the 4DFont utility's input area ?
              Thanks,
              Csaba

              Comment


              • #8


                Not sure if you've seen this and/or used this



                http://www.4dsystems.com.au/downloads/Share/unicode%20font%20demo%2021022011.zip



                But that will enable everything you want, you might even like to put the entire unicode font on uSD and reference the cryllic characters directly.



                The 2.9 PmmC allows you to use putc to directly put unicode characters, without using the mapping.



                So have a try and see how you get on with it.
                Mark

                Comment


                • #9
                  I'm struggeling with the exact same thing. I want to use Cyrillic font in Serial Mode.

                  The link to the zip-file above is not working, could you please give me a new link? I'd like to see that demo-project to see if it answers my questions..

                  Regards,
                  H

                  Comment


                  • #10
                    The file that was there is, in many ways, outdated.

                    Have a look at this app note and see if it can solve your problem http://www.4dsystems.com.au/appnote/4D-AN-00089/
                    Mark

                    Comment


                    • #11
                      Originally posted by ESPsupport View Post
                      The file that was there is, in many ways, outdated.

                      Have a look at this app note and see if it can solve your problem http://www.4dsystems.com.au/appnote/4D-AN-00089/

                      Thanx, but i'm beyond that point. I can manage to install a new Cyrillic font and use it serially.
                      The problem is this:


                      i'd like to copy&paste my russian text into the source-code (or read from a file), and display the russian letters on the display.

                      Right now, when i write an ANSI "A", it gets translated to the russian "A" etc.

                      ANSI A has an ASCII value of 65(DEC), while the russian A in the Unicode has the code 0x410 (1040DEC).

                      Does this have to do with what font i'm using?
                      In the Workshop/font-editor, theres a dropdownlist where i can choose Unicode or ANSI. Does this have to do with it?


                      Example of a Russian text i'd like to use in my code, to print on the display. "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШ"

                      Please advice...





                      Comment


                      • #12
                        If you are just sending dynamic strings, then yes, you will need to set the dropdown to Unicode. If you paste a string containing unicode then it will be automagically set for you.

                        As for your source code, that depends on what your source code is and how it is written. If you are using Genie then you need to send the unicode string using Write_StrU. If you are using Serial you need to write the string a character at a time using putCH (and thus have a subroutine in your code that writes the whole string a putCH at a time)
                        Mark

                        Comment


                        • #13
                          I'm using Serial, with Arduino....

                          putChar only takes one byte, while Unicode is two bytes. If so, How do i solve that issue?



                          I'm using a font called Andika, a Unicode font, available here:

                          http://scripts.sil.org/cms/scripts/p...nload#1fd0063a
                          Direct link: http://scripts.sil.org/cms/scripts/r...dika-5.000.zip

                          I used UNICODE-setting in the font-tool.



                          In the code, i'm doing something like this:

                          word str[] = {'П','A','П','р','и','в','е','т'};

                          for(int i=0;i<sizeof(str);i++)
                          {
                          Display.putCH(str[i]);
                          }


                          The output on the display is (chineese letters?):

                          20141121_005053.jpg



                          And some debug-prints:
                          Serial.print("str[i]=");Serial.write(str[i]);Serial.print("\t"); Serial.print(str[i]);Serial.print("\t");Serial.println(str[i],HEX);

                          Gives:

                          str[i]=Ÿ 53407 D09F

                          str[i]=A 65 41 <- ANSII A ???

                          str[i]=Ÿ 53407 D09F

                          str[i]=€ 53632 D180

                          str[i]=¸ 53432 D0B8

                          str[i]=² 53426 D0B2

                          str[i]=µ 53429 D0B5

                          str[i]=‚ 53634 D182

                          str[i]=ð 240 F0

                          The HEX value seems to be the "URL escape"-value and not the real HEX value (should be 0x041F for the first letter).




                          Here's a great site for ASCII-conversions etc:
                          http://rishida.net/tools/conversion/

                          Specific for Russian/Cyrillic with the Text in the code:

                          http://rishida.net/uniview/?charlist...B2%D0%B5%D1%82

                          (Tip: click on the letters on the left side for more info).


                          I hope you can help me with this one..



                          Comment


                          • #14
                            PutChar takes an integer, or word. It's sort of working, as shown by the display of the Chinese letters, just need to figure out why those and not the expected result.

                            If I look up 0xD09F using Windows Character Map and the Arial Unicode font I get the Chinese character as shown on the display.

                            If I try to look up 0xD09F using Windows Character Map and the Andika font I get 'nothing', which indicates that 0xD09f does not exist in this font. (This just means when Font Tool builds the font Windows gives it 'what it can find' for 0xD09F, so it probably takes the Arial Unicode character, but you can never tell for sure).

                            If I paste

                            word str[] = {'П','A','П','р','и','в','е','т'};

                            into Notepad, save it as Unicode and then look at the contents I get

                            0x041F for П

                            If I then look up 0x041f in character map I get the correct character.

                            So I suspect whatever you have typed the 'str' into has either pulled a fast one with the font or has done something odd when building your code. See if you can alter its 'Display Font' to be Andika and 'repaste', or maybe find out what its display font is and use that on the display.

                            HTH

                            After I reread your post I see, that you have perhaps already worked out most of this. Hope my 'Angle' might help solve it
                            Mark

                            Comment


                            • #15
                              Thanks Mark,
                              yes, i've tried everything.

                              I think the problem is with the font-mappings, depending on how the font are created.

                              Let me ask you this way: What font do you recommend? I only need to get the cyrllic fonts working so the font doesn't really matter.

                              All Unicode fonts should work, right?

                              (sorry: fonts and character-encoding is not my strength of area)

                              Comment

                              Working...
                              X