From 95ef988207abadd99ca63f115773ee7fcbe0f420 Mon Sep 17 00:00:00 2001 From: Thai on Cloud9 Date: Fri, 7 Jun 2019 11:05:30 +0000 Subject: Rename to Comic Mono --- ComicMono-Bold.ttf | Bin 0 -> 20516 bytes ComicMono.ttf | Bin 0 -> 18724 bytes LICENSE | 3 +- README.md | 30 +++++++------------- comic-shanns-dtinth.otf | Bin 48552 -> 0 bytes comic-shanns-dtinth.ttf | Bin 19212 -> 0 bytes comic-shanns.otf | Bin 14076 -> 0 bytes dtinth.py | 58 ------------------------------------- generate.py | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 86 insertions(+), 79 deletions(-) create mode 100644 ComicMono-Bold.ttf create mode 100644 ComicMono.ttf delete mode 100644 comic-shanns-dtinth.otf delete mode 100644 comic-shanns-dtinth.ttf delete mode 100644 comic-shanns.otf delete mode 100644 dtinth.py create mode 100644 generate.py diff --git a/ComicMono-Bold.ttf b/ComicMono-Bold.ttf new file mode 100644 index 0000000..e03f41e Binary files /dev/null and b/ComicMono-Bold.ttf differ diff --git a/ComicMono.ttf b/ComicMono.ttf new file mode 100644 index 0000000..9bc7354 Binary files /dev/null and b/ComicMono.ttf differ diff --git a/LICENSE b/LICENSE index 0f2a0dd..7626af5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,7 @@ MIT License -Copyright (c) 2018 Shannon Miwa +Original work Copyright (c) 2018 Shannon Miwa +Modified work Copyright (c) 2019 dtinth 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 58bd4fe..1c7064a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,13 @@ -# What it is -A classy font. +# Comic Mono +A monospaced font based on [Shannon Miwa](https://github.com/shannpersand)’s [Comic Shanns](https://github.com/shannpersand/comic-shanns). -## Changes in dtinth’s fork +## Changes from Comic Shanns 1. All glyphs have been adjusted 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. -3. The name is changed to `Comic Shanns dtinth`. +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) + +I have no font creation skills, just a software developer. The original font, [Comic Shanns](https://github.com/shannpersand/comic-shanns), is patched using a Python script, [`generate.py`](generate.py). ## Usage You can download it and install it like any other font. @@ -16,18 +19,5 @@ Like if someone made a dumbass version of Comic Sans that is monospaced. ![image 2](https://user-images.githubusercontent.com/4615568/44279592-ca292e00-a206-11e8-9278-4a7566425c0c.png) ![image](https://user-images.githubusercontent.com/4615568/44279593-ca292e00-a206-11e8-9b25-a4533b50d471.png) -## What's in it? -`ABCDEFGHIJKLMNOPQRSTUVWXYZ` - -`abcdefghijklmnopqrstuvwxyz` - -`1234567890` - -`~!@#$%^&*()-—+=;:"'<>,.?/\|[]{}?` - ---- -### I need help with it... -File an issue, we'll see. - -### License -It is licensed under the MIT License. +## License +It is licensed under the [MIT License](LICENSE). diff --git a/comic-shanns-dtinth.otf b/comic-shanns-dtinth.otf deleted file mode 100644 index 3c0ae3b..0000000 Binary files a/comic-shanns-dtinth.otf and /dev/null differ diff --git a/comic-shanns-dtinth.ttf b/comic-shanns-dtinth.ttf deleted file mode 100644 index 30b32e9..0000000 Binary files a/comic-shanns-dtinth.ttf and /dev/null differ diff --git a/comic-shanns.otf b/comic-shanns.otf deleted file mode 100644 index 35043ad..0000000 Binary files a/comic-shanns.otf and /dev/null differ diff --git a/dtinth.py b/dtinth.py deleted file mode 100644 index 0b4108b..0000000 --- a/dtinth.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python2 -# -*- coding: utf-8 -*- - -"""Update the glyph metrics so that they all really have the same size.""" - -# Based on -# - monospacifier: https://github.com/cpitclaudel/monospacifier/blob/master/monospacifier.py -# - YosemiteAndElCapitanSystemFontPatcher: https://github.com/dtinth/YosemiteAndElCapitanSystemFontPatcher/blob/master/bin/patch - -import os -import re -import sys - -reload(sys) -sys.setdefaultencoding('UTF8') - -import fontforge -import psMat -import unicodedata - -def height(font): - return float(font.capHeight) - -def adjust_height(source, template): - source.selection.all() - source.transform(psMat.scale(height(template) / height(source))) - for attr in ['ascent', 'descent', - 'hhea_ascent', 'hhea_ascent_add', - 'hhea_linegap', - 'hhea_descent', 'hhea_descent_add', - 'os2_winascent', 'os2_winascent_add', - 'os2_windescent', 'os2_windescent_add', - 'os2_typoascent', 'os2_typoascent_add', - 'os2_typodescent', 'os2_typodescent_add', - ]: - setattr(source, attr, getattr(template, attr)) - source.transform(psMat.scale(0.9)) - -font = fontforge.open('comic-shanns.otf') -ref = fontforge.open('vendor/Menlo.ttc') -for g in font.glyphs(): - uni = g.unicode - category = unicodedata.category(unichr(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.width = target_width - -adjust_height(font, ref) -font.sfnt_names = [] # Get rid of 'Prefered Name' etc. -font.fontname = 'Comic Shanns dtinth' -font.familyname = 'Comic Shanns dtinth' -font.fullname = 'Comic Shanns dtinth' -font.generate('comic-shanns-dtinth.otf') -font.generate('comic-shanns-dtinth.ttf') \ No newline at end of file diff --git a/generate.py b/generate.py new file mode 100644 index 0000000..3b416d6 --- /dev/null +++ b/generate.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- + +""" +Generates the Comic Mono font files based on Comic Shanns font. + +Required files: +- vendor/comic-shanns.otf +- vendor/Cousine-Regular.ttf + +Based on: +- monospacifier: https://github.com/cpitclaudel/monospacifier/blob/master/monospacifier.py +- YosemiteAndElCapitanSystemFontPatcher: https://github.com/dtinth/YosemiteAndElCapitanSystemFontPatcher/blob/master/bin/patch +""" + +import os +import re +import sys + +reload(sys) +sys.setdefaultencoding('UTF8') + +import fontforge +import psMat +import unicodedata + +def height(font): + return float(font.capHeight) + +def adjust_height(source, template, scale): + source.selection.all() + source.transform(psMat.scale(height(template) / height(source))) + for attr in ['ascent', 'descent', + 'hhea_ascent', 'hhea_ascent_add', + 'hhea_linegap', + 'hhea_descent', 'hhea_descent_add', + 'os2_winascent', 'os2_winascent_add', + 'os2_windescent', 'os2_windescent_add', + 'os2_typoascent', 'os2_typoascent_add', + 'os2_typodescent', 'os2_typodescent_add', + ]: + setattr(source, attr, getattr(template, attr)) + source.transform(psMat.scale(scale)) + +font = fontforge.open('vendor/comic-shanns.otf') +ref = fontforge.open('vendor/Cousine-Regular.ttf') +for g in font.glyphs(): + uni = g.unicode + category = unicodedata.category(unichr(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.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' + +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.selection.all() +font.fontname = 'ComicMono-Bold' +font.fullname = 'Comic Mono Bold' +font.weight = 'Bold' +font.changeWeight(32, "LCG", 0, 0, "squish") +font.generate('ComicMono-Bold.ttf') -- cgit v1.2.3