Issue in toolchain 2.5.0, error extracting fonts. gen_cfb_font_header.py, missing getsize.

Hi,

I have been trying to update a project from SDK and Toolchain 2.2.0 to 2.5.0 for both.

But I find that I get an error extracting fonts.

  File "/home/user/ncs/v2.5.0/zephyr/scripts/build/gen_cfb_font_header.py", line 80, in extract_font_glyphs
    fw, fh = font.getsize(chr(i))
AttributeError: 'FreeTypeFont' object has no attribute 'getsize'

It seems to me the reason is that getsize no longer exists in Python PIL package. At some point after Toolchain 2.2.0, PIL version 10 seems to be required, which no longer implements this method.

See: https://pillow.readthedocs.io/en/stable/deprecations.html#font-size-and-offset-methods

I tried editing the code, exchanging the method with the suggested code, but it seems to not give the exact same output anymore as I get an error further on... this could have been my error, never the less the issue remains in toolchain 2.5.0.

Parents
  • Hello Jon0,

    Could you please provide more details about your setup?

    In particular:

    • How are the toolchains and SDKs installed?
    • What is going on when this error occurs?
      • Can you provide the full log, if there is nothing confidential?
      • Does this happen while building your application, or while running some helper scripts in the SDK/Tolchain?
    • What are the steps to reproduce this error?
    • Can this error be produced with a sample on NCS v2.5.0?
      Or does it only happen when upgrading a sample from an earlier NCS version?

    If you can think of any other details that might be relevant, please share them as well.

    Please note that it is the Christmas - New Year holiday season here. We are thus severely understaffed, and there would be delays in responses. Our apologies for the inconveniences. 

    Hieu

Reply
  • Hello Jon0,

    Could you please provide more details about your setup?

    In particular:

    • How are the toolchains and SDKs installed?
    • What is going on when this error occurs?
      • Can you provide the full log, if there is nothing confidential?
      • Does this happen while building your application, or while running some helper scripts in the SDK/Tolchain?
    • What are the steps to reproduce this error?
    • Can this error be produced with a sample on NCS v2.5.0?
      Or does it only happen when upgrading a sample from an earlier NCS version?

    If you can think of any other details that might be relevant, please share them as well.

    Please note that it is the Christmas - New Year holiday season here. We are thus severely understaffed, and there would be delays in responses. Our apologies for the inconveniences. 

    Hieu

Children
No Data
Related