- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey,
How do I add a custom font to the emwin library and GUI?
I have generated a .c file from a font using the Segger font converter. But I can't get it to work with the library. My setup is the CY8CKIT-062-WIFI-BT with a TFT display. The display works fine without the custom font.
Thank you,
Niek
Solved! Go to Solution.
- Labels:
-
PSoC 6 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Niek,
I am sorry I am not sure I understood your query.
If you are referring to adding a .c file into a PSoC Creator project then here are the steps -
- Place the .c file in the project directory.
- In PSoC Creator Workspace Explorer (the left panel next to the editor) you should be able to find a folder called Source Files.
- Right-click on the folder and select Add > Existing Item and select the .c file.
The .c file should now be included in the project.
Also, please ensure you have added the font structure extern variable in your project -
If this does not work, can you please share your font .c file so that I can try adding it to an example project?
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Niek,
Can you please let me know how you used the font to test it out? I think you should be able to use the font using the GUI_SetFont() API.
The Segger emWin User Guide also provides few examples of the resulting C file (Page 262). Can you please confirm that the C file structure is similar? If so, can you please share the generated C file so that I can try to recreate the issue at my end?
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Heey Rakshith,
Thanks for your response. Im now using a font as follows:
But I don't want to use the standard fonts, I want to use a custom font which i generated with the segger font tool. The problem is that I don't know how I can add that .c file to my project within PSoC creator. For example I want to do " GUI_SetFont (GUI_CUSTOMFONT_32);"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Niek,
I am sorry I am not sure I understood your query.
If you are referring to adding a .c file into a PSoC Creator project then here are the steps -
- Place the .c file in the project directory.
- In PSoC Creator Workspace Explorer (the left panel next to the editor) you should be able to find a folder called Source Files.
- Right-click on the folder and select Add > Existing Item and select the .c file.
The .c file should now be included in the project.
Also, please ensure you have added the font structure extern variable in your project -
If this does not work, can you please share your font .c file so that I can try adding it to an example project?
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Rakshith!
This solved my problem