From 3534d7213afe10b67c1765258e625246961b71fc Mon Sep 17 00:00:00 2001 From: jptrzy Date: Sat, 13 Aug 2022 17:21:51 +0200 Subject: Init Neo --- .gitignore | 6 +- ComicMono-Bold.ttf | Bin 20516 -> 0 bytes ComicMono.ttf | Bin 18724 -> 0 bytes Gemfile | 2 - Gemfile.lock | 248 -------------------------------------------------- LICENSE | 1 + README.md | 47 +++------- _config.yml | 2 - _layouts/default.html | 34 ------- assets/css/style.scss | 126 ------------------------- generate.py | 41 +++++---- makefile | 23 +++++ neo-font.otf | Bin 0 -> 7328 bytes 13 files changed, 65 insertions(+), 465 deletions(-) delete mode 100644 ComicMono-Bold.ttf delete mode 100644 ComicMono.ttf delete mode 100644 Gemfile delete mode 100644 Gemfile.lock delete mode 100644 _config.yml delete mode 100644 _layouts/default.html delete mode 100644 assets/css/style.scss create mode 100644 makefile create mode 100644 neo-font.otf diff --git a/.gitignore b/.gitignore index 7f228e2..2b17370 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ vendor -*.pyc -_site \ No newline at end of file +build +down + +*.pyc \ No newline at end of file diff --git a/ComicMono-Bold.ttf b/ComicMono-Bold.ttf deleted file mode 100644 index e03f41e..0000000 Binary files a/ComicMono-Bold.ttf and /dev/null differ diff --git a/ComicMono.ttf b/ComicMono.ttf deleted file mode 100644 index 9bc7354..0000000 Binary files a/ComicMono.ttf and /dev/null differ diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 37f5eaa..0000000 --- a/Gemfile +++ /dev/null @@ -1,2 +0,0 @@ -source 'https://rubygems.org' -gem 'github-pages', group: :jekyll_plugins diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 0f2b8ab..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,248 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.2.11.1) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.11.1) - colorator (1.1.0) - commonmarker (0.17.13) - ruby-enum (~> 0.5) - concurrent-ruby (1.1.5) - dnsruby (1.61.2) - addressable (~> 2.5) - em-websocket (0.5.1) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0.6.0) - ethon (0.12.0) - ffi (>= 1.3.0) - eventmachine (1.2.7) - execjs (2.7.0) - faraday (0.15.4) - multipart-post (>= 1.2, < 3) - ffi (1.11.1) - forwardable-extended (2.6.0) - gemoji (3.0.1) - github-pages (198) - activesupport (= 4.2.11.1) - github-pages-health-check (= 1.16.1) - jekyll (= 3.8.5) - jekyll-avatar (= 0.6.0) - jekyll-coffeescript (= 1.1.1) - jekyll-commonmark-ghpages (= 0.1.5) - jekyll-default-layout (= 0.1.4) - jekyll-feed (= 0.11.0) - jekyll-gist (= 1.5.0) - jekyll-github-metadata (= 2.12.1) - jekyll-mentions (= 1.4.1) - jekyll-optional-front-matter (= 0.3.0) - jekyll-paginate (= 1.1.0) - jekyll-readme-index (= 0.2.0) - jekyll-redirect-from (= 0.14.0) - jekyll-relative-links (= 0.6.0) - jekyll-remote-theme (= 0.3.1) - jekyll-sass-converter (= 1.5.2) - jekyll-seo-tag (= 2.5.0) - jekyll-sitemap (= 1.2.0) - jekyll-swiss (= 0.4.0) - jekyll-theme-architect (= 0.1.1) - jekyll-theme-cayman (= 0.1.1) - jekyll-theme-dinky (= 0.1.1) - jekyll-theme-hacker (= 0.1.1) - jekyll-theme-leap-day (= 0.1.1) - jekyll-theme-merlot (= 0.1.1) - jekyll-theme-midnight (= 0.1.1) - jekyll-theme-minimal (= 0.1.1) - jekyll-theme-modernist (= 0.1.1) - jekyll-theme-primer (= 0.5.3) - jekyll-theme-slate (= 0.1.1) - jekyll-theme-tactile (= 0.1.1) - jekyll-theme-time-machine (= 0.1.1) - jekyll-titles-from-headings (= 0.5.1) - jemoji (= 0.10.2) - kramdown (= 1.17.0) - liquid (= 4.0.0) - listen (= 3.1.5) - mercenary (~> 0.3) - minima (= 2.5.0) - nokogiri (>= 1.8.5, < 2.0) - rouge (= 2.2.1) - terminal-table (~> 1.4) - github-pages-health-check (1.16.1) - addressable (~> 2.3) - dnsruby (~> 1.60) - octokit (~> 4.0) - public_suffix (~> 3.0) - typhoeus (~> 1.3) - html-pipeline (2.11.0) - activesupport (>= 2) - nokogiri (>= 1.4) - http_parser.rb (0.6.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - jekyll (3.8.5) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 2.0) - kramdown (~> 1.14) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 4) - safe_yaml (~> 1.0) - jekyll-avatar (0.6.0) - jekyll (~> 3.0) - jekyll-coffeescript (1.1.1) - coffee-script (~> 2.2) - coffee-script-source (~> 1.11.1) - jekyll-commonmark (1.3.1) - commonmarker (~> 0.14) - jekyll (>= 3.7, < 5.0) - jekyll-commonmark-ghpages (0.1.5) - commonmarker (~> 0.17.6) - jekyll-commonmark (~> 1) - rouge (~> 2) - jekyll-default-layout (0.1.4) - jekyll (~> 3.0) - jekyll-feed (0.11.0) - jekyll (~> 3.3) - jekyll-gist (1.5.0) - octokit (~> 4.2) - jekyll-github-metadata (2.12.1) - jekyll (~> 3.4) - octokit (~> 4.0, != 4.4.0) - jekyll-mentions (1.4.1) - html-pipeline (~> 2.3) - jekyll (~> 3.0) - jekyll-optional-front-matter (0.3.0) - jekyll (~> 3.0) - jekyll-paginate (1.1.0) - jekyll-readme-index (0.2.0) - jekyll (~> 3.0) - jekyll-redirect-from (0.14.0) - jekyll (~> 3.3) - jekyll-relative-links (0.6.0) - jekyll (~> 3.3) - jekyll-remote-theme (0.3.1) - jekyll (~> 3.5) - rubyzip (>= 1.2.1, < 3.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-seo-tag (2.5.0) - jekyll (~> 3.3) - jekyll-sitemap (1.2.0) - jekyll (~> 3.3) - jekyll-swiss (0.4.0) - jekyll-theme-architect (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-cayman (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-dinky (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-hacker (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-leap-day (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-merlot (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-midnight (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-minimal (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-modernist (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-primer (0.5.3) - jekyll (~> 3.5) - jekyll-github-metadata (~> 2.9) - jekyll-seo-tag (~> 2.0) - jekyll-theme-slate (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-tactile (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-theme-time-machine (0.1.1) - jekyll (~> 3.5) - jekyll-seo-tag (~> 2.0) - jekyll-titles-from-headings (0.5.1) - jekyll (~> 3.3) - jekyll-watch (2.2.1) - listen (~> 3.0) - jemoji (0.10.2) - gemoji (~> 3.0) - html-pipeline (~> 2.2) - jekyll (~> 3.0) - kramdown (1.17.0) - liquid (4.0.0) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - mercenary (0.3.6) - mini_portile2 (2.4.0) - minima (2.5.0) - jekyll (~> 3.5) - jekyll-feed (~> 0.9) - jekyll-seo-tag (~> 2.1) - minitest (5.11.3) - multipart-post (2.1.1) - nokogiri (1.10.3) - mini_portile2 (~> 2.4.0) - octokit (4.14.0) - sawyer (~> 0.8.0, >= 0.5.3) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (3.1.0) - rb-fsevent (0.10.3) - rb-inotify (0.10.0) - ffi (~> 1.0) - rouge (2.2.1) - ruby-enum (0.7.2) - i18n - ruby_dep (1.5.0) - rubyzip (1.2.3) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sawyer (0.8.2) - addressable (>= 2.3.5) - faraday (> 0.8, < 2.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - typhoeus (1.3.1) - ethon (>= 0.9.0) - tzinfo (1.2.5) - thread_safe (~> 0.1) - unicode-display_width (1.6.0) - -PLATFORMS - ruby - -DEPENDENCIES - github-pages - -BUNDLED WITH - 1.17.2 diff --git a/LICENSE b/LICENSE index 7626af5..69486e1 100644 --- a/LICENSE +++ b/LICENSE @@ -2,6 +2,7 @@ MIT License Original work Copyright (c) 2018 Shannon Miwa Modified work Copyright (c) 2019 dtinth +Modified work Copyright (c) 2022 jptrzy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 88155ac..6206fd6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# Comic Mono -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). +# Neo Comic Mono +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 2) with my small polish additions.

@@ -7,41 +7,20 @@ A legible monospace font... the very typeface you’ve been trained to recognize

-## Download -- [ComicMono.ttf](https://dtinth.github.io/comic-mono-font/ComicMono.ttf) -- [ComicMono-Bold.ttf](https://dtinth.github.io/comic-mono-font/ComicMono-Bold.ttf) - -## Differences from Comic Shanns -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)). -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. -3. The name is changed to `Comic Mono`. -4. A bold version of the font is generated using [FontForge’s Embolden](https://fontforge.github.io/Styles.html#Embolden) operation. - -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). - -## What does it look like? -

- - Check it out! - -

- -```python -{% include_relative generate.py %} -``` - -## CDN -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). -```html - +## Installation +``` bash +make download +make +sudo make install # Only for linux and I don't realy even know, if I do it "the right way", so good luck. ``` -## npm Package -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. +### Requirments +* python3 +* fontforge +* wget -## Packages published by third parties -- Fontsource: [@fontsource/comic-mono](https://www.npmjs.com/package/@fontsource/comic-mono) ([thanks @DecliningLotus](https://github.com/fontsource/fontsource/pull/117)) -- Arch Linux AUR: [ttf-comic-mono-git](https://aur.archlinux.org/packages/ttf-comic-mono-git/) (maintained by DBourgeoisat) +## Origins +Originaly it was [Comic Mono Font](https://github.com/dtinth/comic-mono-font), but becouse of lack of support of new characters; I created my own fork that is build with Comic Shanns V2 and with small additions of my own characters. ## License It is licensed under the [MIT License](LICENSE). diff --git a/_config.yml b/_config.yml deleted file mode 100644 index e75deb0..0000000 --- a/_config.yml +++ /dev/null @@ -1,2 +0,0 @@ -theme: jekyll-theme-primer -google_analytics: UA-59441941-6 diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index c09d281..0000000 --- a/_layouts/default.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - -{% seo %} - - - -
- {{ content }} - - {% if site.github.private != true and site.github.license %} - - {% endif %} -
- - - {% if site.google_analytics %} - - {% endif %} - - diff --git a/assets/css/style.scss b/assets/css/style.scss deleted file mode 100644 index bf7942c..0000000 --- a/assets/css/style.scss +++ /dev/null @@ -1,126 +0,0 @@ ---- ---- - -@import "{{ site.theme }}"; - -@font-face { - font-family: Comic Mono; - font-weight: normal; - src: url(../../ComicMono.ttf); -} - -@font-face { - font-family: Comic Mono; - font-weight: bold; - src: url(../../ComicMono-Bold.ttf); -} - -// Colors are based on One Dark color scheme. - -html, body, .markdown-body.comic-mono { - background-color: #252423; - color: #bbbbbb; -} - -.markdown-body.comic-mono { - color: #bbbbbb; - border-radius: 3px; - font-family: Comic Mono, Cousine, monospace; - -webkit-font-smoothing: antialiased; - line-height: 1.45; - overflow: auto; - padding: 16px; - max-width: 700px; - @media (min-width: 960px) { - max-width: 875px; - font-size: 20px; - } - h1, h2, h3, p, li, pre { - margin: 1.5em 0; - padding: 0; - font-size: 100%; - line-height: 1.5em; - border: none; - } - ul, ol { - margin: 0; - padding: 0; - list-style-position: inside; - } - ul { - list-style: none; - } - ul > li::before { - content: '* '; - } - h1, h2 { - color: #e06c75; - } - h1::before { - content: '# '; - } - h2::before { - content: '## '; - } - a { - color: #61afef; - } - a::before { - content: '['; - color: #5c6370; - } - a::after { - content: ']'; - color: #5c6370; - } - code, pre { - font: inherit; - padding: 0; - background: none; - } - .highlight { - background: none; - } - pre { - &::before, &::after { - content: '```'; - display: block; - color: #5c6370; - } - } - :not(pre) > code { - &::before, &::after { - content: '`'; - } - } - .highlight { - .nn, .o { - color: inherit; - } - .c { - color: #5c6370; - } - .s { - color: #98c379; - } - .kn, .k, .ow { - color: #c678dd; - } - .mi, .mf, .na { - color: #d19a66; - } - .nb { - color: #56b6c2; - } - .nf { - color: #61afef; - } - .nt { - color: #e06c75; - } - } -} - -.website-hidden { - display: none; -} diff --git a/generate.py b/generate.py index 634f907..7b5f545 100644 --- a/generate.py +++ b/generate.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @@ -17,8 +17,8 @@ import os import re import sys -reload(sys) -sys.setdefaultencoding('UTF8') +# reload(sys) +# sys.setdefaultencoding('UTF8') import fontforge import psMat @@ -43,32 +43,39 @@ def adjust_height(source, template, scale): source.transform(psMat.scale(scale)) font = fontforge.open('vendor/comic-shanns.otf') -ref = fontforge.open('vendor/Cousine-Regular.ttf') + +new = fontforge.open('neo-font.otf') +font.mergeFonts(new) + +ref = fontforge.open('vendor/cousine.ttf') + for g in font.glyphs(): uni = g.unicode - category = unicodedata.category(unichr(uni)) if 0 <= uni <= sys.maxunicode else None + category = unicodedata.category(chr(uni)) if 0 <= uni <= sys.maxunicode else None if g.width > 0 and category not in ['Mn', 'Mc', 'Me']: target_width = 510 if g.width != target_width: delta = target_width - g.width - g.left_side_bearing += delta / 2 - g.right_side_bearing += delta - g.left_side_bearing + g.left_side_bearing = int(delta / 2) + g.right_side_bearing = int(delta - g.left_side_bearing) g.width = target_width -font.familyname = 'Comic Mono' -font.version = '0.1.1' -font.comment = 'https://github.com/dtinth/comic-mono-font' -font.copyright = 'https://github.com/dtinth/comic-mono-font/blob/master/LICENSE' + + +font.familyname = 'Neo Comic Mono' +font.version = '0.0.1' +font.comment = 'https://github.com/jptrzy/neo-comic-mono-font' +font.copyright = 'https://raw.githubusercontent.com/jptrzy/neo-comic-mono-font/master/LICENSE' adjust_height(font, ref, 0.875) font.sfnt_names = [] # Get rid of 'Prefered Name' etc. -font.fontname = 'ComicMono' -font.fullname = 'Comic Mono' -font.generate('ComicMono.ttf') +font.fontname = 'NeoComicMono' +font.fullname = 'Neo Comic Mono' +font.generate('build/NeoComicMono.ttf') font.selection.all() -font.fontname = 'ComicMono-Bold' -font.fullname = 'Comic Mono Bold' +font.fontname = 'NeoComicMono-Bold' +font.fullname = 'Neo Comic Mono Bold' font.weight = 'Bold' font.changeWeight(32, "LCG", 0, 0, "squish") -font.generate('ComicMono-Bold.ttf') \ No newline at end of file +font.generate('build/NeoComicMono-Bold.ttf') diff --git a/makefile b/makefile new file mode 100644 index 0000000..00a85ca --- /dev/null +++ b/makefile @@ -0,0 +1,23 @@ + +all: clean main + +clean: + rm -rf build/* down + +main: + mkdir -p build + python generate.py + +install: main + mkdir -p /usr/share/fonts/neo-comic + cp build/* /usr/share/fonts/neo-comic + +download: + mkdir -p down vendor + wget https://www.ffonts.net/Cousin.font.zip -O down/cousin.zip + unzip -u down/cousin.zip -d down + cp down/*.ttf vendor/cousine.ttf + wget https://github.com/shannpersand/comic-shanns/raw/master/v2/comic%20shanns.otf -O vendor/comic-shanns.otf + rm -rf down + + diff --git a/neo-font.otf b/neo-font.otf new file mode 100644 index 0000000..145a906 Binary files /dev/null and b/neo-font.otf differ -- cgit v1.2.3