Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.2k stars 225 forks source link

Ability to use Custom Icons (fapro) #2075

Open HadiHassaoui opened 3 weeks ago

HadiHassaoui commented 3 weeks ago

Enhancement Summary

Adding support ot use custom icons

Detailed Description

Is-it possible to add the possiblity to use custom icons (ex.: fapro:mycustomicon). mainly in main page where there no text on top chip/icon of the home page (would be nice everywhere too).

Additional Context

No response

edwardtfn commented 3 weeks ago

This is a bit more complex than it looks initially. The fonts must me loaded to the Nextion Display at build time, so we have to create a font with all the possible icons, in all the different sizes and load this to the TFT file when building it. And to make it worse, the fonts takes a lot of space which we don't have available... 😩

HadiHassaoui commented 3 weeks ago

I understand the issue, thanks for the fast answer and the precise explanation. and by the way that's a wonderfull work that you did.

NdS-Research-Facilities commented 3 weeks ago

I was trying to create a large (70~100 pt) mdi icon font, but didn't succeed. Any hints on how to make these Nextion fonts from mdi would be greatly appreciated (So not custom, just bigger)

edwardtfn commented 3 weeks ago

We use this tool, just changing the font size: https://github.com/edwardtfn/Generate-HASP-Fonts/blob/e1428f346777be69440f6bb00f1698815cb525d4/Generate-HASP-Fonts.ps1#L74

It creates a merging of two fonts, one for text, with ASCII chars only, and one for the icons, and merge both in a .zi file. You can play with that to generate only the icons, or even to use the custom icons you want, with the size you want.