Missing Fonts flagged up, but where are all font locations?

I'd be very grateful if someone might be able to list for me, all possible known locations of Font files? (I wish they were all in the same place!)

I am getting a message "No such file or directory", but I have neither deleted nor moved the directory nor the font files. As my directive is of the form:
"#include <Fonts/fontname.h>"
I do not know where exactly the missing file is in the directory structure, and I know that there could be several locations for Fonts!

I couldn't find documentation on where the IDE might keep our font files!

Thanks alot in advance.

KASpencer

What's the fonts? What for? TFT displays, led matrix, IDE interface?

Thanks for that, @b707
The font is for SH1106 (1.3" OLEDs) displays.
It would help even just to know where exactly the #include is pointing. If I knew where it was I could copy the fontlibrary back in, but so far I haven't found such a directory.
I wrote the code myself but a few months ago it compiled perfectly and has been in use.
Any help will be appreciated!

KASpencer

3rd party libraries are installed in the libraries subdirectory of the sketchbook directory. You can find the used sketchbook directory in file/preferences.

Thanks @sterretje - I'll look at that.
I havea copy of the fonts, and can put them back. I just need to know where they were!

KASpencer

Sorry - still not managing to install the font file.
I installed it a long time ago, but now I cannot remember how I did it.
It is a ttf font, but the IDE simply doesn't accept the name of the file (.ttf).
I have put the zipped file version in with the other zipped fonts, and tried that via manage libraries but somehow no joy!
Any ideas?
KASpencer

You mean like #include myFont.ttf?

The library manager only knows about "registered" libraries. So if your font file wasn't a "registered" library, it will not know about it.

If it was a library that came as a zip file, you can use sketch / manage libraries / add .zip library.

If that does not work

Let's assume that your font file was called myFont. In that case you can create a directory called myFont in the libraries directory in the sketchbook directory and copy the file myFont.h there.

If you have multiple font files, you can create a directory fonts in the libraries directory and copy the font files there. Be aware that if a certain library adds font files as well, the result might be that the IDE picks the incorrect font files when using the includes.

To prevent that, the easiest is to add the file myFont.h to the sketch directory of the sketch that you're working on and use #include "myFont.h" (note the double quotes).

There are no predefined places for fonts in the IDE. The Arduino itself knows nothing about fonts and doesn't work with it.
If the font is a part of the library, it usually saved in the library's folder. Every library manages it own fonts.

All above means that if you used a font before, you done it with a library. To use it again you should to figure out the library that works with this font. Since no one knows which library you used, you will have to do this yourself .

Thanks again, @sterretje ...
Iv'e done all this before and the code has been working for some time. However, after a few months, I needed to do some updating, and, before I made any changes I connected a new Due, and intended to check the existing code. But it wouldn't compile because the TTF font, previously called up by a simple #include <Fonts/JuraLight8pt7b.h> (with another similar variant) caused a failure to compile because somehow the fonts were lost. I suspect that this applied to some other fonts too, but the JuraLight are crucial as they are proportional.
So at the moment my main pressure is to get Jura-Light.ttf installed and working,but currently that's not happening.
Maybe you can advise the best place to put the ttf file before I attempt again to get it installed and availabla.

In hope!
KASpencer

Which library are you using to drive the display?

Installing the Jura-Light.ttf font onto your computer, or into any directory, will not help. You need the JuraLight8pt7b.h file that has the font encoded for your particular display library.

Are you certain there is not a Font subfolder inside the folder where the sketch is located?

Create a library directory Fonts under the libraries directory and copy JuraLight8pt7b.h in there.

Google does not show any results for that font file. If you still have problems, attach the zip file.

What may have happened is that you installed a custom font into one of the libraries, and then the library was updated, deleting your custom font in the process. There are several display libraries that have a Font subfolder that would be compatible with your #include.

Thank you David, because that is exactly what I had previously, just a few months ago when the project would compile perfectly. Somehow those font files in *.h format have disappeared, although it seems that the Adafruit fonts are still present.

So, I am sure that the *.h files were in my library directory:
(C:\Users\MyUserName\Documents\Arduino\libraries)
in the Adafruit_GFX_Library directory under the Fonts directory, all as *.h files being in the same place. However, the ttf fonts have now disappeared and I am looking for a way of getting the Jura-Light.ttf font files as *h files to install that location. So far no success.

I must have found a way before, apparently with so little difficulty that I cannot even remember doing it! As an example, I used the #include <Fonts/JuraLight8pt7b.h>.

So I think that you must be right, in that a library update has obliterated all the font files that weren't part of the AdaFriut library. But all the JuraLight font packages which I have found seem to treat the fonts as completely integrated in the .ttf file.

I've been trying to find a font file with *.h equivalents for each font definition contained in the jura-light.ttf file. So far no luck, but it has confirmed my suspicion of what I need.

Thanks,

KASpencer

If you Google font to gfx converter, there are several online tools for generating the .h file from the ttf font.

@sterretje - thanks!

Of course, I would if I could! But that's exactly the nub of the issue: all of the individual font definitions in the Jura-Light.ttf file have gone from the font file. My issue is extracting them from the ttf file or somehow converting them to *h files. Those *h files were in that AdaFriut directory for several years, and it seems likely that an upgrade of that library has kiboshed the other contents.

Now I am searching for the *.h versions of the JuraLight files.

KASpencer

@Delta_G I agree my reference to the IDE keeping our font files was a bit vague: I really meant where I keep those files and then I inform the IDE where they are!

But that's a bit bye-the-bye, because the issue is that there is a location for my fonts in the library (in the Adafruit_GFX_library directory). But it seems that an upgrade of the Adafruit library where they were deposited has deleted the JuraLight fonts. It would be better if an update process deleted only those files which were actually part of the library, as I reckon a library should "know" it's contents!

Anyway, your hint of the possibility of someone more expert looking this issue would be welcome: I know I need to find the jura-light.ttf library in *.h format, but currently I have had no success with that. Then again, maybe there is font format converter that can read a *.ttf file and generate the *h files.

Thanks,

KASpencer

Something in here? ttf to .h - Google Search

@b707 Thanks for commenting.

To home in on the actual issue, in case you have any answers:
In the Library directory, there is an Adafriut_GFX_Library directory, containing a Fonts directory, which in turn contained all the fonts.h files.
Updating that Adafriut library seems to have deleted all the fonts, including those that were not part of the Adafruit library. (A bit arrogant, maybe!).
Amongst those *h files was a set of Jura-Light.ttf fonts in *.h format - one of them as shown in an #include directive.
I hear you say: "Replace them!". I would if I could. But I cannot remember how I got that TTF font as a series of *.h files. I have the Jura-Light.ttf file but I cannot remember how (or even whether) I extracted the fonts as *.h files. Furthermore, despite extensive searching, I cannot find that font as *.h files anywhere, at least thus far.
I' m hoping that this explains properly the nature of the problem - any further contribution would be much appreciated!

KASpencer

Not sure if it is in the Adafruit_GFX_Library downloaded through the IDE’s library manager, but the GitHub repository for Adafruit_GFX_Library has a command-like utility under the fontconvert directory.

There is also a web based utility called truetype2gfx

Thanks David.
I am pleased to say that have converted the fonts online and now all is well.
Thanks for your help.
Kenneth