Update TFT_eSPI to v2.5.43
This commit is contained in:
@@ -48,13 +48,13 @@ Software License Agreement (FreeBSD License)
|
||||
// >>>>>>>>>>>>>>>>>>>> INSTRUCTIONS <<<<<<<<<<<<<<<<<<<<
|
||||
|
||||
// See comments below in code for specifying the font parameters (point size,
|
||||
// unicode blocks to include etc). Ranges of characters (glyphs) and specific
|
||||
// unicode blocks to include etc.). Ranges of characters (glyphs) and specific
|
||||
// individual glyphs can be included in the created "*.vlw" font file.
|
||||
|
||||
// Created fonts are saved in the sketches "FontFiles" folder. Press Ctrl+K to
|
||||
// see that folder location.
|
||||
|
||||
// 16 bit Unicode point codes in the range 0x0000 - 0xFFFF are supported.
|
||||
// 16-bit Unicode point codes in the range 0x0000 - 0xFFFF are supported.
|
||||
// Codes 0-31 are control codes such as "tab" and "carraige return" etc.
|
||||
// and 32 is a "space", these should NOT be included.
|
||||
|
||||
@@ -134,11 +134,17 @@ String fontType = ".ttf";
|
||||
|
||||
|
||||
// Define the font size in points for the TFT_eSPI font file
|
||||
int fontSize = 20;
|
||||
int fontSize = 28;
|
||||
|
||||
// Font size to use in the Processing sketch display window that pops up (can be different to above)
|
||||
int displayFontSize = 28;
|
||||
|
||||
// Create a C header (.h file) ready to be used or copied in your sketch folder
|
||||
boolean createHeaderFile = true;
|
||||
|
||||
// Automaticely open the folder with created files when done
|
||||
boolean openFolder = true;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Next we specify which unicode blocks from the the Basic Multilingual Plane (BMP) are included in the final font file. //
|
||||
// Note: The ttf/otf font file MAY NOT contain all possible Unicode characters, refer to the fonts online documentation. //
|
||||
@@ -363,7 +369,7 @@ static final int[] specificUnicodes = {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Variable to hold the inclusive Unicode range (16 bit values only for this sketch)
|
||||
// Variable to hold the inclusive Unicode range (16-bit values only for this sketch)
|
||||
int firstUnicode = 0;
|
||||
int lastUnicode = 0;
|
||||
|
||||
@@ -392,7 +398,7 @@ void setup() {
|
||||
// Set the fontName from the array number or the defined fontName
|
||||
if (fontNumber >= 0)
|
||||
{
|
||||
fontName = fontList[fontNumber];
|
||||
// fontName = fontList[fontNumber];
|
||||
fontType = "";
|
||||
}
|
||||
|
||||
@@ -499,11 +505,13 @@ void setup() {
|
||||
|
||||
println("Created font " + fontName + str(fontSize) + ".vlw");
|
||||
|
||||
String fontFileName = "FontFiles/" + fontName + str(fontSize) + ".vlw";
|
||||
|
||||
// creating file
|
||||
try {
|
||||
print("Saving to sketch FontFiles folder... ");
|
||||
|
||||
OutputStream output = createOutput("FontFiles/" + fontName + str(fontSize) + ".vlw");
|
||||
OutputStream output = createOutput(fontFileName);
|
||||
font.save(output);
|
||||
output.close();
|
||||
|
||||
@@ -513,11 +521,50 @@ void setup() {
|
||||
|
||||
// Open up the FontFiles folder to access the saved file
|
||||
String path = sketchPath();
|
||||
Desktop.getDesktop().open(new File(path+"/FontFiles"));
|
||||
if(openFolder){
|
||||
Desktop.getDesktop().open(new File(path+"/FontFiles"));
|
||||
}
|
||||
|
||||
System.err.println("All done! Note: Rectangles are displayed for non-existant characters.");
|
||||
}
|
||||
catch(IOException e) {
|
||||
println("Doh! Failed to create the file");
|
||||
}
|
||||
|
||||
if(!createHeaderFile) return;
|
||||
// Now creating header file if the option was specified.
|
||||
try{
|
||||
print("saving header file to FontFile folder...");
|
||||
|
||||
InputStream input = createInputRaw(fontFileName);
|
||||
PrintWriter output = createWriter("FontFiles/" + fontName + str(fontSize) + ".h");
|
||||
|
||||
output.println("#include <pgmspace.h>");
|
||||
output.println();
|
||||
output.println("const uint8_t " + fontName + str(fontSize) + "[] PROGMEM = {");
|
||||
|
||||
int i = 0;
|
||||
int data = input.read();
|
||||
while(data != -1){
|
||||
output.print("0x");
|
||||
output.print(hex(data, 2));
|
||||
if(i++ < 15){
|
||||
output.print(", ");
|
||||
} else {
|
||||
output.println(",");
|
||||
i = 0;
|
||||
}
|
||||
data = input.read();
|
||||
}
|
||||
// font.save(output);
|
||||
output.println("\n};");
|
||||
|
||||
output.close();
|
||||
input.close();
|
||||
|
||||
println("C header file created.");
|
||||
|
||||
} catch(IOException e){
|
||||
println("Failed to create C header file");
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -55,7 +55,7 @@ int max_allowed = 1000; // Maximum number of save images allowed before a resta
|
||||
// These are default values, this sketch obtains the actual values from the Arduino board
|
||||
int tft_width = 480; // default TFT width (automatic - sent by Arduino)
|
||||
int tft_height = 480; // default TFT height (automatic - sent by Arduino)
|
||||
int color_bytes = 2; // 2 for 16 bit, 3 for three RGB bytes (automatic - sent by Arduino)
|
||||
int color_bytes = 2; // 2 for 16-bit, 3 for three RGB bytes (automatic - sent by Arduino)
|
||||
|
||||
import processing.serial.*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user