canvas_ity VS skrift

Compare canvas_ity vs skrift and see what are their differences.

skrift

A pure Ruby conversion (*not* wrapper) of the libschrift TrueType font renderer (by vidarh)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
canvas_ity skrift
7 4
318 9
- -
2.5 6.8
2 months ago 9 months ago
C++ Ruby
ISC License GNU General Public License v3.0 or later
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

canvas_ity

Posts with mentions or reviews of canvas_ity. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-01.
  • Writing a TrueType font renderer
    9 projects | news.ycombinator.com | 1 Jan 2024
    I have a small TTF implementation that's in the neighborhood of that size and is open source. It's part of my canvas_ity single-header library [0] that's around 2300 LOC / 36 KB object size and implements a C++ version of most of the 2D HTML5 canvas spec [1].

    The core implementation of the TTF parsing and drawing is in L1526-L1846 with another small bit at L3205-L3274 of src/canvas_ity.hpp.

    It's something of a toy implementation that only supports western left-to-right text, and doesn't do any hinting at all, nor kerning, nor shaping. But it's enough to draw a basic "Hello world!" using any typical TTF file.

    The test suite in test/test.cpp L84-304 embeds a few custom Base64-encoded TTF files. They're small and only have a few glyphs but they do exercise a number of interesting edge cases in the OpenType TTF spec [2]. Have a look at the HTML5 port of the test suite at test/test.html in different browsers to see how their canvas implementations render those fonts.

    [0] https://github.com/a-e-k/canvas_ity

    [1] https://www.w3.org/TR/2015/REC-2dcontext-20151119/

    [2] https://standards.iso.org/ittf/PubliclyAvailableStandards/c0...

  • The Lone Developer Problem
    3 projects | news.ycombinator.com | 27 Feb 2023
    Agreed, that sort of documentation is pure gold when done well.

    It's something I always try to pay forward by doing in my own code. For example, one of my own solo projects was an STB-style single-header -like rasterizer library for C++. I started the implementation half of the library with a short outline of the rendering pipeline's dataflow and the top-level functions responsible for each stage:

    https://github.com/a-e-k/canvas_ity/blob/f32fbb37e2fe7c0fcae...

  • Ask HN: What have you created that deserves a second chance on HN?
    44 projects | news.ycombinator.com | 26 Jan 2023
    https://github.com/a-e-k/canvas_ity

    This is an STB-style single-header C++ library with no dependencies beyond the standard C++ library. In about 2300 lines of 78-column code (not counting blanks or comments), or 1300 semicolons, it implements an API based on the basic W3C specification to draw 2D vector graphics into an image buffer:

    - Strokes and fills (with antialiasing and gamma-correct blending)

    - Linear and radial gradients

    - Patterns (with repeat modes and bi-cubic resampling)

    - Line caps and line joins (handling high curvature)

    - Dash patterns and dash offsets

    - Transforms

    - Lines, quadratic and cubic Beziers, arcs, and rectangles

    - Text (very basic, but does its own TTF font file parsing!)

    - Raster images (i.e., sprites)

    - Clipping (via masking)

    - Compositing modes (Porter-Duff)

    - Drop shadows with Gaussian blurs

    I also uncovered a number of interesting browser quirks along the way with the HTML5 port of my testing suite.

  • Hello, PNG
    13 projects | news.ycombinator.com | 18 Jan 2023
  • A tiny, single-header -like 2D rasterizer for C++
    1 project | news.ycombinator.com | 10 Oct 2022
  • canvas_ity - A tiny, single-header <canvas>-like 2D rasterizer
    2 projects | /r/cpp | 10 Oct 2022
    Repository: https://github.com/a-e-k/canvas_ity
  • Show HN: Canvas_ity – A tiny, single-header -like 2D rasterizer for C++
    1 project | news.ycombinator.com | 9 Oct 2022

skrift

Posts with mentions or reviews of skrift. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-01.
  • Writing a TrueType font renderer
    9 projects | news.ycombinator.com | 1 Jan 2024
    https://github.com/vidarh/skrift

    Libschrift is very readable.

    I did my Ruby rewrite basically just top to bottom before reorganizing it. Mine is... readable if you're well versed in Ruby, but still has some warts where it's less than idiomatic Ruby because I stuck closely to the original.

    Basically TTF has a crufty binary format, but the basic font data if you're willing to ignore ligatures, hinting, OpenType support and emoticons, is fairly simple (it's basically a bunch of polygons consisting of quadratic beziers and lines, and quadratic beziers are easy to tesselate into lines if you don't want to do a more complex curve renderer), just error-prone to figure out.

    If you want/need OpenType you need to support cubic beziers on top of that, which isn't that bad. If you want to support emoticons you need to support a subset of SVG (!)...

    So TTF without those bits is pretty much the halfway point.

    Also do look at the Canvas C++ header implementation linked in this comment[1]. It's readable, and more featureful than libschrift or my Ruby rewrite, and it's still small while packing a full rendering library in there not just the font renderer. I intend to pillage it (with credits) for ideas ;)

    [1] https://news.ycombinator.com/item?id=38839114

  • I Love Ruby
    12 projects | news.ycombinator.com | 18 Dec 2023
    I've put plenty of half-baked stuff out there over the years, so that doesn't really worry me. More that at the moment if you try to copy any of it the github repos are all at different stages of not quite up to date, and APIs are in flux, and you're just really likely to have a bad time trying to get anything to work.

    I think the real starting point for me is going to be to clean up PureX11 a bit more so the API is at least somewhat cohesive, and then push the WM as it's working enough that it's been my only wm for a few weeks (it does have significant quirks still, but with somewhat minor cleanups it's a decent starting point to play with), and then the terminal as it's fairly freestanding, then some of the file management tools, toolbar, popup menu etc., then lastly my editor. The editor has by far changed most from the version on Github and is also most likely to cause problems for others, so that might take a bit of time, not least because I'm in the middle of a fairly significant overhaul of the way the views and models works.

    Here's some of what is out there, though:

    * Skrift: This is a Ruby port of libschrift, a TTF font renderer. It's heavily cut down, and currently stands at about 680 lines of code. I intended to tidy up the API as it's still a bit messy after my rewrite: https://github.com/vidarh/skrift

    * X11 bindings for Skrift: https://github.com/vidarh/skrift-x11 - these are messy, and I have significant updates to them (including basic fontset support and a mechanism for pixel-perfect boxdrawing characters at any reasonable scale) that have not yet been pushed: https://github.com/vidarh/skrift-x11

    * Pure-X11: This is a form and significant overhaul of pure X11 client bindings for Ruby (as in not Xlib or XCB needed): https://github.com/vidarh/ruby-x11 - it's not terribly out of date, but it's a bit in flux as I don't like the initial mechanism, used for the protocol and so I'm thinking about how to trim it down and make it easier to use.

    * This is the starting point for my terminal. My terminal is nothing like that any more, but this is the repo that will get all the updates, eventually: https://github.com/vidarh/rubyterm - this initial prototype used a C extension and server-side fonts, while the current version uses Pure-X11 and Skrift

    * This was the very first version of my WM I used, a few hours into the switch (from bspwm). It's a straight port from TinyWM. My current one has tiling and some EWMH support and multiple desktops and adds about 700 lines of code - it'll start appearing on Github soon: https://gist.github.com/vidarh/1cdbfcdf3cfd8d25a247243963e55...

    * This is a script I used to feed into a 9menu style popup menu script from my file manager to generate folder-contextual actions based on the folder contents: https://gist.github.com/vidarh/323204137de5293bfe216ec751646... -- the current version is quite a bit slicker and will eventually show up

    * This is a very dated and broken version of my editor, and odds are you'll struggle to get it to work at all, as it depends on various helper scripts that are not yet packaged up, as have been massive updated since that version; I'm hoping to maybe bring the repo a bit more up to date over the holidays: https://github.com/vidarh/re

    * This is a gem that handles the input processing: https://github.com/vidarh/termcontroller

    * This does keyboard mapping from symbols from termcontroller to higher level user-defined sequences:

  • Write Your Own Terminal
    9 projects | news.ycombinator.com | 10 Nov 2023
    No current version, but I'm preparing it. But actually, to see a really ridiculously minimalist start, this was my starting point, which used a tiny X extension to do the X rendering (though it optimistically included a dummy class intended to be the start for the Ruby X backend). It's awfully limited, and awfully broken, but it shows how little it takes to be able to start writing:

    https://github.com/vidarh/rubyterm

    It's totally useless for anything other that testing or expanding on, but it was the starting point for the terminal I now run every day, and I'll be updating that repo as I clean up my current version at some point.

    The current version uses this for a pure Ruby (no Xlib) X11 client implementation:

    https://github.com/vidarh/ruby-x11

    And this pure-Ruby TrueType font renderer (I did the Ruby conversion; the C code it's based on was not mine, and is a beautiful example of compact C - look up libschrift):

    https://github.com/vidarh/skrift

What are some alternatives?

When comparing canvas_ity and skrift you can also consider the following projects:

nanovgXC - Lightweight vector graphics library implementing exact-coverage antialiasing in OpenGL

bubbleos

tinf - Tiny inflate library (inflate, gzip, zlib)

rouge-gtk_theme_loader - Load GtkSourceView themes into Rouge (Ruby syntax highlighter)

Tephra - A modern, high-performance C++17 graphics and compute library based on Vulkan

crt - Minimal terminal emulator for Bubbletea.

art - @Bigfan/art is a React custom renderer for HTML5 Canvas.

ruby-x11 - Pure Ruby implementation of the X Window System Protocol

osxphotos - Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.

skrift-x11 - Pure X11 integration for the pure Ruby "Skrift" TrueType engine

fpng - Super fast C++ .PNG writer/reader

keyboard_map - A small Ruby gem to map keyboard escape sequences