/*
* RomFontを使ったFont切り替えサンプル
* フォントファイルはこちら
*
http://ayati.cocolog-nifty.com/blog/2012/08/ipalx322416-64a.html
*/
#include <Adafruit_GFX.h> //
https://github.com/adafruit/Adafruit-GFX-Library
#include
<Fontx.h>
// https://github.com/h-nari/Fontx
#include <Humblesoft_GFX.h>
// https://github.com/h-nari/Humblesoft_GFX
#include <Humblesoft_ILI9341.h> //
https://github.com/h-nari/Humblesoft_ILI9341
IMPORT_BIN("/fontx/ILGH16XB.FNT", ILGH16XB);
//16ドット半角ゴシックフォント
IMPORT_BIN("/fontx/ILGZ16XB.FNT", ILGZ16XB);
//16ドット全角ゴシックフォント
IMPORT_BIN("/fontx/ILMH16XB.FNT", ILMH16XB);
//16ドット半角明朝フォント
IMPORT_BIN("/fontx/ILMZ16XB.FNT", ILMZ16XB);
//16ドット全角明朝フォント
extern const uint8_t ILGH16XB[], ILGZ16XB[], ILMH16XB[],
ILMZ16XB[];
/*
* TFT ESP8266
* -------------
* CS IO2
* RESET RST
* D/C IO15
* MOSI IO13
* SCK IO14
* LED 3V3
* MISO N/C
*/
Humblesoft_ILI9341 tft = Humblesoft_ILI9341();
RomFontx font_gothic(ILGH16XB,ILGZ16XB);
RomFontx font_mincyo(ILMH16XB,ILMZ16XB);
void setup() {
tft.begin();
tft.setRotation(3);
tft.fillScreen("BLACK");
tft.setTextSize(1);
tft.setFont(&font_gothic);
tft.print("16ドットゴシック\n");
tft.print("日本語表示\n");
tft.setFont(&font_mincyo);
tft.print("16ドット明朝\n");
tft.print("日本語表示\n\n");
tft.setTextSize(2);
tft.setFont(&font_gothic);
tft.print("16ドットゴシック\n");
tft.print("日本語表示\n");
tft.setFont(&font_mincyo);
tft.print("16ドット明朝\n");
tft.print("日本語表示\n\n");
}
void loop() {
} |