Demo for the swash font library

Overview

Demo for the swash crate

See the swash repo or crate for the actual project.

This is a chunk of very rough code. It's essentially a packed up version of my own personal playground I've been using for testing swash throughout development. You will break it. It will crash. You are likely to be eaten by a grue.

It was tested most recently (as in, just before release) on a Mac. So you'll have the best luck there. It will probably work on Windows. I have no idea if it still works on Linux, but if not, feel free to file issues and I'll take a look. Linux hasn't received much focus as of yet, but I do consider it a priority platform for the project. (Note that swash itself has zero platform specific dependencies and works perfectly well on Linux or any other OS)

If you don't feel up to running it, or (more likely) it won't run, check out the swash_and_textedit.png screenshot in the repo root.

This currently requires OpenGL 4.1.

Usage

cargo run --release

Keys:

  • F1: toggle dark and light modes
  • F2: left align
  • F3: center align
  • F4: right align

If you're brave and really want to break it, basic editing does "work". Arrow keys, selection, cut, copy, paste, etc.

You might also like...
📜 A pci.ids-compliant library for getting information about available PCI devices.

aparato A pci.ids-compliant library for getting information about available PCI devices. Usage Add the following to your project's Cargo.toml file: ap

Notion Offical API client library for rust

Notion API client library for rust.

Rust library for program synthesis of string transformations from input-output examples 🔮

Synox implements program synthesis of string transformations from input-output examples. Perhaps the most well-known use of string program synthesis in end-user programs is the Flash Fill feature in Excel. These string transformations are learned from input-output examples.

Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else

Ointers is a library for representing pointers where some bits have been stolen so that they may be used by the programmer for something else. In effect, it's a small amount of free storage

SE3 Rust library for Robotics

Algebraic Robots A small Rust Library for SE3 Supported: Twist Screw SE3 Group se3 algebra Adjoint SE3 Twist Chains Wrenches Future plans: Jacobians V

A library and tool for automata and formal languages, inspired by JFLAP
A library and tool for automata and formal languages, inspired by JFLAP

Sugarcubes is a library and application for automata and formal languages. It is inspired by JFLAP, and is intended to eventually to be an alternative to JFLAP.

librdkafka - the Apache Kafka C/C++ client library

librdkafka - the Apache Kafka C/C++ client library Copyright (c) 2012-2020, Magnus Edenhill. https://github.com/edenhill/librdkafka librdkafka is a C

Rust library for emulating RISC-V rv32imac

This library can execute instructions against any memory and register file that implements the required primitives in the traits lib_rv32::traits::{Memory, RegisterFile}. This is to encourage usage with whatever frontend you desire.

Yet another ROS2 client library written in Rust
Yet another ROS2 client library written in Rust

RclRust Target CI Status Document Foxy (Ubuntu 20.04) Introduction This is yet another ROS2 client library written in Rust. I have implemented it inde

Comments
  • The scope of the unsafe block can be appropriately reduced

    The scope of the unsafe block can be appropriately reduced

    In this function you use the unsafe keyword for almost the entrie function body.

    We need to mark unsafe operations more precisely using unsafe keyword. Keeping unsafe blocks small can bring many benefits. For example, when mistakes happen, we can locate any errors related to memory safety within an unsafe block. This is the balance between Safe and Unsafe Rust. The separation is designed to make using Safe Rust as ergonomic as possible, but requires extra effort and care when writing Unsafe Rust.

    Hope this PR can help you. Best regards. References https://doc.rust-lang.org/nomicon/safe-unsafe-meaning.html https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html

    opened by cactter 0
  • Crashes on Linux (Wayland)

    Crashes on Linux (Wayland)

    Could be a missing dependency somewhere:

    Pixel format of the window's GL context: PixelFormat { hardware_accelerated: true, color_bits: 24, alpha_bits: 8, depth_bits: 24, stencil_bits: 8, stereoscopy: false, double_buffer: true, multisampling: None, srgb: false }
    OpenGL version 4.6 (Core Profile) Mesa 21.3.7
    thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', swash_demo/src/layout/layout.rs:253:37
    stack backtrace:
       0: rust_begin_unwind
                 at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/std/src/panicking.rs:498:5
       1: core::panicking::panic_fmt
                 at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:116:14
       2: core::panicking::panic
                 at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/panicking.rs:48:5
       3: core::option::Option<T>::unwrap
                 at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/option.rs:729:21
       4: swash_demo::layout::layout::<impl swash_demo::layout::Paragraph>::finish
                 at ./src/layout/layout.rs:253:9
       5: swash_demo::layout::builder::ParagraphBuilder::build_into
                 at ./src/layout/builder.rs:271:9
       6: swash_demo::main::{{closure}}
                 at ./src/main.rs:404:21
       7: winit::platform_impl::platform::sticky_exit_callback
                 at /home/speed/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:736:5
       8: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run_return
                 at /home/speed/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/wayland/event_loop/mod.rs:376:21
       9: winit::platform_impl::platform::wayland::event_loop::EventLoop<T>::run
                 at /home/speed/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/wayland/event_loop/mod.rs:191:9
      10: winit::platform_impl::platform::EventLoop<T>::run
                 at /home/speed/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/platform_impl/linux/mod.rs:652:56
      11: winit::event_loop::EventLoop<T>::run
                 at /home/speed/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.24.0/src/event_loop.rs:154:9
      12: swash_demo::main
                 at ./src/main.rs:77:5
      13: core::ops::function::FnOnce::call_once
                 at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a/library/core/src/ops/function.rs:227:5
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    opened by archseer 0
Owner
Chad Brokaw
Chad Brokaw
Basic Rust I2C demo on the TI Launchpad

msp430-i2c-oled-example An example project to talk to an SSD1306 OLED (Adafruit PiOLED) with an MSP430G2553 Launchpad via I2C.

Edward Shin 3 Jul 9, 2021
WIP demo project for pure rust playing nicely with MCUBoot/Infinitime OTA

pinetime-rust-mcuboot WIP demo project for pure rust playing nicely with MCUBoot/Infinitime OTA Firmware Behavior This is an example project so I just

David Boles 2 Jan 26, 2022
WasmEdge Hyper Demo.

WasmEdge Hyper Demo In this project, we demonstrate how to use hyper and tokio to build async http client in WebAssembly and execute it using WasmEdge

WasmEdge Runtime 23 Dec 29, 2022
Demo of tokio running on esp32 using esp-idf

Tokio running on esp32! This repo demonstrates a working hello world utilizing upstreamed tokio support for esp32. The tokio executor and I/O reactor

Josh Guilfoyle 9 Aug 7, 2023
Embedded demo based on esp32-c3

wot-esp-demo Demo Hygro-Thermometer based on the esp-rust-board. http version based on std-training Deploy Rust prerequisites Install espflash, ldprox

null 3 Dec 1, 2023
Rust library that can be reset if you think it's slow

GoodbyeKT Rust library that can be reset if you think it's slow

null 39 Jun 16, 2022
Simple library to host lv2 plugins. Is not meant to support any kind of GUI.

lv2-host-minimal Simple library to host lv2 plugins. Is not meant to support any kind of GUI. Host fx plugins (audio in, audio out) Set parameters Hos

Cody Bloemhard 11 Aug 31, 2022
Extreme fast factor expression & computation library for quantitative trading in Python.

Extreme fast factor expression & computation library for quantitative trading in Python.

Weiyuan Wu 22 Dec 8, 2022
Agent library for Internet Computer, in Dart

An agent library built for Internet Computer, a plugin package for dart and flutter apps. Developers can build ones to interact with Dfinity's blockchain directly.

null 87 Dec 31, 2022
Totally Speedy Transmute (TST) is a library providing a small, performance oriented, safe version of std::mem::transmute

Totally Speedy Transmute An evil spiritual successor to Totally Safe Transmute What is it? Totally Speedy Transmute (TST) is a library providing a sma

John Schmidt 19 Jun 7, 2022