Now Reading
Comedian Mono | comic-mono-font

Comedian Mono | comic-mono-font

2023-06-13 11:01:39

A legible monospace font… the very typeface you’ve been skilled to acknowledge since childhood. This font is a fork of Shannon Miwa’s Comic Shanns (model 1).


Screenshot

Obtain

Variations from Comedian Shanns

  1. All glyphs have been adjusted to have precisely the identical width (utilizing code based mostly on monospacifier).
  2. The glyph metrics have been adjusted to make it show higher alongside system font, based mostly on Cousine’s metrics.
  3. The title is modified to Comedian Mono.
  4. A daring model of the font is generated utilizing FontForge’s Embolden operation.

I’ve no font creation expertise; I’m only a software program developer. This font household is created by patching the unique font, Comic Shanns (v1), utilizing a Python script, generate.py.

What does it seem like?


Check it out!

#!/usr/bin/env python2
# -*- coding: utf-8 -*-

"""
Generates the Comedian Mono font information based mostly on Comedian Shanns font.

Required information:
- vendor/comic-shanns.otf
- vendor/Cousine-Common.ttf

Based mostly on:
- monospacifier: https://github.com/cpitclaudel/monospacifier/blob/grasp/monospacifier.py
- YosemiteAndElCapitanSystemFontPatcher: https://github.com/dtinth/YosemiteAndElCapitanSystemFontPatcher/blob/grasp/bin/patch
"""

import os
import re
import sys

reload(sys)
sys.setdefaultencoding('UTF8')

import fontforge
import psMat
import unicodedata

def peak(font):
    return float(font.capHeight)

def adjust_height(supply, template, scale):
    supply.choice.all()
    supply.remodel(psMat.scale(peak(template) / peak(supply)))
    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(supply, attr, getattr(template, attr))
    supply.remodel(psMat.scale(scale))

font = fontforge.open('vendor/comic-shanns.otf')
ref = fontforge.open('vendor/Cousine-Common.ttf')
for g in font.glyphs():
    uni = g.unicode
    class = unicodedata.class(unichr(uni)) if 0 <= uni <= sys.maxunicode else None
    if g.width > 0 and class 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 = 'Comedian Mono'
font.model = '0.1.1'
font.remark = 'https://github.com/dtinth/comic-mono-font'
font.copyright = 'https://github.com/dtinth/comic-mono-font/blob/grasp/LICENSE'

adjust_height(font, ref, 0.875)
font.sfnt_names = [] # Do away with 'Prefered Identify' and so on.
font.fontname = 'ComicMono'
font.fullname = 'Comedian Mono'
font.generate('ComicMono.ttf')

font.choice.all()
font.fontname = 'ComicMono-Daring'
font.fullname = 'Comedian Mono Daring'
font.weight = 'Daring'
font.changeWeight(32, "LCG", 0, 0, "squish")
font.generate('ComicMono-Daring.ttf')

CDN

You should utilize this font in your internet pages by together with the stylesheet. CDN is offered by jsDelivr.

<hyperlink rel="stylesheet" href="https://cdn.jsdelivr.internet/npm/comic-mono@0.0.1/index.css">

npm Bundle

The contents of this package deal can also be published to npm, though the font information aren’t optimized. See fontsource package deal (beneath) for a greater choice.

See Also

Packages revealed by third events

License

It’s licensed beneath the MIT License.

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top