Skip to main content
ferro
Lead
November 13, 2023
Solved

Suggestion for Typography/TypographyFontIndex, and this use of struct construct in general

  • November 13, 2023
  • 4 replies
  • 1277 views

Hi GFX team,

GFX auto generates Typography/TypographyFontIndex structs in "\generated\fonts\include\fonts\ApplicationFontProvider.hpp"

 

struct Typography
{
 static const touchgfx::FontId DEFAULT = 0;
};

 

Could you consider adding a tag that would alias type of struct members ie:

 

struct Typography
{
 using type_t = touchgfx::FontId;
 static const touchgfx::FontId DEFAULT = 0;
};

 

This would allow to write eg funtion with  Typography as a parameter:

 

void functUsingTypography ( Typography::type_t tpg );

 

 

Thanks

    Best answer by Mohammad MORADI ESFAHANIASL

    Hello @ferro ,

    We will consider it for future work, but could you explain what functionality you would like to have that you cannot use touchgfx::FontId or Typography directly?

    4 replies

    ST Employee
    November 14, 2023

    Hello @ferro ,

    We will consider it for future work, but could you explain what functionality you would like to have that you cannot use touchgfx::FontId or Typography directly?

    Mohammad MORADIST Software Developer | TouchGFX
    ferro
    ferroAuthor
    Lead
    November 14, 2023

    Hi Mohammad,

    "could you explain what functionality you would like to have that you cannot use touchgfx::FontId or Typography directly"

    Ah, I see. I must have got something wrong while trying to use Typography as a type. Or there was some scenario where I thought Typography::type_t to be useful. Thanks and sorry for the spam.

    Ferro

     

     

    ST Employee
    November 14, 2023

    No worries at all :grinning_face:

    Good luck

    Mohammad MORADIST Software Developer | TouchGFX
    Associate
    November 10, 2025

    This make sense adding a type alias like type_t would make it much easier to write function using the struct members without repeating the underline type . It will improve readability and maintainability .