Skip to content

Instantly share code, notes, and snippets.

@ganadist
Created July 16, 2014 01:22
Show Gist options
  • Save ganadist/c2f8a74cc1304ebc2f4e to your computer and use it in GitHub Desktop.
Save ganadist/c2f8a74cc1304ebc2f4e to your computer and use it in GitHub Desktop.
source sans hangul test
<html>
<head>
<style>
p {font-family: "Noto Sans Korean"; }
</style>
<meta charset="utf-8">
</head>
<body>
<p>Syllable: 아름다<font color="red">운 한</font>글</p>
<p>Jamo: &#x110b;&#x1161;&#x1105;&#x1173;&#x11b7;&#x1103;<font color="red">&#x1161;&#x110b;&#x116e;&#x11ab; &#x1112;</font>&#x119e;&#x11ab;&#x1100;&#x1173;&#x11af;</p>
</body>
</html>
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from gi.repository import Pango, Gtk
TEXT1 = """아름<span color="red">다운 한</span>글"""
TEXT2 = u"""\u110b\u1161\u1105\u1173\u11b7\u1103<span color="red">\u1161\u110b\u116e\u11ab\u1112</span>\u119e\u11ab\u1100\u1173\u11af"""
if __name__ == '__main__':
win = Gtk.Window()
box = Gtk.VBox()
win.add(box)
for text in (TEXT1, TEXT2):
label = Gtk.Label()
box.add(label)
label.set_markup(text)
fontDesc = Pango.FontDescription.from_string("Noto Sans Korean 32")
label.get_layout().set_font_description(fontDesc)
win.set_default_size(250, 200)
win.show_all()
win.connect('destroy', Gtk.main_quit)
Gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment