Skip to main content
ferro
Lead
June 5, 2024
Solved

Cannot import package: Typography with id: "Default" already exists

  • June 5, 2024
  • 4 replies
  • 2616 views

Hi,

Do you know what I am doing wrong ?

ferro_0-1717592418235.png

 

Thanks

    This topic has been closed for replies.
    Best answer by ferro

    So before export, changing Typography name used by the Custom container from 'Deafult' to let say 'DeafultExp' resolved this issue.

    Hm, so there must be as many different Typography names as number imported Custom containers ?

    Gfx understands that the 'DefaultExp' and 'Default' are the same Fonts and asigns them the same Id:

    static const touchgfx::FontId DEFAULT = 0; // verdana_20_4bpp

    static const touchgfx::FontId DEFAULTEXP = 0; // verdana_20_4bpp

     

     

    struct Typography
    {
     static const touchgfx::FontId DEFAULT = 0;
     static const touchgfx::FontId LARGE = 1;
     static const touchgfx::FontId SMALL = 2;
     static const touchgfx::FontId DEFAULT1 = 3;
     static const touchgfx::FontId DEFAULTEXP = 4;
    };
    
    struct TypographyFontIndex
    {
     static const touchgfx::FontId DEFAULT = 0; // verdana_20_4bpp
     static const touchgfx::FontId LARGE = 1; // verdana_40_4bpp
     static const touchgfx::FontId SMALL = 2; // verdana_10_4bpp
     static const touchgfx::FontId DEFAULT1 = 0; // verdana_20_4bpp
     static const touchgfx::FontId DEFAULTEXP = 0; // verdana_20_4bpp
     static const uint16_t NUMBER_OF_FONTS = 3;
    };

     

     

     

    4 replies

    ferro
    ferroAuthorBest answer
    Lead
    June 5, 2024

    So before export, changing Typography name used by the Custom container from 'Deafult' to let say 'DeafultExp' resolved this issue.

    Hm, so there must be as many different Typography names as number imported Custom containers ?

    Gfx understands that the 'DefaultExp' and 'Default' are the same Fonts and asigns them the same Id:

    static const touchgfx::FontId DEFAULT = 0; // verdana_20_4bpp

    static const touchgfx::FontId DEFAULTEXP = 0; // verdana_20_4bpp

     

     

    struct Typography
    {
     static const touchgfx::FontId DEFAULT = 0;
     static const touchgfx::FontId LARGE = 1;
     static const touchgfx::FontId SMALL = 2;
     static const touchgfx::FontId DEFAULT1 = 3;
     static const touchgfx::FontId DEFAULTEXP = 4;
    };
    
    struct TypographyFontIndex
    {
     static const touchgfx::FontId DEFAULT = 0; // verdana_20_4bpp
     static const touchgfx::FontId LARGE = 1; // verdana_40_4bpp
     static const touchgfx::FontId SMALL = 2; // verdana_10_4bpp
     static const touchgfx::FontId DEFAULT1 = 0; // verdana_20_4bpp
     static const touchgfx::FontId DEFAULTEXP = 0; // verdana_20_4bpp
     static const uint16_t NUMBER_OF_FONTS = 3;
    };

     

     

     

    GaetanGodart
    ST Employee
    June 6, 2024

    Hello @ferro ,

     

    I previously had this error message when  importing custom containers (tpkg files).
    Basically, when exporting a custom container using one of the default fonts (default, large and small), when importing it to a project already having the same font names, there will be this error message.

    A good practice is then to change the name of the typographies ( ~= font names) to not have this erroe message.

     

    This seems to be what you have done to solve the issue yourself (c.f. your previous message).

     

    I invite you to select either my comment or you comment as "best answer" to make it easier for other users to find the right answer to the problem.

     

    Regards,

    Gaetan GodartSoftware engineer at ST (TouchGFX)
    ferro
    ferroAuthor
    Lead
    June 6, 2024

    @GaetanGodart  Thanks for confirming my findings.

    GaetanGodart
    ST Employee
    June 7, 2024

    My pleasure Ferro :smiling_face_with_smiling_eyes:

    Gaetan GodartSoftware engineer at ST (TouchGFX)