openFrameworks 로 작성하는 프로그램에서 한글 폰트 설정 및 출력하기
아래 예제는 ofTrueTypeFont
클래스를 사용하여 폰트를 로드하고 한글 문자열을 출력하는 방법을 보여준다.
ofApp.h
#pragma once
#include "ofMain.h"
#include "ofxDatGui.h"
class ofApp : public ofBaseApp
{
public:
void setup();
void update();
void draw();
private:
ofTrueTypeFont font1;
};
ofApp.cpp
#include "ofApp.h"
void ofApp::setup()
{
...
ofTrueTypeFontSettings settings(ofxDatGuiTheme::AssetPath + "ofxbraitsch/fonts/godoMaum.ttf", 64);
settings.addRanges(ofAlphabet::Korean);
settings.addRanges(ofAlphabet::Latin);
font1.load(settings);
}
void ofApp::draw()
{
...
ofSetColor(ofColor::greenYellow);
font1.drawString(string("안녕하세요.\nhttps://makersweb.net"), 100, 100);
}
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
15 |
ZeroMQ 비동기 클라이언트/서버 패턴
![]() | makersweb | 2020.08.13 | 1843 |
14 |
AGL (Automotive Grade Linux) 개요
![]() | makersweb | 2022.06.19 | 1903 |
13 |
Nana, C++용 크로스플랫폼 GUI 라이브러리
![]() | makersweb | 2021.01.06 | 2100 |
12 |
Wayland IVI Extension 간단 리뷰
![]() | makersweb | 2019.05.12 | 2272 |
11 |
Flutter Application 에서 한글(EUC-KR) 깨져서 나오는 문제
![]() | makersweb | 2022.01.06 | 2759 |
10 |
리눅스에서 SDL2 최신버전 컴파일과 Qt Creator로 개발환경 구성
![]() | makersweb | 2019.10.06 | 3066 |
9 |
[SDL2 와 OpenGL]윈도우 생성과 2D그래픽
![]() | makersweb | 2020.04.11 | 3113 |
8 |
가볍고 쉬운 임베디드용 그래픽 라이브러리 - LVGL
![]() | makersweb | 2020.09.16 | 3515 |
7 |
webOS소개 및 Raspberry Pi 3 에서 실행
![]() | makersweb | 2019.10.13 | 3911 |
6 |
텔레그램(Telegram) Bot 개발
![]() | makersweb | 2019.07.21 | 5745 |
5 |
ZeroMQ의 기본 메세지 패턴들
![]() | makersweb | 2020.07.31 | 8635 |
4 |
GENIVI DLT(Diagnostic Log and Trace) 활용
![]() | makersweb | 2020.11.19 | 8700 |
3 |
Dear ImGui, 경량의 C++ 용 GUI 및 Widget 라이브러리
![]() | makersweb | 2020.11.28 | 9177 |
2 |
GDBus 튜토리얼(GDBus tutorial)
![]() | makersweb | 2019.06.30 | 10474 |
1 |
Pluma(C++ Plug-in Management Framework) 튜토리얼
![]() | makersweb | 2019.12.07 | 14062 |