├── .gitignore ├── ComicMono-Bold.ttf ├── ComicMono.ttf ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── _config.yml ├── _layouts └── default.html ├── assets └── css │ └── style.scss └── generate.py /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | *.pyc 3 | _site -------------------------------------------------------------------------------- /ComicMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/comic-mono-font/6a133be3235177801e2aaf80619afcd40071c9c0/ComicMono-Bold.ttf -------------------------------------------------------------------------------- /ComicMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dtinth/comic-mono-font/6a133be3235177801e2aaf80619afcd40071c9c0/ComicMono.ttf -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'github-pages', group: :jekyll_plugins 3 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (4.2.11.1) 5 | i18n (~> 0.7) 6 | minitest (~> 5.1) 7 | thread_safe (~> 0.3, >= 0.3.4) 8 | tzinfo (~> 1.1) 9 | addressable (2.6.0) 10 | public_suffix (>= 2.0.2, < 4.0) 11 | coffee-script (2.4.1) 12 | coffee-script-source 13 | execjs 14 | coffee-script-source (1.11.1) 15 | colorator (1.1.0) 16 | commonmarker (0.17.13) 17 | ruby-enum (~> 0.5) 18 | concurrent-ruby (1.1.5) 19 | dnsruby (1.61.2) 20 | addressable (~> 2.5) 21 | em-websocket (0.5.1) 22 | eventmachine (>= 0.12.9) 23 | http_parser.rb (~> 0.6.0) 24 | ethon (0.12.0) 25 | ffi (>= 1.3.0) 26 | eventmachine (1.2.7) 27 | execjs (2.7.0) 28 | faraday (0.15.4) 29 | multipart-post (>= 1.2, < 3) 30 | ffi (1.11.1) 31 | forwardable-extended (2.6.0) 32 | gemoji (3.0.1) 33 | github-pages (198) 34 | activesupport (= 4.2.11.1) 35 | github-pages-health-check (= 1.16.1) 36 | jekyll (= 3.8.5) 37 | jekyll-avatar (= 0.6.0) 38 | jekyll-coffeescript (= 1.1.1) 39 | jekyll-commonmark-ghpages (= 0.1.5) 40 | jekyll-default-layout (= 0.1.4) 41 | jekyll-feed (= 0.11.0) 42 | jekyll-gist (= 1.5.0) 43 | jekyll-github-metadata (= 2.12.1) 44 | jekyll-mentions (= 1.4.1) 45 | jekyll-optional-front-matter (= 0.3.0) 46 | jekyll-paginate (= 1.1.0) 47 | jekyll-readme-index (= 0.2.0) 48 | jekyll-redirect-from (= 0.14.0) 49 | jekyll-relative-links (= 0.6.0) 50 | jekyll-remote-theme (= 0.3.1) 51 | jekyll-sass-converter (= 1.5.2) 52 | jekyll-seo-tag (= 2.5.0) 53 | jekyll-sitemap (= 1.2.0) 54 | jekyll-swiss (= 0.4.0) 55 | jekyll-theme-architect (= 0.1.1) 56 | jekyll-theme-cayman (= 0.1.1) 57 | jekyll-theme-dinky (= 0.1.1) 58 | jekyll-theme-hacker (= 0.1.1) 59 | jekyll-theme-leap-day (= 0.1.1) 60 | jekyll-theme-merlot (= 0.1.1) 61 | jekyll-theme-midnight (= 0.1.1) 62 | jekyll-theme-minimal (= 0.1.1) 63 | jekyll-theme-modernist (= 0.1.1) 64 | jekyll-theme-primer (= 0.5.3) 65 | jekyll-theme-slate (= 0.1.1) 66 | jekyll-theme-tactile (= 0.1.1) 67 | jekyll-theme-time-machine (= 0.1.1) 68 | jekyll-titles-from-headings (= 0.5.1) 69 | jemoji (= 0.10.2) 70 | kramdown (= 1.17.0) 71 | liquid (= 4.0.0) 72 | listen (= 3.1.5) 73 | mercenary (~> 0.3) 74 | minima (= 2.5.0) 75 | nokogiri (>= 1.8.5, < 2.0) 76 | rouge (= 2.2.1) 77 | terminal-table (~> 1.4) 78 | github-pages-health-check (1.16.1) 79 | addressable (~> 2.3) 80 | dnsruby (~> 1.60) 81 | octokit (~> 4.0) 82 | public_suffix (~> 3.0) 83 | typhoeus (~> 1.3) 84 | html-pipeline (2.11.0) 85 | activesupport (>= 2) 86 | nokogiri (>= 1.4) 87 | http_parser.rb (0.6.0) 88 | i18n (0.9.5) 89 | concurrent-ruby (~> 1.0) 90 | jekyll (3.8.5) 91 | addressable (~> 2.4) 92 | colorator (~> 1.0) 93 | em-websocket (~> 0.5) 94 | i18n (~> 0.7) 95 | jekyll-sass-converter (~> 1.0) 96 | jekyll-watch (~> 2.0) 97 | kramdown (~> 1.14) 98 | liquid (~> 4.0) 99 | mercenary (~> 0.3.3) 100 | pathutil (~> 0.9) 101 | rouge (>= 1.7, < 4) 102 | safe_yaml (~> 1.0) 103 | jekyll-avatar (0.6.0) 104 | jekyll (~> 3.0) 105 | jekyll-coffeescript (1.1.1) 106 | coffee-script (~> 2.2) 107 | coffee-script-source (~> 1.11.1) 108 | jekyll-commonmark (1.3.1) 109 | commonmarker (~> 0.14) 110 | jekyll (>= 3.7, < 5.0) 111 | jekyll-commonmark-ghpages (0.1.5) 112 | commonmarker (~> 0.17.6) 113 | jekyll-commonmark (~> 1) 114 | rouge (~> 2) 115 | jekyll-default-layout (0.1.4) 116 | jekyll (~> 3.0) 117 | jekyll-feed (0.11.0) 118 | jekyll (~> 3.3) 119 | jekyll-gist (1.5.0) 120 | octokit (~> 4.2) 121 | jekyll-github-metadata (2.12.1) 122 | jekyll (~> 3.4) 123 | octokit (~> 4.0, != 4.4.0) 124 | jekyll-mentions (1.4.1) 125 | html-pipeline (~> 2.3) 126 | jekyll (~> 3.0) 127 | jekyll-optional-front-matter (0.3.0) 128 | jekyll (~> 3.0) 129 | jekyll-paginate (1.1.0) 130 | jekyll-readme-index (0.2.0) 131 | jekyll (~> 3.0) 132 | jekyll-redirect-from (0.14.0) 133 | jekyll (~> 3.3) 134 | jekyll-relative-links (0.6.0) 135 | jekyll (~> 3.3) 136 | jekyll-remote-theme (0.3.1) 137 | jekyll (~> 3.5) 138 | rubyzip (>= 1.2.1, < 3.0) 139 | jekyll-sass-converter (1.5.2) 140 | sass (~> 3.4) 141 | jekyll-seo-tag (2.5.0) 142 | jekyll (~> 3.3) 143 | jekyll-sitemap (1.2.0) 144 | jekyll (~> 3.3) 145 | jekyll-swiss (0.4.0) 146 | jekyll-theme-architect (0.1.1) 147 | jekyll (~> 3.5) 148 | jekyll-seo-tag (~> 2.0) 149 | jekyll-theme-cayman (0.1.1) 150 | jekyll (~> 3.5) 151 | jekyll-seo-tag (~> 2.0) 152 | jekyll-theme-dinky (0.1.1) 153 | jekyll (~> 3.5) 154 | jekyll-seo-tag (~> 2.0) 155 | jekyll-theme-hacker (0.1.1) 156 | jekyll (~> 3.5) 157 | jekyll-seo-tag (~> 2.0) 158 | jekyll-theme-leap-day (0.1.1) 159 | jekyll (~> 3.5) 160 | jekyll-seo-tag (~> 2.0) 161 | jekyll-theme-merlot (0.1.1) 162 | jekyll (~> 3.5) 163 | jekyll-seo-tag (~> 2.0) 164 | jekyll-theme-midnight (0.1.1) 165 | jekyll (~> 3.5) 166 | jekyll-seo-tag (~> 2.0) 167 | jekyll-theme-minimal (0.1.1) 168 | jekyll (~> 3.5) 169 | jekyll-seo-tag (~> 2.0) 170 | jekyll-theme-modernist (0.1.1) 171 | jekyll (~> 3.5) 172 | jekyll-seo-tag (~> 2.0) 173 | jekyll-theme-primer (0.5.3) 174 | jekyll (~> 3.5) 175 | jekyll-github-metadata (~> 2.9) 176 | jekyll-seo-tag (~> 2.0) 177 | jekyll-theme-slate (0.1.1) 178 | jekyll (~> 3.5) 179 | jekyll-seo-tag (~> 2.0) 180 | jekyll-theme-tactile (0.1.1) 181 | jekyll (~> 3.5) 182 | jekyll-seo-tag (~> 2.0) 183 | jekyll-theme-time-machine (0.1.1) 184 | jekyll (~> 3.5) 185 | jekyll-seo-tag (~> 2.0) 186 | jekyll-titles-from-headings (0.5.1) 187 | jekyll (~> 3.3) 188 | jekyll-watch (2.2.1) 189 | listen (~> 3.0) 190 | jemoji (0.10.2) 191 | gemoji (~> 3.0) 192 | html-pipeline (~> 2.2) 193 | jekyll (~> 3.0) 194 | kramdown (1.17.0) 195 | liquid (4.0.0) 196 | listen (3.1.5) 197 | rb-fsevent (~> 0.9, >= 0.9.4) 198 | rb-inotify (~> 0.9, >= 0.9.7) 199 | ruby_dep (~> 1.2) 200 | mercenary (0.3.6) 201 | mini_portile2 (2.4.0) 202 | minima (2.5.0) 203 | jekyll (~> 3.5) 204 | jekyll-feed (~> 0.9) 205 | jekyll-seo-tag (~> 2.1) 206 | minitest (5.11.3) 207 | multipart-post (2.1.1) 208 | nokogiri (1.10.3) 209 | mini_portile2 (~> 2.4.0) 210 | octokit (4.14.0) 211 | sawyer (~> 0.8.0, >= 0.5.3) 212 | pathutil (0.16.2) 213 | forwardable-extended (~> 2.6) 214 | public_suffix (3.1.0) 215 | rb-fsevent (0.10.3) 216 | rb-inotify (0.10.0) 217 | ffi (~> 1.0) 218 | rouge (2.2.1) 219 | ruby-enum (0.7.2) 220 | i18n 221 | ruby_dep (1.5.0) 222 | rubyzip (1.2.3) 223 | safe_yaml (1.0.5) 224 | sass (3.7.4) 225 | sass-listen (~> 4.0.0) 226 | sass-listen (4.0.0) 227 | rb-fsevent (~> 0.9, >= 0.9.4) 228 | rb-inotify (~> 0.9, >= 0.9.7) 229 | sawyer (0.8.2) 230 | addressable (>= 2.3.5) 231 | faraday (> 0.8, < 2.0) 232 | terminal-table (1.8.0) 233 | unicode-display_width (~> 1.1, >= 1.1.1) 234 | thread_safe (0.3.6) 235 | typhoeus (1.3.1) 236 | ethon (>= 0.9.0) 237 | tzinfo (1.2.5) 238 | thread_safe (~> 0.1) 239 | unicode-display_width (1.6.0) 240 | 241 | PLATFORMS 242 | ruby 243 | 244 | DEPENDENCIES 245 | github-pages 246 | 247 | BUNDLED WITH 248 | 1.17.2 249 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Original work Copyright (c) 2018 Shannon Miwa 4 | Modified work Copyright (c) 2019 dtinth 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Comic Mono 2 | A legible monospace font... the very typeface you’ve been trained to recognize since childhood. This font is a fork of [Shannon Miwa](https://github.com/shannpersand)’s [Comic Shanns](https://github.com/shannpersand/comic-shanns) (version 1). 3 | 4 |

5 | 6 | Screenshot 7 | 8 |

9 | 10 | ## Download 11 | - [ComicMono.ttf](https://dtinth.github.io/comic-mono-font/ComicMono.ttf) 12 | - [ComicMono-Bold.ttf](https://dtinth.github.io/comic-mono-font/ComicMono-Bold.ttf) 13 | 14 | ## Differences from Comic Shanns 15 | 1. All glyphs have been [adjusted](https://www.reddit.com/r/programming/comments/kj0prs/comic_mono_font/ghc7krt/?utm_source=reddit&utm_medium=web2x&context=3) to have exactly the same width (using code based on [monospacifier](https://github.com/cpitclaudel/monospacifier)). 16 | 2. The glyph metrics have been adjusted to make it display better alongside system font, based on [Cousine](https://fonts.google.com/specimen/Cousine)’s metrics. 17 | 3. The name is changed to `Comic Mono`. 18 | 4. A bold version of the font is generated using [FontForge’s Embolden](https://fontforge.github.io/Styles.html#Embolden) operation. 19 | 20 | I have no font creation skills; I’m just a software developer. This font family is created by patching the original font, [Comic Shanns (v1)](https://github.com/shannpersand/comic-shanns), using a Python script, [`generate.py`](generate.py). 21 | 22 | ## What does it look like? 23 |

24 | 25 | Check it out! 26 | 27 |

28 | 29 | ```python 30 | {% include_relative generate.py %} 31 | ``` 32 | 33 | ## Check out these fonts as well 34 | - The original [Comic Shanns](https://github.com/shannpersand/comic-shanns) by [Shannon Miwa](https://github.com/shannpersand) has V2 released with support for accented characters and other symbols, such as math symbols. 35 | - Check out [Serious Shanns](https://github.com/kaBeech/serious-shanns) by [Kyle Beechly](https://github.com/kaBeech), which has more modifications to further enhance the legibility, lighter weight, and Nerd Font version. 36 | - Check out [Comic Shanns Mono](https://github.com/jesusmgg/comic-shanns-mono) by [Jesus Gonzalez](https://github.com/jesusmgg), which is based on Comic Shanns v2 but with metrics adjusted and with more additional characters. 37 | 38 | ## CDN 39 | You can use this font in your web pages by including the stylesheet. CDN is provided by [jsDelivr](https://www.jsdelivr.com/package/npm/comic-mono). 40 | ```html 41 | 42 | ``` 43 | 44 | ## npm Package 45 | The contents of this package is also [published to npm](https://www.npmjs.com/package/comic-mono), although the font files are not optimized. See fontsource package (below) for a better option. 46 | 47 | ## Packages published by third parties 48 | - Fontsource: [@fontsource/comic-mono](https://www.npmjs.com/package/@fontsource/comic-mono) ([thanks @DecliningLotus](https://github.com/fontsource/fontsource/pull/117)) 49 | - Arch Linux AUR: [ttf-comic-mono-git](https://aur.archlinux.org/packages/ttf-comic-mono-git/) (maintained by DBourgeoisat) 50 | - Gentoo LInux Overlay: [comic-mono-font](https://gpo.zugaina.org/Overlays/arrans-overlay/media-fonts/comic-mono-font) 51 | 52 | ## License 53 | It is licensed under the [MIT License](LICENSE). 54 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-primer 2 | google_analytics: UA-59441941-6 3 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {% seo %} 9 | 10 | 11 | 12 |
13 | {{ content }} 14 | 15 | {% if site.github.private != true and site.github.license %} 16 | 19 | {% endif %} 20 |
21 | 22 | 23 | {% if site.google_analytics %} 24 | 32 | {% endif %} 33 | 34 | 35 | -------------------------------------------------------------------------------- /assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "{{ site.theme }}"; 5 | 6 | @font-face { 7 | font-family: Comic Mono; 8 | font-weight: normal; 9 | src: url(../../ComicMono.ttf); 10 | } 11 | 12 | @font-face { 13 | font-family: Comic Mono; 14 | font-weight: bold; 15 | src: url(../../ComicMono-Bold.ttf); 16 | } 17 | 18 | // Colors are based on One Dark color scheme. 19 | 20 | html, body, .markdown-body.comic-mono { 21 | background-color: #252423; 22 | color: #bbbbbb; 23 | } 24 | 25 | .markdown-body.comic-mono { 26 | color: #bbbbbb; 27 | border-radius: 3px; 28 | font-family: Comic Mono, Cousine, monospace; 29 | -webkit-font-smoothing: antialiased; 30 | line-height: 1.45; 31 | overflow: auto; 32 | padding: 16px; 33 | max-width: 700px; 34 | @media (min-width: 960px) { 35 | max-width: 875px; 36 | font-size: 20px; 37 | } 38 | h1, h2, h3, p, li, pre { 39 | margin: 1.5em 0; 40 | padding: 0; 41 | font-size: 100%; 42 | line-height: 1.5em; 43 | border: none; 44 | } 45 | ul, ol { 46 | margin: 0; 47 | padding: 0; 48 | list-style-position: inside; 49 | } 50 | ul { 51 | list-style: none; 52 | } 53 | ul > li::before { 54 | content: '* '; 55 | } 56 | h1, h2 { 57 | color: #e06c75; 58 | } 59 | h1::before { 60 | content: '# '; 61 | } 62 | h2::before { 63 | content: '## '; 64 | } 65 | a { 66 | color: #61afef; 67 | } 68 | a::before { 69 | content: '['; 70 | color: #5c6370; 71 | } 72 | a::after { 73 | content: ']'; 74 | color: #5c6370; 75 | } 76 | code, pre { 77 | font: inherit; 78 | padding: 0; 79 | background: none; 80 | } 81 | .highlight { 82 | background: none; 83 | } 84 | pre { 85 | &::before, &::after { 86 | content: '```'; 87 | display: block; 88 | color: #5c6370; 89 | } 90 | } 91 | :not(pre) > code { 92 | &::before, &::after { 93 | content: '`'; 94 | } 95 | } 96 | .highlight { 97 | .nn, .o { 98 | color: inherit; 99 | } 100 | .c { 101 | color: #5c6370; 102 | } 103 | .s { 104 | color: #98c379; 105 | } 106 | .kn, .k, .ow { 107 | color: #c678dd; 108 | } 109 | .mi, .mf, .na { 110 | color: #d19a66; 111 | } 112 | .nb { 113 | color: #56b6c2; 114 | } 115 | .nf { 116 | color: #61afef; 117 | } 118 | .nt { 119 | color: #e06c75; 120 | } 121 | } 122 | } 123 | 124 | .website-hidden { 125 | display: none; 126 | } 127 | -------------------------------------------------------------------------------- /generate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | Generates the Comic Mono font files based on Comic Shanns font. 6 | 7 | Required files: 8 | - vendor/comic-shanns.otf 9 | - vendor/Cousine-Regular.ttf 10 | 11 | Based on: 12 | - monospacifier: https://github.com/cpitclaudel/monospacifier/blob/master/monospacifier.py 13 | - YosemiteAndElCapitanSystemFontPatcher: https://github.com/dtinth/YosemiteAndElCapitanSystemFontPatcher/blob/master/bin/patch 14 | """ 15 | 16 | import os 17 | import re 18 | import sys 19 | 20 | reload(sys) 21 | sys.setdefaultencoding('UTF8') 22 | 23 | import fontforge 24 | import psMat 25 | import unicodedata 26 | 27 | def height(font): 28 | return float(font.capHeight) 29 | 30 | def adjust_height(source, template, scale): 31 | source.selection.all() 32 | source.transform(psMat.scale(height(template) / height(source))) 33 | for attr in ['ascent', 'descent', 34 | 'hhea_ascent', 'hhea_ascent_add', 35 | 'hhea_linegap', 36 | 'hhea_descent', 'hhea_descent_add', 37 | 'os2_winascent', 'os2_winascent_add', 38 | 'os2_windescent', 'os2_windescent_add', 39 | 'os2_typoascent', 'os2_typoascent_add', 40 | 'os2_typodescent', 'os2_typodescent_add', 41 | ]: 42 | setattr(source, attr, getattr(template, attr)) 43 | source.transform(psMat.scale(scale)) 44 | 45 | font = fontforge.open('vendor/comic-shanns.otf') 46 | ref = fontforge.open('vendor/Cousine-Regular.ttf') 47 | for g in font.glyphs(): 48 | uni = g.unicode 49 | category = unicodedata.category(unichr(uni)) if 0 <= uni <= sys.maxunicode else None 50 | if g.width > 0 and category not in ['Mn', 'Mc', 'Me']: 51 | target_width = 510 52 | if g.width != target_width: 53 | delta = target_width - g.width 54 | g.left_side_bearing += delta / 2 55 | g.right_side_bearing += delta - g.left_side_bearing 56 | g.width = target_width 57 | 58 | font.familyname = 'Comic Mono' 59 | font.version = '0.1.1' 60 | font.comment = 'https://github.com/dtinth/comic-mono-font' 61 | font.copyright = 'https://github.com/dtinth/comic-mono-font/blob/master/LICENSE' 62 | 63 | adjust_height(font, ref, 0.875) 64 | font.sfnt_names = [] # Get rid of 'Prefered Name' etc. 65 | font.fontname = 'ComicMono' 66 | font.fullname = 'Comic Mono' 67 | font.generate('ComicMono.ttf') 68 | 69 | font.selection.all() 70 | font.fontname = 'ComicMono-Bold' 71 | font.fullname = 'Comic Mono Bold' 72 | font.weight = 'Bold' 73 | font.changeWeight(32, "LCG", 0, 0, "squish") 74 | font.generate('ComicMono-Bold.ttf') --------------------------------------------------------------------------------