Announcement

Collapse
No announcement yet.

Custom Font on PixxiLCD-13P2

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

  • Custom Font on PixxiLCD-13P2

    Hi everyone. First of all, let me know if I'm not publishing in the correct group/forum and excuse me in advance.

    I would like to use a custom font on the PixxiLCD-13P2 and I tried several things:

    1) Using a custom font with StaticText Widget. It works very well, but I can't modify the string (obviously because it's a "static" string) and I would like to change text.
    2) I also tried with Strings Widget and it didn't work, but as I understand it this widget is also static right? So no change can be made.
    3) I used an Inherent Font widget and it works also very well and I can change the text (exactly what I want!) buuut...

    I would like to control my display through the serial port (I tested with a custom code (serin() and so, and it works)), but I would like to use the Serial Environment.

    My code:
    Code:
    hndl := file_LoadImageControl(0,0,3);
    //txt_FontID(ID);
    img_TxtFontID(hndl,iFontIFont1);
    gfx_MoveTo(40,100);
    print("Hello World");
    For now, this code can print "Hello World" with my custom font which is set by img_TxtFontID(hndl,iFontIFont1). But, as I understand the doc, I should use txt_FontID() right? What's the difference between them?

    txtFontID is present in the doc of Serial Commands, but not img_TxtFontID, so I guess i should use the first one for Serial Commands? If so, I don't understand what should I use as parameter? (the "ID" parameter)

    Let me know if I'm not very clear.

    Thank you

  • #2
    "Hi,

    Welcome to the forum!

    2.) I also tried with Strings Widget and it didn't work, but as I understand it this widget is also static right? So no change can be made.
    The Strings widget is not static. With or without the host, the strings can be change.

    I would like to control my display through the serial port (I tested with a custom code (serin() and so, and it works)), but I would like to use the Serial Environment.
    If you plan on fonts on pixxiLCD SPE, you will need to generate and upload font resources to the display. The easiest method would be to create a ViSi project and upload its resources. By doing so, you will be able to upload fonts to the built-in flash chip.

    In this process, you might overwrite the SPE program so you will need to use WS4 to reupload it.

    For now, this code can print "Hello World" with my custom font which is set by img_TxtFontID(hndl,iFontIFont1). But, as I understand the doc, I should use txt_FontID() right? What's the difference between them?
    The function img_TxtFontID() function is used when the file system is in Flash. On the other hand, the txt_FontID() function is used when the file system is in uSD.

    In your case, the PixxiLCD-13P2 display doesn't support uSD, using flash is the only option.

    I hope this helps.

    Best regards
    Last edited by ivan_4d; 29 March 2021, 06:56 PM.

    Comment


    • #3
      Hi, thank you very much for your answer! 😊

      Yes it helps me a lot!

      If I understand, it is impossible to use the img_TxtFontID function with the Serial Commands. Meaning it is impossible to use the file system on Flash with Serial Commands?

      In any case I'll probably use a custom firmware.

      Very best regards.

      Comment


      • #4
        Hi,

        "If I understand, it is impossible to use the img_TxtFontID function with the Serial Commands."

        Upon checking, I've confirmed that the function doesn't exist yet in SPE commands. I'll report this to our team so it can be implemented in future revisions of Pixxi SPE.

        For now, I would suggest using ViSi Genie instead. ViSi Genie operates using Serial UART just like SPE. This provide simpler commands that allows you to simply update widgets and strings and receive reported events triggered by touch inputs.

        You can find the ViSi Genie documentation here: Visi-Genie-Arduino-Library

        There is also an Arduino library available you can download using Arduino IDE's library manager. Simply search for genie. See screenshot below

        Click image for larger version

Name:	genie arduino library.png
Views:	48
Size:	53.7 KB
ID:	75360

        I hope this helps.

        Best Regards

        Comment


        • #5
          Hi, sorry I never answered to you.

          I started to work again on the screen (had to make the PCB) and I'm simply using print("xxx") function to print text and it works well.

          Now, something else bothers me: the "aliasing" (if it is). Let me explain what I mean:

          - when you write a text on the screen by using Static Text the text looks great, because you can see some kind of aliasing on the letters borders (which are "smooth")
          - when you write the same text by using print function OR by using Strings widget, the letters are pixelised

          Is there any kind of solution to make my text "smoother"?

          Many thanks.

          Comment

          Working...
          X