Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ft2build.h file is missing #88

Open
HP-Sparks opened this issue Jun 21, 2016 · 17 comments
Open

ft2build.h file is missing #88

HP-Sparks opened this issue Jun 21, 2016 · 17 comments

Comments

@HP-Sparks
Copy link

Hi,
I'm giving a try to a simple Arduino-based Oscilloscope project, the " fontconvert.c " file refers to a " ft2build.h " file to be included. (see line 23: #include <ft2build.h>)

Where can we find this file if Not present amongst the already present libraries on the computer ?

Thanks in advance.

Best regards,
HP_

@pljakobs
Copy link
Contributor

Hi HP_,

what platform are you building on?
you'll need the freetype 2 development packages under Linux / cygwin.
I have tested it on Fedora 21, SuSE 13.x, Mint and cygwin.

pj

@HP-Sparks
Copy link
Author

HP-Sparks commented Jun 23, 2016

Hi @pljakobs,

Sorry, my bad... I was so focus on my work and the parallel hunts for data, files and information that I forgot to share this information... :-/
Well, I'm using the Arduino IDE 1.6.9 on a Linux Ubuntu-based distribution system.

Now, going to search for Font Type 2 development packages...
But, yesterday, searching on my system (using me@netbook / # find / ft2build.h ) or on Internet, I found nothing except many people facing the same issue for all kind of projects developed using all kind of programming languages...
So, I'm wondering if this file could have been removed due to copyright/licensing issue... ?? (trying to guess...)

Thank you for the clue ! :-)

Best regards,
HP_

P.S.
Just in case there would be a question on the Arduino IDE:

  • After installing the latest stable IDE from the official Web site (http://arduino.cc), I allowed all the automatic updates requests I faced for the bundled and newly available libraries.
  • No magic from this too. ;-)

@HP-Sparks
Copy link
Author

Well, I found something from there: http://download.savannah.gnu.org/releases/freetype/freetype-2.6.tar.gz (latest version at the moment)
Just wondering if this will work fine with code for Arduino... ??
(Now, I have to try this when time permits, I had to switch to alternative solution for my project needs...)

@pljakobs
Copy link
Contributor

pljakobs commented Jun 23, 2016

Ah, couple of things: the font converter is not an arduino sketch, it cannot be compiled with the arduino IDE but has to be compiled with the gcc that comes with your Linux distro. So you have to install the current development environment for your platform plus the freetype2 system along with it's development packages. You would do that through the package manager provided by your Linux distro (for example aptitude on many Debian based systems, or apt-cache / apt-get at the command line). Those tools have a search function that allows you to find the correct packages and meta packages. What you want is something along the lines of "C development", and "freetype2" - for the latter, there will be an option to also install the devel package.
Those packages are all free software, so there's no copyright issue with them.

[edit]
I don't run ubuntu anywhere, but this might help you:
[https://help.ubuntu.com/community/InstallingCompilers]
according to this, installing your build environment goes like this:
sudo apt-get install build-essential
and I think, for freetype it should be
sudo apt-get install libfreetype6-dev
now, problem is: different distros package software different ways, I am not privy to ubuntu so I don't know what it is on your specific distro.
The point is: this problem has nothing to do with fontconvert.c itself but with the build environment and the required packages.

once you have the required packages installed, simply cd into the fontconvert directory and type "make" - that should do the trick. Again: fontconvert is not an arduino sketch, it's a program that runs natively on your pc (provided you run linux / Windows with cygwin or maybe even that fruit based OS). It is used to convert pc-style true type fonts into bitmap fonts that you can then use in your sketch.

pj

@ghost
Copy link

ghost commented Jul 23, 2016

I'm having the same problem on OSX when I am compiling for the esp8266. I've downloaded the newest version of the Arduino IDE, installed the newest ESP8266/Arduino code and included adafruit GFX in my project. Compilation always fails because of the missing ft2build.h file

@bcr
Copy link

bcr commented Aug 18, 2016

I can submit a patch for this if you want it. It sounds like people are incorporating the entire GFX repo into their projects, not using the Arduino library management. If you incorporate the entire GFX repo into your sketch directory, the Arduino IDE will try to build fontconvert.c

I think a simple fix would be to add #ifndef ARDUINO at the top and #endif /* !ARDUINO */ at the end. This fixes a separate issue that I'm having with PlatformIO's library management (which I think is a PlatformIO bug -- I think they're building stuff that isn't in the src or the root directory).

@savvycreativeadventurer

Hi BRC

where should we add those codes please?

@Johnvan
Copy link

Johnvan commented Nov 29, 2017

I am having the same problem with ft2build.h in Windows 10 as the IDE keeps trying to load it from the Programs(x64) directory (cores etc.) and when I do a search for ft2build.h it does not find it in the cores directory setup. It is in the Sketches directory (it is not visible in this directory but the search says it's there) but apparently the IDE only looks for the hardware cores directory. I copy/paste it into the hardware/cores directory then search for it there but the search does not find it either. Why is that

@pljakobs
Copy link
Contributor

@Johnvan please see my comment above, you cannot build fontconvert with the Arduino ide since it's not an Arduino Sketch, it's a program that has to be run natively on your platform (Linux, MacOS or Windows). Since I don't do any coding on Windows, I have no compiler that can create Windows code (would there even be free ones?).
But there has been work done to make it compile on Windows, please look around in the actual repo and the issues here.

pj

@Johnvan
Copy link

Johnvan commented Nov 30, 2017 via email

@pljakobs
Copy link
Contributor

Hi John,

did you see https://github.com/adafruit/Adafruit-GFX-Library/blob/master/fontconvert/fontconvert_win.md ? I think there should be a rather straightforward path to building fontconvert on Windows...
But: what do you need it for, anyway? Do you have a specific requirement for a font that cannot be replaced with one of those already available in the fonts subdirectory?
I'm using the GFX_library fonts in many places with no issues and the only reason to use the fontconvert is when I do want a different optics (like a faux 7 segment display or so).
It makes me a wee bit unhappy to see you drop a project due to this, so if I can help, let me know (ideally by e-mail, address is in my profile)

kind regards

pj

@ColdAppleCider
Copy link

ColdAppleCider commented Mar 2, 2018

Hi guys, i was building a game that is written in C++ and it use the SFML library, and i had the same problem in Linux, and i fixed it copying the content of /usr/include/freetype2 to /usr/include

:)

@aaseagrass
Copy link

Hello! I have an error while trying to install the matplotlib library in python 3.4, I found out that it needs ft2build.h which I already downloaded, but I can't find command to install it. Can you help me? What command to us to install ft2build.h? I'm using windows 10 thank you! I'm a graduating student and we badly need this in our thesis.

@pljakobs
Copy link
Contributor

@aaseagrass you are posting this question to the github repo for Adafruit-gfx, this has nothing to do with python. Please check out the freetype website on how to install the freetype develop packages on your platform.

@waged
Copy link

waged commented Oct 1, 2018

hi, I've faced the same problem to create the .h file from .ttf file , I'm using MacOS
after trials i made this procedures and it works 👍
1- install brew: link :http://macappstore.org/freetype/
2-install freetype2 link : https://opensource.ncsa.illinois.edu/confluence/pages/viewpage.action?pageId=61604031
3- run command : make fontconvert
4- after downloading the .ttf file and putting it inside the fonconvert folder run command:
./fontconvert Orgy.ttf 18 > Orgy18.h

@theintel
Copy link
Contributor

I can submit a patch for this if you want it. It sounds like people are incorporating the entire GFX repo into their projects, not using the Arduino library management. If you incorporate the entire GFX repo into your sketch directory, the Arduino IDE will try to build fontconvert.c

I think a simple fix would be to add #ifndef ARDUINO at the top and #endif /* !ARDUINO */ at the end. This fixes a separate issue that I'm having with PlatformIO's library management (which I think is a PlatformIO bug -- I think they're building stuff that isn't in the src or the root directory).

Thanks man, it worked like a charm. Is there any issue that may arise due to this change?

theintel added a commit to theintel/Adafruit-GFX-Library that referenced this issue Oct 17, 2018
When compiling the example sketch for adafruit OLED display, the sketch refers to Adafruit_GFX and consequently to fontconvert.c
This file includes a header file named ft2build.h, which many of the compilers fail to find, resulting in compilation error.
Check the discussion on this issue: adafruit#88

Simply adding two lines solves the problem.
@theintel
Copy link
Contributor

I've referenced this issue, committed a change and opened a pull request. Its already been merged. Thanks to @bcr for his quick fix.

This issue is resolved now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants