My code that I copied from my old computer is showing this error “Component not found: font.”, in this part of the code. In this sense, I have already installed the fonts in homeassistant and still the error persists.
If I read the error correctly, it is not the font files that are missing, but it does not understand font: itself. What version of esphome are you using? Also, the docs state you need additional packages. If you use the ESPHome addon you should already have it, if you have a different install you may not.