-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable required fonts in sdkconfig.defaults of the project generated by Squareline (BSP-318) #166
Comments
As I remember right, I mentioned this problem in e-mail discussion some months ago. |
Hi, I was about writing you about a related topic, so it's great that you have opened this discussion. I think we should discuss this topic in a more generic way: How to how to add custom options to the slb file and how to export config options in a custom way? My idea is that we can add a {
{
"custom_options": [{
"name": "Display type",
"description": "This board is available with multiple displays. Select the version you have",
"options": [{
"name": "Display 1",
"description": "320x240, 3.2 inch, 16 bit display",
"tag": "__UI_ESP_BOARD_DISPLAY_TYPE_1__"
},
{
"name": "Display 2",
"description": "800x480, 5 inch, 16 bit display",
"tag": ["__UI_ESP_BOARD_DISPLAY_TYPE_2__", "__UI_ESP_LARGE_DISPLAY__"],
"width": 800
}
]
}],
"custom_tags": [{
"file": "path/to/sdkconfig",
"tag": "__LV_FONT_MONTSERRAT_10__",
"value_if_true": "CONFIG_LV_FONT_MONTSERRAT_10=y",
"value_if_false": "CONFIG_LV_FONT_MONTSERRAT_10=n"
},
{
"file": "path/to/file",
"tag": "__UI_ESP_BOARD_DISPLAY_TYPE_1__",
"value_if_true": "CONFIG_DISPLAY_TYPE_800_480=y"
}
]
} This what happens:
What do you think? |
Hi @kisvegabor, |
Yes, but something just came to my mind. Normally we replace the "tags" when a new project is exported. However the list of used fonts can change after the project is exported too. So the font related tags needs to replaced on "UI file export" too. However if the tags are replaced with their final value, they can't be replaced again. E.g. when So it means there are some "dynamic data" which needs to be recreated and replaced again and again on UI file export. The recreate these dynamic tags we can add a special markup in the files. For example:
What do you think? |
That's good point that there must be some mechanism to replacing exported data. |
Do note that modifying sdkconfig.defaults after sdkconfig has been already generated has no effect: the build system will not generate sdkconfig again unless it is deleted. |
In this case we can de two things:
I vote for 2) because calling the script might cause more issues than it resolves. And it seems the "dynamic data" problem is limited to the fonts so there is no reason to introduce a more complex and generic solution. |
@kisvegabor I'm sorry for the naive question but: Could the whole mechanism of adding fonts to an application be reworked according to your point 2? That is: there are no options in |
I think it would be the simpler case and we do it even with the current SLS. |
This issue is at the boundary between ESP-BSP and Squareline, I'm filing it here for now for discussion.
Currently when we use a font in Squareline which isn't enabled by default in LVGL, the build will fail due to missing definitions. For example, if we use Monserrat size 48,
CONFIG_LV_FONT_MONTSERRAT_48=y
option should be enabled in sdkconfig.This could be solved by:
An alternative, simpler, solution:
sdkconfig.defaults
by default. Unused fonts will be eliminated at link time, since IDF build system uses-ffunction-sections -fdata-sections -Wl,--gc-sections
options.cc @kisvegabor @espzav
The text was updated successfully, but these errors were encountered: