1111
1212#if ADDRESS_STRING_GRID
1313
14+ #define ADDR_GRID_FONT GUI_DEFAULT_FONT
1415#define ADDR_GRID_TOPPAD 12
1516#define ADDR_GRID_X 5
1617#define ADDR_GRID_Y 5
1718#define ADDR_GRID_SIZE (ADDR_GRID_X * ADDR_GRID_Y)
1819#define ADDR_TEXTSPLITLEN (MAX_DISPLAY_ADDRESS_LEN / ADDR_GRID_SIZE)
1920
21+ // The length of the required buffer to hold 'len' characters
22+ // with a nul-terminator injected every 'wordlen' characters, and
23+ // at the very end. eg. for "abcdefhij\0" -> "abc\0def\0ghi\0j\0"
2024#define SPLIT_TEXT_LEN (len , wordlen ) (len + (len / wordlen) + 1)
2125
2226// Helper to copy text from one buffer to another, where the destination has terminators every
23- // 'wordlen' chars, eg: "abc\0def\0ghi\0j\0"
27+ // 'wordlen' chars, eg: "abcdefghi\0" -> " abc\0def\0ghi\0j\0"
2428// output 'num_words' is number of 'words' written - eg. 4
2529// output 'written' is number iof bytes written, including all '\0's - eg. 14
2630static void split_text (const char * src , const size_t len , const size_t wordlen , char * output , const size_t output_len ,
@@ -89,8 +93,8 @@ gui_activity_t* make_display_address_activities(const char* title, const bool sh
8993#if ADDRESS_STRING_GRID
9094 JADE_ASSERT (num_words <= ADDR_GRID_SIZE );
9195 const char * remaining_words = NULL ;
92- act = make_text_grid_activity (
93- title , hdrbtns , 2 , ADDR_GRID_TOPPAD , ADDR_GRID_X , ADDR_GRID_Y , address_words , num_words , & remaining_words );
96+ act = make_text_grid_activity (title , hdrbtns , 2 , ADDR_GRID_TOPPAD , ADDR_GRID_X , ADDR_GRID_Y , address_words ,
97+ num_words , ADDR_GRID_FONT , & remaining_words );
9498 JADE_ASSERT (remaining_words == address_words + words_len ); // all words consumed (displayed)
9599#else
96100 const int ret = snprintf (buf , sizeof (buf ), "\n%s" , address );
@@ -114,7 +118,7 @@ gui_activity_t* make_display_address_activities(const char* title, const bool sh
114118 JADE_ASSERT (num_words > ADDR_GRID_SIZE );
115119 const char * remaining_words = NULL ;
116120 act = make_text_grid_activity (titlebuf , hdrbtns1 , 2 , ADDR_GRID_TOPPAD , ADDR_GRID_X , ADDR_GRID_Y , address_words ,
117- ADDR_GRID_SIZE , & remaining_words );
121+ ADDR_GRID_SIZE , ADDR_GRID_FONT , & remaining_words );
118122 JADE_ASSERT (remaining_words > address_words );
119123 JADE_ASSERT (remaining_words < address_words + words_len ); // Some words remaining
120124#else
@@ -136,7 +140,7 @@ gui_activity_t* make_display_address_activities(const char* title, const bool sh
136140#if ADDRESS_STRING_GRID
137141 const size_t num_p2words = num_words - ADDR_GRID_SIZE ;
138142 * actaddr2 = make_text_grid_activity (titlebuf , hdrbtns2 , 2 , ADDR_GRID_TOPPAD , ADDR_GRID_X , ADDR_GRID_Y ,
139- remaining_words , num_p2words , & remaining_words );
143+ remaining_words , num_p2words , ADDR_GRID_FONT , & remaining_words );
140144 JADE_ASSERT (remaining_words == address_words + words_len ); // all words consumed (displayed)
141145#else
142146 ret = snprintf (buf , sizeof (buf ), "\n%s" , address + MAX_DISPLAY_ADDRESS_LEN );
0 commit comments