cancel
Showing results for 
Search instead for 
Did you mean: 

.bdf fonts not working?

Tuoman
Senior II

Documentation claims:

The Font Converter accepts
 
TrueType (.ttf)
OpenType (.otf)
Glyph Bitmap Distribution Format (.bdf).

I tried to use fonts from:

https://github.com/farsil/ibmfonts

I put fonts into folder: myproject\TouchGFX\assets\fonts

After restarting TouchGFX, IBM fonts do not appear into Typography list.

What is the problem?

1 ACCEPTED SOLUTION

Accepted Solutions

I noticed that I do not need the .bdf font at all!

I can generate Bitmap strikes in FontForge, and export it as .ttf font for a particular size. Pixel data is retained perfectly, with the ability to modify each pixel.

Thanks for the help anyway!

View solution in original post

9 REPLIES 9
Romain DIELEMAN
ST Employee

Hi,

The fonts might be available under another name (or weird name). A way to set it if you cannot find the name in the list would be to open the excel sheet in the assets/texts folder, and set the font you wish to use there. You need to not have TouchGFX open to be able to save the changes in the excel sheet.

/Romain

It should appear with name IBM xxxx, as stated in the font data

FONT -IBM-BIOS-Normal-R-Normal--8-60-96-96-C-80-ISO10646-1
SIZE 6 96 96
FONTBOUNDINGBOX 8 8 0 -1
STARTPROPERTIES 34
FOUNDRY "IBM"
FAMILY_NAME "IBM BIOS 8x8"
WEIGHT_NAME "Normal"
SLANT "R"
SETWIDTH_NAME "Normal"
ADD_STYLE_NAME ""
PIXEL_SIZE 8
POINT_SIZE 60
RESOLUTION_X 96
RESOLUTION_Y 96
SPACING "C"
AVERAGE_WIDTH 80
CHARSET_REGISTRY "ISO10646"
CHARSET_ENCODING "1"
FONTNAME_REGISTRY ""
CHARSET_COLLECTIONS "ASCII ISOLatin1Encoding ISO8859-2 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-8 ISO8859-4 ISO10646-1"
FONT_NAME "IBMBIOS8x8"
FACE_NAME "IBM BIOS 8x8"

I went through the list, there is no new fonts.

Did you try to import those fonts? Do they work in your TouchGFX? I cannot get these .bdf fonts to appear.

Hi,

I tried the process I wrote above where you modify directly the font in the excel sheet. I then ran my project on target from CubeIDE and it works (I think, not 100% sure what the font I used from the git repo you shared looks like). However when I opened TouchGFX Designer I had a warning saying that the font was not found.

What I believe is happening is that, like for the OpenType format, TouchGFX handles the formats but TouchGFX Designer does not. You can still work on your GUI and generate code from TouchGFX Designer but will need to run on target from another tool.

/Romain

I cannot get that method to work. I can Generate project from Designer & build the code, but font is invisible. I used same height and bpp as the font.

Previews of these BIOS fonts are shown in the git repo description. It looks like a typical blocky BIOS font.

>What I believe is happening is that, like for the OpenType format, TouchGFX handles the formats but TouchGFX Designer does not. You can still work on your GUI and generate code from TouchGFX Designer but will need to run on target from another tool.

Can your team fix this .bdf font problem to TouchGFX Designer ASAP ? We quickly need .bdf fonts in order to fix them pixel per pixel for our ST based product.

When .bdf font is added to the text file I also get this error in Designer when trying to generate the code:

>Object reference not set to an instance of an object

Thanks!

Hi,

This will unlikely be fixed soon unfortunately in TouchGFX Designer. This format is really old and not used anymore. For now I would recommend to transform those fonts to the TrueType format. I found two scripts on github, I hope this will help you: script 1 and font file converter 2.

Just to investigate a bit more, what do you mean the font is "invisible" ? I am able to run on target using STM32CubeIDE but the text displayed does not use the right font, but is is not invisible.

/Romain

>transform those fonts to the TrueType format

I don't actually need these particular fonts, I just use these to test that .bdf format works. The problem is that I want to fix automatically generated font pixels. That is not possible with TrueType fonts. TouchGFX generated bitmap fonts have a lot of incorrect pixels, making them unacceptable to our UI standards.

.bdf format is the only way I think that I can correct generated font pixels manually, without spending months creating custom tools. Any other ideas how to fix font pixels manually, other than .bdf font format?

>Just to investigate a bit more, what do you mean the font is "invisible" ?

I cannot see the text at all if I use .bdf font. If I use another font, text is visible.

Hi,

So I was actually able to use bdf fonts and display the text on my board (h7b3 disco), my mistake was that I did not set the bpp setting of the typography using the bdf font to 1... You also need to make sure you use the right size (so 8 for the font I used called ib8x8u.bdf).

The conclusion is that the font converter does work with bdf but the TouchGFX Designer tool does not handle this format. Like I wrote above you need to set the font for your typographie within the excel sheet found under the TouchGFX/assets/texts folder. (make sure you do not have the project in Designer open for that step otherwise you will not be able to save your changes)

0693W000007ZuDoQAK.png 

After setting this, open Designer again and generate code even though the warnings are still there. You will not be able to run from Designer, you can use CubeIDE to do so ( or gcc, ewarm, keil).

I hope that it is enough for your project.

/Romain

I noticed that I do not need the .bdf font at all!

I can generate Bitmap strikes in FontForge, and export it as .ttf font for a particular size. Pixel data is retained perfectly, with the ability to modify each pixel.

Thanks for the help anyway!

Haha well good to hear that you will be able to continue your project now.

At least other people will be able to land on this post if they wish to work with bdf

/Romain