FONT Conversion Error

When converting a ttf font, when I add the file to my program and use LV_FONT_DECLARE(#name) I get this compile error.:-

|expected identifier or ‘(’ before numeric constant|GOTHAM_56.c


My program will not compile

I expect the program to compile and the new font be available

Why the # in the name?

Hi yes, that is how I have declared it.

The error is highlighted around this:-

#ifndef GOTHAM_56
#define GOTHAM_56 1

Do the built-in fonts work? They work the same way.

Apologies, I solved this, it was to do with my compiler.

Please mark as closed and thanks for your attention on this :smile:

No problem! :slight_smile:

Hello, how did you solve this problem? I have exactly the same problem, I am using the Visual Studio simulator.



You are defining BIOR_48 somewhere in your code, and trying to declare it as a variable at the same time. That won’t work.

Yes, you were right! The problem occurs when I named my custom font in uppercase and the font converter creates a macro with the same name as the font in uppercase



In order for the generated font to be compiled correctly, your font name in the conversion tool must not contain all letters in uppercase.

Please mark as closed, thank you for you help!

We should probably tweak the converter to add a prefix/suffix so this wouldn’t be a problem.

1 Like