This is a repository for the support of Korean NanumGothicCoding fonts for https://github.com/olikraus/u8g2
Arduino Due with SSD1306 OLED Graphic LCD tested.
-
NanumGothicCoding Font
-
bdfconv.exe
-
odf2bdf.exe
-
bdfViewer.exe
-
Convert TTF font to BDF with otf2bdf.exe in "1. OTF2BDF"
Or change "1. OTF2BDF\Convet.cmd" contents.
"1. OTF2BDF\Convet.cmd" makes "1. OTF2BDF_Fonts<font name.ttf>" to "1. OTF2BDF_Output*.bdf"
It make 3 size(16pt, 24pt, 36pt) of fonts
-
Convert BDF to U8G2 library header with bdfconv.exe and korea.map in "2. BDFConv"
Or "2. BDFConv\Convert.cmd" contents.
"2. BDFConv\Convert.cmd" makes "1. OTF2BDF_Output*.bdf" to "2. BDFConv_Output*.c"
-
"2. BDFConv_Output*.c" copy your skech folder and rename extension .c to .h
-
Define include
#include "u8g2_font_unifont_t_korean_NanumGothicCoding_16.h"
- Here is a sample skech code.
void setup(void) { u8g2.begin(); u8g2.enableUTF8Print(); } void loop(void) { u8g2.setFont(u8g2_font_unifont_t_korean_NanumGothicCoding_16); u8g2.setFontDirection(0); u8g2.clearBuffer(); u8g2.setCursor(0, 16); u8g2.print("Hello!"); u8g2.setCursor(0,40); u8g2.print("안녕 H ☞ ☯."); u8g2.sendBuffer(); delay(1000); }
- korean.map was all of character in NanumGothicCoding font even English characters.
- You possible font glyph can be checked with the BDF Viewer.
- The font size is so large that you can not use various sizes in Arduino.
- This should be tested later.