Code Monkey home page Code Monkey logo

cozette's Introduction

Cozette

GitHub release (latest by date) AUR version GitHub Workflow Status GitHub All Releases GitHub license

Cozette

A bitmap programming font optimized for coziness.

Contents

About Cozette

Cozette is a 6x13px (bounding box; average 5px character width, 3px descent, 10px ascent, 8px cap height) bitmap font based on Dina, which itself is based on Proggy. It's also heavily inspired by Creep. I absolutely adore Creep, and was using it up until I got a higher-DPI screen for which it was slightly too small. That prompted me to make the bitmap font I always wished existed: Cozette; a small-but-not-tiny bitmap font with great coverage of all the glyphs you might encounter in the terminal:

glyphs in Cozette

I'm intentionally putting the emphasis on "you" - although Cozette already has all the glyphs I've seen in my CLI tools so far, you might find it's missing a glyph you wish it had. If that's the case, please file an issue! It's an important goal for Cozette to be a useful bitmap alternative to Nerd Fonts.

A nicer character map that includes the codepoints can be found at the bottom of this README!

Installation

Variants and Sizes

Cozette is distributed in three main variants: normal and hi-dpi (upscaled 2x) bitmaps (.bdf, .otb, .psf, and .fnt), and vectors (.ttf).

Font scaling varies wildly from system to system, and sometimes even from program to program and font format to format. On my system (Linux), cozette.otb looks right at 13pts; cozette_hidpi.otb looks right at 26pts and downscales quite elegantly to 10pts; CozetteVector doesn't look right at any size (technically, it will look right specifically at 9.4pts on a 100dpi screen on Linux, but pixel-perfect bitmap fonts are a massive headache, treated differently by every OS, that I'm not quite sure how to solve)

Bitmap fonts are, effectively, just that - bitmaps. They scale terribly, but look nice and sharp (and pixel-perfect) at one specific point size. Vector fonts scale well, but in this case, might look ugly at smaller point sizes because of antialiasing issues and the like.

NOTE:

The vector formats (`CozetteVector`) are provided as a compatibility feature. Rendering of vectorized bitmap-like fonts is terrible on virtually all operating systems.

If Cozette looks awful on your system, you probably have a vector version. Please use the bitmap formats (.otb) if you can.

Issues with vector formats will almost certainly not be fixed or addressed; Cozette is a bitmap font first and foremost, and building a bitmap font that builds from a single source and looks good both in its intended, bitmap font as well as as the auto-vectorized format, on every OS, seems to be an unsolved problem.

Linux

The preferred format is .otb (for bitmaps) or .ttf (for CozetteVector). To install the font, just throw it in your fonts directory (you probably want to follow your distro's instructions). On Ubuntu you might need to specifically enable bitmap fonts.

If you're on Arch, ifreund made an AUR package for the .otb! Install it using your AUR helper of choice:

$ yay -S cozette-otb

Or, if you're not using an AUR helper:

$ git clone https://aur.archlinux.org/cozette-otb.git
$ cd cozette-otb
$ makepkg -si

Mac

Download the .dfont and install it with Font Book .app. Both the bitmap Cozette.dfont and the vector CozetteVector.dfont should work.

Windows

Grab CozetteVector.ttf. If you want to get the bitmap versions to work, follow the instructions from here.

FreeBSD

laxul made a port for the .otb!

  • pkg: pkg install cozette
  • ports: cd /usr/ports/x11-fonts/cozette; make install clean

Other BSD / Solaris / Haiku / Other

You know what you're doing.

Notes on specific applications

Dmenu

dmenu (and reportedly some other applications, like urxvt) seems slightly fucky when it comes to dealing with font spacing. I cannot tell if this is an issue with Cozette specifically or with the font rendering in those applications, but they seem to pull the font spacing from your system's default monospace font for whatever reason. If setting Cozette as your system default is not an option (I don't recommend it, a lot of applications have problems with bitmap fonts), try using Cozette-<size> as the font name, ie. Cozette-8.

VSCode, general GUI applications

VSCode and a lot of other GUI applications don't support bitmap fonts, so you will want to use CozetteVector there. In applications that do support bitmap fonts, you will want to use the normal, bitmap Cozette (unless it's too small for you, in which case, CozetteVector scales better).

Kitty

4e554c4c made an AUR package for kitty patched to support bitmap fonts.

if you like bitmap fonts, kitty is not for you.

According to its author, kitty doesn't, and never will, support bitmap fonts.

If you really want to get Cozette working, you can try the AUR package mentioned above, or apply the patch there yourself.

If that doesn't work, you can try the trick from here; if you explicitly set Cozette(Vector)'s spacing to 100, and scalable to true in fontconfig, kitty should accept it.

You can also make Cozette work flawlessly by uninstalling kitty and using a terminal emulator for which not rendering fonts isn't a design principle - I cannot recommend alacritty enough. it's excellent, has worked flawlessly for me for quite some time, and both configuring and getting bitmap fonts to work in it is a breeze.

(The support was discussed in slavfox/Cozette#18. Many thanks to all the participants there, especially to to Luflosi, who brought up flipping the allow_bitmapped_fonts flag in their fork, and to 4e554c4c, who made the AUR package.)

Roadmap

Check the CHANGELOG for the latest news!

Here's where Cozette is so far, in the rough order the features are going to be implemented:

  • ASCII
  • Powerline
  • Build scripts to handle exporting
  • Box-drawing (mostly)
  • Braille
  • Cyrillic!
  • APL Glyphs (based on the list from APL386)!
  • Uiua glyphs!
  • BQN Glyphs!
  • Nerdfonts:
    • nf-pom-*
    • nf-seti-*
    • nf-dev-* (partial)
    • nf-weather-*
  • Glyph map generation (so I don't have to keep characters.png up to date)
  • "True" TTF version
    • Windows support
  • Full vim-airline support!
  • Full ranger_devicons support!
  • starship supported out of the box!
  • Full powerlevel10k support! (if it doesn't work, try setting POWERLEVEL9K_MODE to nerdfont-complete)
  • All glyphs used by maturin and many other CLI tools!
  • Charmap including the code points (to make it easier for users to report issues/request additions)
  • Codepoints above U+FFFF in vector fonts
  • Upscaled hi-dpi variant

Recommended alternatives

Cozette is, intentionally, a very small font. If neither the base nor the HiDpi version fit your needs, you might want to look at some other bitmap fonts with extra glyphs. A couple of my favorites are Tamzen and Envypn. You might also find the Tecate/bitmap-fonts repo useful.

Character map

For easy copy-pasting, the character map is provided in text form in img/charmap.txt. If you just want to see how the glyphs look in Cozette, here is a screenshot of it:

Character map

Building

If you want to build Cozette yourself, you'll need FontForge and Java. Once you have that, just clone this repo, open Cozette/Cozette.sfd in FontForge, and go to File → Generate Fonts....

To run the build scripts I use to prepare releases, first install Python (at least 3.8) and pipenv. For generating the images, you will also need xorg-mkfontscale and xterm. Then, install the dependencies and run build.py fonts:

$ pipenv install
$ pipenv run python build.py fonts

Then install the generated fonts, and run

$ pipenv run python build.py images

Running

$ pipenv run python build.py changelog

will output the changelog between your local version and the last tag.

Contributors

Massive thanks to ym1234 for helping me figure out how to make the font tables behave nicely.

Thanks to autumn, cpkio, yoshiyoshyosh, klinegareth, and dariof4 for contributing characters!

License & Acknowledgements

Cozette is licensed MIT 💜

Cozette's builds use bdfscale by philj56 and Bits'N'Picas by Kreative Software.

cozette's People

Contributors

auctumnus avatar augustkline avatar cpkio avatar cultab avatar dariof4 avatar dependabot[bot] avatar eejit43 avatar laxul avatar slavfox avatar vihangd avatar yoshiyoshyosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cozette's Issues

Add "intended size" to README

Bitmap fonts are, effectively, just that - bitmaps. They scale terribly, but look nice and sharp (and pixel-perfect) if you use them at their intended point size. Vector fonts scale well, but in this case, might look ugly at smaller point sizes because of antialiasing issues and the like.

What is the "intended point size"?

Pomicons

This is a request to add Pomicons. These are icons for Pomodoro timers, and unfortunately Cozette doesn't have them yet.

macOS Weird Rendering

Howdy, love Cozette use it on my Linux distro of choice 24/7. Want to use it on macOS but it appears as the following no matter where it's used (Sublime, Browser, TextEdit etc). Does Cozette work as expected for others on macOS or are there any known workarounds I can try?

image

Kitty terminal emulator support

I'm not sure if this font is considered monospace*, but if it is, then it doesn't get recognized by kitty. The kitty terminal emulator is quite picky about what it takes as a monospaced font and it doesn't detect Cozette. A list of fonts that it deems acceptable can be listed with kitty list-fonts.

Here's three issues for reference and possible solutions (it seems a common one is the font's Spacing parameter): kovidgoyal/kitty#827, kovidgoyal/kitty#557, and ryanoasis/nerd-fonts#268

Regardless of the resolution, thanks for the beautiful font!

*If this font isn't meant to be monospaced, feel free to close this issue.

Combining marks support

Is is possible to get combining diacrytic marks? For example, the text with code points б\u043E\u0301льшую (glyphs converted to UCN for convinience) should look like
2020-11-30_124033 but with Cozette I get 2020-11-30_124433

Some Symbols used in Powerlevel10k

Overall the font is great but it's missing some of the fonts used in the p10k zsh theme.
The missing symbols appear to be:
U+F015 ()
U+F07C ()
U+F023 ()
U+F312 ()
U+F126 ()
U+F113 ()

I don't know if this is the right format for the characters but it's what gucharmap gave when I put em in.

Windows doesn't recognize CozetteVector.ttf as a monospace font

Some programs (i.e. PuTTY) filter the list of fonts to only monospace ones by default, and Cozette isn't showing up in that set. In PuTTY if I enable "Allow selection of variable-pitch fonts" then it shows up. Other programs like PowerShell don't let you select non-monospaced fonts at all, so it's impossible to use there.

Must be some monospace bit that can be set in the font metadata?

dual licensing request

Hey @slavfox

First of all, great job with the font. I really like it.

Second, a suggestion, a MIT licensed open source font seems a bit odd choice to me, as even when embedding the fonts in a document would require users to supply the MIT license terms besides their own document. Most open-source fonts utilize the Open Font License (or OFL) by SIL international instead. Check https://en.wikipedia.org/wiki/SIL_Open_Font_License for further details. I'd suggest you to go with dual licensing: MIT or SIL, and let the end-user choose whichever license s/he prefers :D

Anyways, good work you did there!
Keep it up!

Symbols for text based status bar

For text based status bars like i3bar, i3blocks, xmobar, dwm-bar, etc., it would be great to have some symbols to label displayed informations (temperature, volume, memory, ...).
Are there already plans to include such ones?

Below I listed some specific symbols, which I use or have used at some point, with the corresponding unicode of font-awesome / nerd-fonts.

Volume

  • volume-mute (f6a9 / fc5d)
  • volume-off (f026 / f026)
  • volume-down (f027 / f027)
  • volume-up (f028 / f028)

Battery

  • battery-full (f240 / f240)
  • battery-three-quaters (f241 / f241)
  • battery-half (f242 / f242)
  • battery-quater (f243 / f243)
  • battery-empty (f244 / f244)
  • plug (f1e6 / f1e6)

Temperature (in my opinion, full, empty, ..., are not necessary)

  • thermometer-half (f2c9 / f2c9)

Web browser (I saw that nf-dev-* is already on the roadmap, so most browser icons should be included there. The globe would be multifunctional)

  • globe (f0ac / f0ac)

Network (\ue619 is already included but it got only 3/4 of height, which looks funny in my specific setup. One with a third "wave" would be nice or maybe a variation which is symmetrical, like the one below)

  • wifi (f1eb / f1eb)
  • ethernet (f796 / f6ff)

Workload

  • chart-area (f1fe / f1fe)
  • chart-bar (f080 / f080)
  • memory (f538 / -)
  • microchip (f2db / f2db)

Storage

  • database (f1c0 / f1c0)
  • hdd (f0a0 / f0a0)

Media

  • headphones (f025 / f025/f7ca)
  • headphones-slash (- /fccc)
  • microphone (f130 / f130)
  • microphone-slash (f131 / f131)
  • eject (f052 / f052)

Other

  • bell (f0f3 / f0f3)
  • bell-slash (f1f6 / f1f6)
  • calendar (f133 / f133)
  • clock (f017 / f017)
  • key (f084 / f084/f80a)

Weather (I don't use them but often see them in use on r/unixporn)
e.g. cloud-sun (f6c4 / e21d)

I triple checked and hope, that I didn't list anything that's already included.

Inconsistent character widths in vector font

The vector version of the font, CozetteVector, does not appear to be entirely fixed width. Some characters, such as the pause symbol (U+F04C) and the circled plus symbol (U+F055) have a smaller width, leading to misalignment (as clearly seen in the last column of the image below).

Misaligned

I don't know much about fonts or FontForge, but I noticed that all the offending characters declare an unusual Width in the Cozette.sfd file (945 instead of 1024).

StartChar: uniF04C
Encoding: 61516 61516 1123
Width: 945
Flags: W
LayerCount: 2
EndChar

StartChar: uniF055
Encoding: 61525 61525 1571
Width: 945
Flags: W
LayerCount: 2
EndChar

When I change the Width property to 1024 and rebuild, the characters become properly aligned:

Aligned

Is there a good reason these characters declare a different width, or is simply an oversight? If it's an oversight I can submit a pull request to fix it.

Bold Variant

I have faced a few issues with bold characters like letter m. The problem is that the character becomes so thick that it's difficult to identify them. I have seen this for all the characters, the only problem is with only letter m (small one). I have attached one the screenshot for understanding. Thanks, it's an amazing font and cozy as well.

Automatic changelog generation

I waste a lot of time adding new glyphs to the changelog. This became especially apparent when working on #7, which would probably be done by now if I hadn't been keeping track of the glyphs. The glyph changelist could be easily auto-generated, by reading the list from the last commit, and comparing it to the current version.

braille characters are wrong

some braille characters are misplaced (can be verified in fontforge).

for example U+280A through to U+280F, maybe there are more. These numbers give me the impression, that there is some hex numbering issue.

tested with 1.9.2

Wide glyph fixes

A lot of codepoints corresponding to wide glyphs are implemented as narrow. The big codepoints have a lot of problems in general.

  • Redo ttfbuilder to read glyphs from the .sfd instead of the generated .bdf. BDF fonts don't contain codepoints above U+FFFF.
  • Add lint command to build.py to flag incorrect glyph widths
  • Redraw wide glyphs to actually make use of the extra five pixels

Double-wide glyphs should make use of the double-width

Right now all the glyphs in Cozette are limited to the 6x13 bounding box. While this is cool for glyph map generation and whatnot, it leads to extraneous spacing whenever a double-wide glyph is drawn, like the 🐍 in my prompt:
image

build.py should probably be extended with glyph linting capabilities, so that it can warn about single-wide glyphs for double-wide codepoints, and oversize glyphs for single-wide codepoints.

U+220F N-ARY PRODUCT and U+2210 N-ARY COPRODUCT are too short

U+220F N-ARY PRODUCT and U+2210 N-ARY COPRODUCT are too short. They should, as n-ary operators, be taller than caps-height, like the current glyph for U+2225, but their glyphs are x-height. Here they are with U+03C0 GREEK SMALL LETTER PI for comparison.
∏∐π

Glyphs design discussion

What glyph decisions would you make: make a glyph narrow to keep 1px left margin or keep the letter intact?
ʼnĥħ are in the picture.

1

Two missing glyphs in Baltic script

Ų, U+0172 LATIN CAPITAL LETTER U WITH OGONEK
ų, U+0173 LATIN SMALL LETTER U WITH OGONEK

Missing these two has been bugging me, as every other baltic letter is covered already.

Can the generated fonts be put into the source code archive?

Hello,
I would like to build this font on opensuse.
For the font to make into the opensuse repo, the font must be build form source code.
I have a bit of trouble for font forge to run on opensuse build file.
So would it be a problem if you put the .otf or .ttf into the source code? It would be easier to build font on opensuse that way.
Thanks.

Scaling for HiDPI displays

Hi! While Cozette looks beautiful, it is way to small to be used on HiDPI displays. Would it be possible to scale every glyph by a factor of 2 or more? Or at least could you please advise the best way one can scale an .otb font, pixel-perfectly, so each pixel becomes a 2x2 block? Thank you.

CozetteVector.TTF does not work with Microsoft Word and WordPad

cozette-vector-word-issue

When trying to use Cozette Vector in Microsoft Word 2016, the font displayed seems to be the same as Courier New. WordPad is also unable to use the font correctly. The dropdown preview of fonts shown in Word also displays Cozette in the style of Courier New.

However, Notepad and LibreOffice Witer are both able to display the Cozette Vector correctly. A freeware screenshotting program called Greenshot is also able to use it correctly.

psf fonts?

i want to use cozette for my console, especially large sizes since my eyesight is poor

Taller variant

I use dina 12px as my main monospace font.
The 12px variant is taller than the 10px.
Would it be possible for cozette to support both ?

Support `\u2630`

\u2630 is the classic "three bars" symbol used for hamburger menus and other things. It also happens to be one of the default symbols used by vim-airline. It'd be great if you could add support for it!

The fallback it uses on my system looks blurry and ugly alongside the crisp cleanness of cozette:
image

I'm using \ue612 instead now, but it seems like \u2630 is fairly common and would be good to support.

Thanks

Bring full cyrillic support

This is sooooo neat! I'm wondering, why are абчё the only supported Cyrillic letters and is there any chance to bring full support? I'm really new to pixel fonts (and fonts in general) but I could work on a PR if you told me where to start :)

CozetteVector >1.8.0 not working on Windows

CozetteVector stopped working for Windows after version 1.8.0.
Opening the ttf file using the default Windows Font Viewer shows nothing, as if it is corrupted.
Here's screenshot comparing version 1.8.0 (the front window) vs. >1.8.0 (the back window):
image

Characters are spaced with one pixel in alacritty, but two in Emacs

I'm using cozette.pcf 1.11.3 (converted from cozette.bdf with bdftopcf) and the spacing between characters in Alacritty is 1 pixel, while the spacing between characters in Emacs is 2 pixels. I've included screenshots below of the difference.

Is there a way to force the spacing to be 1 pixel in all applications?

cozette-alacritty
cozette-emacs

Firefox DevTools bitmap Cozette strikethrough glyphs [Minor Bug]

Hello, I noticed a weird bug relating to the firefox developer tools.

As you can see in the following screenshot, the strikethrough seems to not use the correct glyph for strikethrough text, when using a bitmap version of Cozette.

bug-firefox

However, this is not an inherent bug of the font everywhere. For example, here is a screenshot of strikethrough text in Alacritty:

strikethrough

Note that CozetteVector on the other hand works as intended:

no-bug-firefox

Firefox Version: 88.0.1
Cozette Release (bitmap, otb files): v.1.10.1b1
CozetteVector Release: v.1.9.3-1

Add stressed greek characters

Please include the remaining stressed greek characters such as έ, ί, ό, ύ, ή.
Simply put, add a tone mark alternative above the already existing greek characters.

Broken symbols uE796, uF121, uF462, uFABF

I've found out build 1.10 has already been broken in this matter: those glyphs are rendered as dots or as blank space. It seems glyph going off-edge can break some renderings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.