ded icon indicating copy to clipboard operation
ded copied to clipboard

How fix src/free_glyph.c:9:60: error: ‘FT_RENDER_MODE_SDF’ undeclared (first use in this function); did you mean ‘FT_RENDER_MODE_MAX’?

Open Sharabaddin opened this issue 2 years ago • 5 comments

src/free_glyph.c:9:60: error: ‘FT_RENDER_MODE_SDF’ undeclared (first use in this function); did you mean ‘FT_RENDER_MODE_MAX’?

How fix it error?

Sharabaddin avatar Apr 03 '23 22:04 Sharabaddin

Is this define from the FreeType library? Maybe you have a very old version of FreeType?

BillKek avatar Apr 07 '23 12:04 BillKek

@BillKek how check?

Sharabaddin avatar Apr 12 '23 15:04 Sharabaddin

I am having this same issue. I have installed the latest version of FreeType and all other dependancies, but I am getting this error:

src/free_glyph.c:9:60: error: ‘FT_RENDER_MODE_SDF’ undeclared (first use in this function); did you mean ‘FT_RENDER_MODE_MAX’?
    9 |     FT_Int32 load_flags = FT_LOAD_RENDER | FT_LOAD_TARGET_(FT_RENDER_MODE_SDF);
      |                                                            ^~~~~~~~~~~~~~~~~~

I am also getting this:

/usr/include/freetype2/freetype/freetype.h:3135:47: note: in definition of macro ‘FT_LOAD_TARGET_’
 3135 | #define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )
      |                                               ^
src/free_glyph.c:9:60: note: each undeclared identifier is reported only once for each function it appears in
    9 |     FT_Int32 load_flags = FT_LOAD_RENDER | FT_LOAD_TARGET_(FT_RENDER_MODE_SDF);
      |                                                            ^~~~~~~~~~~~~~~~~~
/usr/include/freetype2/freetype/freetype.h:3135:47: note: in definition of macro ‘FT_LOAD_TARGET_’
 3135 | #define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )
      |

I think this project looks really promising, and I hope the error is resolved soon, as I am looking forward to trying it out.

BitPigeon avatar May 09 '23 23:05 BitPigeon

i am getting same error

abhinavpatel0 avatar Oct 01 '23 08:10 abhinavpatel0

ChatGPT solution that actually worked:

replace line 9 in src/free_glyph.c: FT_Int32 load_flags = FT_LOAD_RENDER | FT_LOAD_TARGET_(FT_RENDER_MODE_SDF); with: FT_Int32 load_flags = FT_LOAD_RENDER | FT_LOAD_TARGET_(FT_RENDER_MODE_NORMAL);

Image

deoxify avatar Feb 14 '25 20:02 deoxify