Skip to content

Commit 199949e

Browse files
dschloeclaude
andcommitted
Bundle the Gaegu handwriting font for Excalidraw PNG export
to_png.py loads assets/fonts/Gaegu-Regular.ttf (SIL OFL 1.1) so Korean text in hand-drawn diagrams renders as handwriting without fetching a font from the network. Falls back to system fonts if the file is missing. License text is in assets/fonts/OFL.txt and NOTICE.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent e7f45ed commit 199949e

10 files changed

Lines changed: 108 additions & 3 deletions

File tree

‎NOTICE.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
| [excalidraw/excalidraw](https://github.com/excalidraw/excalidraw), [excalidraw/excalidraw-mcp](https://github.com/excalidraw/excalidraw-mcp) | MIT | .excalidraw 파일 형식, `exportToSvg` | `references/excalidraw.md`, `scripts/build.py`, `scripts/to_png.py` |
1111
| [Cocoon-AI/architecture-diagram-generator](https://github.com/Cocoon-AI/architecture-diagram-generator) | MIT, Copyright (c) 2025 Cocoon AI | 구조도 디자인 규칙(역할별 색, 화살표 가림 처리, 범례 위치) | `references/architecture.md`, `assets/architecture-template.html` |
1212

13+
## 포함된 글꼴
14+
15+
| 글꼴 | 라이선스 | 사용 위치 |
16+
|---|---|---|
17+
| [Gaegu](https://github.com/google/fonts/tree/main/ofl/gaegu) (`Gaegu-Regular.ttf`) | SIL Open Font License 1.1, Copyright 2018 The Gaegu Project Authors | `assets/fonts/` — 엑스칼리드로 그림을 PNG로 바꿀 때 쓰는 한글 손글씨 글꼴. 라이선스 원문은 `assets/fonts/OFL.txt` |
18+
1319
실행 시 브라우저가 인터넷에서 불러오는 라이브러리(AntV Infographic, draw.io 뷰어, Excalidraw)는 이 저장소에 포함되어 있지 않으며 각 라이선스를 따릅니다.
1420

1521
Apache-2.0 원문: https://www.apache.org/licenses/LICENSE-2.0

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ Windows에서는 `python3` 대신 `python` 또는 `py`를 씁니다.
250250
스킬은 외부 서버에 그림 내용을 보내지 않습니다. 다만 draw.io **편집 링크**는 그림 내용이 링크 주소 안에 들어 있으니, 사내 정보가 담긴 링크는 공유하지 마세요. PNG 변환 시 브라우저는 그리기 라이브러리(AntV, draw.io 뷰어, Excalidraw)만 인터넷에서 내려받습니다.
251251

252252
**한글이 깨지나요?**
253-
SVG·구조도는 PC의 한글 글꼴(맑은 고딕, Apple SD 산돌고딕 Neo, Noto Sans KR 등)을 씁니다. 엑스칼리드로 손글씨 글꼴에는 한글이 없어 한글은 시스템 글꼴로 보입니다.
253+
SVG·구조도는 PC의 한글 글꼴(맑은 고딕, Apple SD 산돌고딕 Neo, Noto Sans KR 등)을 씁니다. 엑스칼리드로 그림의 PNG는 스킬에 들어 있는 한글 손글씨 글꼴(Gaegu, OFL)로 만듭니다. excalidraw.com에서 파일을 직접 열면 그 사이트의 글꼴로 보이며, 손글씨 글꼴에 한글이 없어 한글은 시스템 글꼴로 나옵니다.
254254

255255
**영어 그림은 어떤 글꼴로 나오나요?**
256256
영어로만 된 그림은 PC의 영어 글꼴(Inter, Segoe UI, Helvetica Neue, Arial 순)을 씁니다. 파일 이름과 명령어는 고정폭 글꼴(SF Mono, Cascadia Code, Consolas, Menlo 순)로 씁니다. 웹 글꼴은 불러오지 않습니다.

‎dist/one-page-diagrams.zip‎

723 KB
Binary file not shown.

‎examples/rag-sketch.png‎

5.52 KB
Loading

‎examples/retro-board.png‎

2.69 KB
Loading
1.72 KB
Loading
3.02 MB
Binary file not shown.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2018 The Gaegu Project Authors
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
http://scripts.sil.org/OFL
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.

‎skills/one-page-diagrams/references/excalidraw.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@
7070

7171
- ".excalidraw 파일을 https://excalidraw.com 에서 열면 함께 그리며 고칠 수 있습니다. 공유 버튼으로 수강생과 실시간 협업도 됩니다."
7272
- PNG를 못 만들었으면: "excalidraw.com에서 메뉴 → 이미지 내보내기 → PNG로 받을 수 있습니다."
73-
- 한글은 excalidraw 손글씨 글꼴에 없어서 시스템 글꼴로 보인다.
73+
- PNG는 스킬에 든 한글 손글씨 글꼴(Gaegu, `assets/fonts/`)로 만든다. 인터넷에서 글꼴을 받지 않는다.
74+
- excalidraw.com에서 `.excalidraw` 파일을 열면 그 사이트의 글꼴로 보인다. 한글은 excalidraw 손글씨 글꼴에 없어서 시스템 글꼴로 보인다.

‎skills/one-page-diagrams/scripts/to_png.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,12 @@ def prepare(src, tmpdir, scale=2):
193193
return page, 2400, 2000, 25000, True
194194
if ext == ".excalidraw":
195195
scene = json.loads(text)
196-
doc = (f'{head}#out svg{{display:block}}#out svg text{{font-family:"Pretendard","Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR","Noto Sans CJK KR",sans-serif}}</style></head><body><div id="out"></div>'
196+
# 스킬에 든 손글씨 글꼴(Gaegu, OFL). 파일이 없으면 시스템 글꼴로 넘어간다.
197+
hand = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "assets", "fonts", "Gaegu-Regular.ttf")
198+
face = ""
199+
if os.path.exists(hand):
200+
face = '@font-face{font-family:"OnePageHand";src:url("' + pathlib.Path(os.path.abspath(hand)).as_uri() + '") format("truetype")}'
201+
doc = (f'{head}{face}#out svg{{display:block}}#out svg text{{font-family:"OnePageHand","Pretendard","Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR","Noto Sans CJK KR",sans-serif}}</style></head><body><div id="out"></div>'
197202
f'<script type="module">import {{ exportToSvg }} from "{EXCALIDRAW_ESM}";\n'
198203
f'const scene = {json.dumps(scene, ensure_ascii=False)};\n'
199204
'const svg = await exportToSvg({ elements: scene.elements, files: scene.files || {}, '

0 commit comments

Comments
 (0)