From c8b32b4e26cf5aac5abb327a3dd59d8a251bfafb Mon Sep 17 00:00:00 2001 From: John Bacas Date: Sun, 30 Oct 2016 11:42:36 +0200 Subject: [PATCH 1/4] Use fontconvert.c to create new fonts in windows A brief guide of how to set your pc with Windows OS so you can create your oen fonts with fontconvert.c --- fontconvert/fontconvert_win.md | 86 ++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 fontconvert/fontconvert_win.md diff --git a/fontconvert/fontconvert_win.md b/fontconvert/fontconvert_win.md new file mode 100644 index 00000000..f6c7fb85 --- /dev/null +++ b/fontconvert/fontconvert_win.md @@ -0,0 +1,86 @@ +### A short guide to use fontconvert.c to create your own fonts using MinGW. + +#### STEP 1: INSTALL MinGW + +Install MinGW (Minimalist GNU for Windows) from [MinGW.org](http://www.mingw.org/). +Please read carefully the instructions found on [Getting started page](http://www.mingw.org/wiki/Getting_Started). +I suggest installing with the "Graphical User Interface Installer". +To complete your initial installation you should further install some "packages". +For our purpose you should only install the "Basic Setup" packages. +To do that: +1. Open the MinGW Installation Manager +2. From the left panel click "Basic Setup". +3. On the right panel choose "mingw32-base", "mingw-gcc-g++", "mingw-gcc-objc" and "msys-base" +and click "Mark for installation" +4. From the Menu click "Installation" and then "Apply changes". In the pop-up window select "Apply". + + +#### STEP 2: INSTALL Freetype Library + +To read about the freetype project visit [freetype.org](https://www.freetype.org/). +To Download the latest version of freetype go to [download page](http://download.savannah.gnu.org/releases/freetype/) +and choose "freetype-2.7.tar.gz" file (or a newer version if available). +To avoid long cd commands later in the command prompt, I suggest you unzip the file in the C:\ directory. +(I also renamed the folder to "ft27") +Before you build the library it's good to read these articles: +* [Using MSYS with MinGW](http://www.mingw.org/wiki/MSYS) +* [Installation and Use of Supplementary Libraries with MinGW](http://www.mingw.org/wiki/LibraryPathHOWTO) +* [Include Path](http://www.mingw.org/wiki/IncludePathHOWTO) + +Inside the unzipped folder there is another folder named "docs". Open it and read the INSTALL.UNIX (using notepad). +Pay attention to paragraph 3 (Build and Install the Library). So, let's begin the installation. +To give the appropriate commands we will use the MSYS command prompt (not cmd.exe of windows) which is UNIX like. +Follow the path C:\MinGW\msys\1.0 and double click "msys.bat". The command prompt environment appears. +Enter "ft27" directory using the cd commands: +``` +cd /c +cd ft27 +``` + +and then type one by one the commands: +``` +./configure --prefix=/mingw +make +make install +``` +Once you're finished, go inside "C:\MinGW\include" and there should be a new folder named "freetype2". +That propably means that you have installed the library correctly !! + +#### STEP 3: Build fontconvert.c + +Before proceeding I suggest you make a copy of Adafruit_GFX_library folder in C:\ directory. +Then, inside "fontconvert" folder open the "makefile" with an editor ( I used notepad++). +Change the commands so in the end the program looks like : +``` +all: fontconvert + +CC = gcc +CFLAGS = -Wall -I c:/mingw/include/freetype2 +LIBS = -lfreetype + +fontconvert: fontconvert.c + $(CC) $(CFLAGS) $< $(LIBS) -o $@ + +clean: + rm -f fontconvert +``` +Go back in the command prompt and with a cd command enter the fontconvert directory. +``` +cd /c/adafruit_gfx_library\fontconvert +``` +Give the command: +``` +make +``` +This command will, eventually, create a "fontconvert.exe" file inside fontconvert directory. + +#### STEP 4: Create your own font header files + +Now that you have an executable file, you can use it to create your own fonts to work with Adafruit GFX lib. +So, if we suppose that you already have a .ttf file with your favorite fonts, jump to the command prompt and type: +``` +./fontconvert yourfonts.ttf 9 > yourfonts9pt7b.h +``` +You can read more details at: [learn.adafruit](https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts) +Taraaaaaammm !! you've just created your new font header file. Put it inside the "Fonts" folder, grab a cup of coffee +and start playing with your Arduino (or whatever else ....)+ display module project. \ No newline at end of file From fe81279314a27f0d9b0966391890737d4f15711f Mon Sep 17 00:00:00 2001 From: John Bacas Date: Sun, 30 Oct 2016 12:05:22 +0200 Subject: [PATCH 2/4] Update fontconvert_win.md --- fontconvert/fontconvert_win.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fontconvert/fontconvert_win.md b/fontconvert/fontconvert_win.md index f6c7fb85..89addf15 100644 --- a/fontconvert/fontconvert_win.md +++ b/fontconvert/fontconvert_win.md @@ -8,6 +8,7 @@ I suggest installing with the "Graphical User Interface Installer". To complete your initial installation you should further install some "packages". For our purpose you should only install the "Basic Setup" packages. To do that: + 1. Open the MinGW Installation Manager 2. From the left panel click "Basic Setup". 3. On the right panel choose "mingw32-base", "mingw-gcc-g++", "mingw-gcc-objc" and "msys-base" @@ -83,4 +84,4 @@ So, if we suppose that you already have a .ttf file with your favorite fonts, ju ``` You can read more details at: [learn.adafruit](https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts) Taraaaaaammm !! you've just created your new font header file. Put it inside the "Fonts" folder, grab a cup of coffee -and start playing with your Arduino (or whatever else ....)+ display module project. \ No newline at end of file +and start playing with your Arduino (or whatever else ....)+ display module project. From 633386a89215eca41c9f844a3a6c1dee459b37a8 Mon Sep 17 00:00:00 2001 From: John Bacas Date: Sun, 30 Oct 2016 12:08:44 +0200 Subject: [PATCH 3/4] Update fontconvert_win.md --- fontconvert/fontconvert_win.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fontconvert/fontconvert_win.md b/fontconvert/fontconvert_win.md index 89addf15..c705836e 100644 --- a/fontconvert/fontconvert_win.md +++ b/fontconvert/fontconvert_win.md @@ -45,7 +45,7 @@ make make install ``` Once you're finished, go inside "C:\MinGW\include" and there should be a new folder named "freetype2". -That propably means that you have installed the library correctly !! +That, hopefully, means that you have installed the library correctly !! #### STEP 3: Build fontconvert.c From b9885e15a01fa4dda940149be174edfbc713fcf2 Mon Sep 17 00:00:00 2001 From: John Bacas Date: Sun, 30 Oct 2016 12:16:28 +0200 Subject: [PATCH 4/4] Update fontconvert_win.md --- fontconvert/fontconvert_win.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fontconvert/fontconvert_win.md b/fontconvert/fontconvert_win.md index c705836e..19328417 100644 --- a/fontconvert/fontconvert_win.md +++ b/fontconvert/fontconvert_win.md @@ -82,6 +82,7 @@ So, if we suppose that you already have a .ttf file with your favorite fonts, ju ``` ./fontconvert yourfonts.ttf 9 > yourfonts9pt7b.h ``` -You can read more details at: [learn.adafruit](https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts) +You can read more details at: [learn.adafruit](https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts). + Taraaaaaammm !! you've just created your new font header file. Put it inside the "Fonts" folder, grab a cup of coffee and start playing with your Arduino (or whatever else ....)+ display module project.