anybody here was able to change font type adafruit.GFX.h characters, for bigger letters ? fonts type is pixelated for larger letters ..
Have you explored the available fonts? (18 or 24 pt for example)
sorry! I'm lost new to oled I'm using SSD 1306 for my project, trying to figure out how to change font type with adafruit.GFX, font doesn't look good in bigger font (pixilated) there is no font type to change like in u8g2. just self studying arduino and programming. Will It be better to use U8g2?
Go on. You can use FreeFonts with Adafruit_GFX style libraries e.g. Adafruit_SSD1306.h
#include <Fonts/FreeSans9pt7b.h>
#include <Fonts/FreeSans12pt7b.h>
#include <Fonts/FreeSerif12pt7b.h>
...
display.setFont(&FreeSans9pt7b);
display.println("Hello World");
display.setFont(&FreeSerif12pt7b);
display.println("Universe");
Alternatively use U8g2lib.h which has a wider range of fonts. But you lose the intuitive "GFX-style" graphics methods. You can still do the same graphics but the U8g2 method names require some head scratching.
The best learning strategy is to simply run every example that comes with a library.
You will see things that you have always wanted to do and many that you had never thought of !!
Examine the source code. Use the same techniques in your own project.
If you have a problem, quote the example by name. And explain which lines you don't understand.
David,
Thanks david_prentice I do now understand.. You save me a ton of minutes watching youtube Thanks also to Kris Kasprzak
Create and use custom fonts for Adafruit_GFX libraries - YouTube .. however do you happen to know any link for me to narrow my learning in Menu type for my DHT project that I can copy and base my sketch. I do now have a temperature and humidifier to controlled fan, mist sprayer but I want to include the display and button to adjust and set +- of the temperature and humidity set value anyone who have done this can you share you Sketch.. again thank to all happy building to everyone
Hi david is it possible for me to declare the font type global? like setfontType =FreeSans9pt7b ; so i will only change once
You just put the setFont() call into setup().
Seriously. Run examples. Study how they work.
Note that the FreeFonts only print in transparent mode. So you need to paint a fresh background if you are replacing text. Seldom a concern with SSD1306. These apps tend to draw everything from scratch anyway.
As I said earlier. Quote example by name. Ask if you don't understand an example.
David.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.