{"id":16711066,"url":"https://github.com/w0rm/embedded-mogeefont","last_synced_at":"2025-05-14T22:11:53.851Z","repository":{"id":231670522,"uuid":"781907434","full_name":"w0rm/embedded-mogeefont","owner":"w0rm","description":"Pixel font for embedded-graphics","archived":false,"fork":false,"pushed_at":"2024-05-05T21:00:44.000Z","size":422,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-29T09:19:53.976Z","etag":null,"topics":["embedded-graphics","no-std"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/embedded-mogeefont","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/w0rm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-04T09:15:55.000Z","updated_at":"2025-04-14T13:56:58.000Z","dependencies_parsed_at":"2024-04-06T09:21:25.395Z","dependency_job_id":"a2c3cf7c-d82e-45a9-8348-95f44d540872","html_url":"https://github.com/w0rm/embedded-mogeefont","commit_stats":null,"previous_names":["w0rm/embedded-mogeefont"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Fembedded-mogeefont","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Fembedded-mogeefont/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Fembedded-mogeefont/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w0rm%2Fembedded-mogeefont/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w0rm","download_url":"https://codeload.github.com/w0rm/embedded-mogeefont/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235694,"owners_count":22036964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-graphics","no-std"],"created_at":"2024-10-12T20:10:40.227Z","updated_at":"2025-05-14T22:11:53.825Z","avatar_url":"https://github.com/w0rm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# embedded-mogeefont\n\n![Unlike many other pixel fonts, MogeeFont maximizes screen space efficiency by incorporating glyphs of variable width alongside kerning tables and ligatures.](mogeefont.png)\n\nMogeeFont was originally created by Nadya Kuzmina for a pixel game that had to fit on a 64×64 pixel screen. You can read about [the history of MogeeFont here](https://nadyakuzmina.com/story-of-mogeefont.html). This crate brings the font to embedded systems, it should be used together with [embedded-graphics](https://github.com/embedded-graphics/embedded-graphics) and [embedded-text](https://github.com/embedded-graphics/embedded-text).\n\n![Embedded](embedded.jpg)\n\n# Usage\n\n```rust\nuse embedded_text::{style::TextBoxStyle, TextBox};\nuse embedded_mogeefont::MogeeTextStyle;\nuse embedded_graphics::{\n  geometry::{Size, Point},\n  mock_display::MockDisplay,\n  pixelcolor::BinaryColor,\n  primitives::Rectangle,\n  Drawable,\n};\n\nlet mut display = MockDisplay::new();\nlet character_style = MogeeTextStyle::new(BinaryColor::On);\nlet textbox_style = TextBoxStyle::default();\nlet textbox_bounds = Rectangle::new(Point::zero(), Size::new(42, 22));\nlet textbox = TextBox::with_textbox_style(\n   \"Hello, world!\",\n   textbox_bounds,\n   character_style,\n   textbox_style,\n);\ntextbox.draw(\u0026mut display).unwrap();\nassert_eq!(\n  display,\n  MockDisplay::from_pattern(\u0026[\n    \"                                          \",\n    \"#  #     # #                       #   # #\",\n    \"#  #     # #                       #   # #\",\n    \"#  #  ## # # ##      # # # ##  ##  #  ## #\",\n    \"#### # # # # # #     # # # # # # # # # # #\",\n    \"#  # ### # # # #     # # # # # # # # # # #\",\n    \"#  # #   # # # #     # # # # # #   # # #  \",\n    \"#  #  ## # #  ## #   ## #   ## #   # ##  #\",\n    \"                 #                        \",\n    \"                #                         \",\n  ]),\n);\n```\n\n# Developing\n\nThis code includes files from the original [MogeeFont](https://github.com/kuzminadya/mogeefont) repo using a git submodule. Make sure to run `git submodule init` and `git submodule update` to bring in the submodule contents.\n\nThe easiest way to start hacking on the code is to [install nix](https://nixos.org/download/#download-nix), enable [nix flakes](https://wiki.nixos.org/wiki/Flakes), then run:\n\n```sh\nnix develop\n```\n\nTo preview the font in the browser with the [embedded-graphics-web-simulator](https://github.com/rahul-thakoor/embedded-graphics-web-simulator), run:\n\n```sh\ncargo run --target wasm32-unknown-unknown -p specimen\n```\n\nIf you want it to recompile on changes, you can use `cargo-watch`:\n\n```sh\ncargo watch -x 'run --target wasm32-unknown-unknown -p specimen'\n```\n\nTo regenerate the font files for the ASCII charset from the sources:\n\n```sh\ncargo run -p generate-font -- --charset ascii\n```\n\nThis command loads the pngs for glyphs, and also extracts the kerning tables from the original source code (using [tree-sitter-elm](https://github.com/elm-tooling/tree-sitter-elm) to parse the Elm module). It then assembles the sprite atlas and generates the Rust code.\n\n# Font Design\n\nYou can find the source images in the `mogeefont/font` directory. All the glyphs are named according to the Unicode code points they represent. Ligaturues are named with mulitple code points separated by underscores.\n\nThe nix shell comes with [the rx pixel editor](https://rx.cloudhead.io), which can be used to edit glyph images. It only supports 8-bit RGBA PNGs, so you may need to convert the images to this format before editing them with `mogrify`:\n\n```sh\nmogrify -depth 8 -define png:color-type=6 mogeefont/font/*.png\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw0rm%2Fembedded-mogeefont","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw0rm%2Fembedded-mogeefont","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw0rm%2Fembedded-mogeefont/lists"}