Skip to main content

KorSubset

한국어

An easy font subsetting tool for Korean fonts.

Overview

Korean fonts usually take massive size because it needs about 17,388 glyphs to display them. Therefore, Korean web developers used to make subsets for reducing loading times. KS X 1001 subset is the most popular subset of Korean, only supporting 2,350 glyphs, so it cannot cover all usages. Also, the subset cannot be used for some areas that can take users' input.

In 2018, Google released Google Fonts + Korean project to solve the problems. It generates Korean font subsets into 120 groups via machine learning. It uses the unicode-range property of CSS to download subsets on-demand, reduce loading times. However, there is a limitation that developers only allowed to use fonts provided by Google.

This project generates Korean font subsets and a CSS file similar to Google Fonts + Korean project's ones. It also converts given font to .woff and .woff2 extension to reduce the size and the user can fully control CSS's font properties via arguments.

Installation

pip install korsubset

Usage

korsubset {font_name}

Example

korsubset my_font.otf --output-dir=./my_font/ --font-url=/my_font/

Options

Name Description Default
-h, --help Display help
-q, --quiet Do not print log messages
--output-dir= A directory that subsets should be generated ./output/
--noexport-css Do not make CSS file with this flag
--font-url= A path for src properties of the CSS file /
--family= A value for family properties of the CSS file The family of the font file
--style= A value for style properties of the CSS file The style of the font file
--weight= A value for weight properties of the CSS file 400
--format= Output formats. woff, woff2 or woff,woff2 woff2

Note

This script transforms fonts to generate subsets. Please check the fonts' license before use. Also, this script includes Unicode ranges for general Korean fonts. Ligatures, emojis, and Chinese characters may not be included in output files.

TODO

  • Add testing.
  • Supports .woff and .woff2 inputs.
  • Supports .eot, .ttf, or .otf outputs.
  • Supports all CSS @font-face properties.

Metadata

Release files for korsubset 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for korsubset 0.1.2
File Interpreter ABI Platform
korsubset-0.1.2-py3-none-any.whl Python 3 none any Details

Release files / korsubset-0.1.2-py3-none-any.whl

Download URL korsubset-0.1.2-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2ca04ea1cc6dd7dd1da282ec0902abb43756c40ff503982e186f3e1f1c17d16
BLAKE2b-256 checksum
How to use checksums
262bb065d8776e790b76ac44d12f4d63254f050aafbb480b5160da0e448cd50f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page