-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from lovyan03/unstable
v0.1.10
- Loading branch information
Showing
16 changed files
with
1,639 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
examples/HowToUse/4_unicode_fonts/arduino_misaki/arduino_misaki.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
|
||
// このサンプルの実行にはArduino-misakiUTF16が必要です。 | ||
// need misakifont to run this example. | ||
// | ||
// URL : https://github.com/Tamakichi/Arduino-misakiUTF16 | ||
// | ||
|
||
// Arduino-misakiUTF16のフォントデータをincludeします。 | ||
// Include the font data of Arduino-misakiUTF16. | ||
#include "misakiUTF16FontData.h" | ||
|
||
#include <LovyanGFX.hpp> | ||
|
||
static LGFX lcd; | ||
|
||
// lgfx::BDFfontクラスを使って、Arduino-misakiUTF16を使用できるように設定します。 | ||
static constexpr lgfx::BDFfont misaki_font = | ||
{ fdata // 第1引数 フォントのビットマップデータ | ||
, ftable // 第2引数 unicodeフォントテーブル | ||
, sizeof(ftable)>>1 // 第3引数 フォントテーブルのサイズ | ||
, 8 // 第4引数 フォント幅 | ||
, 4 // 第5引数 フォント幅 (半角) | ||
, 7 // 第6引数 フォント高さ | ||
, 6 // 第7引数 ベースライン高さ | ||
, 8 // 第8引数 改行時の縦方向カーソル移動量 | ||
}; | ||
|
||
|
||
void setup() | ||
{ | ||
lcd.init(); | ||
|
||
// 先ほど作成した misaki_font を setFont 関数の引数に指定することで、print や drawString 等で使用できます。 | ||
lcd.setFont(&misaki_font); | ||
|
||
lcd.setTextWrap(true, true); | ||
} | ||
|
||
void loop() | ||
{ | ||
lcd.setTextColor(0x808080U|random(0xFFFFFF), 0x7F7F7FU&random(0x10000)); | ||
|
||
lcd.print("美さきフォントは8x8のコンパクトなフォントです。"); | ||
lcd.print("Arduino-misakiUTF16は、教育漢字1,006字(小学校で習う漢字)+ひらがな・カタカナ・記号・半角等の1,710字にしぼって収録されています。"); | ||
lcd.print("Hello"); | ||
lcd.print("HELLO"); | ||
lcd.print("こんにちは"); | ||
delay(1000); | ||
} |
Oops, something went wrong.