diff --git a/esphome/components/font/__init__.py b/esphome/components/font/__init__.py index 0309e30da6..20ad6607ae 100644 --- a/esphome/components/font/__init__.py +++ b/esphome/components/font/__init__.py @@ -147,11 +147,6 @@ def check_missing_glyphs(file, codepoints, warning: bool = False): def validate_font_config(config): - if config[CONF_FILE][CONF_TYPE] == TYPE_LOCAL_BITMAP and CONF_SIZE in config: - raise cv.Invalid( - "Size is not a valid option for bitmap fonts, which are inherently fixed size" - ) - """ Check for duplicate codepoints, then check that all requested codepoints actually have glyphs defined in the appropriate font file. @@ -209,6 +204,11 @@ def validate_font_config(config): if font.get_char_index(x) != 0 ] + if config[CONF_FILE][CONF_TYPE] == TYPE_LOCAL_BITMAP and CONF_SIZE in config: + raise cv.Invalid( + "Size is not a valid option for bitmap fonts, which are inherently fixed size" + ) + return config