Re: [hackers] Announcing libschrift (a TrueType font rendering library)

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 19 Apr 2020 21:20:15 +0200

On Sun, Apr 19, 2020 at 04:47:24PM +0200, Thomas Oltmann wrote:
> Hello everybody.
>
> Last year at slcon6, I demo'd a toy TrueType font renderer (*) to a
> couple people.
> Someone there suggested it'd be really useful to have this as a proper
> library for suckless projects to use,
> and so after a complete rework to make it actually usable, I'm finally
> able to release it under the name libschrift!
> You can find it here: https://www.github.com/tomolt/libschrift
>
> What you'll notice is that, similar to other font rendering libraries,
> libschrifts API is very low-level;
> In future, I'll probably write a wrapper library that abstracts away
> most of this.
> For right now, there's at least an example/demo application called sftdemo.
> sftdemo shows how to use libschrift to render text to an X11 window
> completely without Xft or FreeType2.
> To do this, sftdemo uses the same underlying interface that Xft is
> also built upon.
>
> Still, you shouldn't use libschrift for anything serious quite yet.
> Most notably, compound glyph support is still missing,
> so some characters like Umlauts or accents will likely not work yet.
>
> As a proof of concept, I might at some point write a patch for dmenu
> (or something like it)
> that replaces all of its Xft / FreeType2 usage with libschrift.
>
> I can keep you all posted if you're interested.
>
> Cheers,
> Thomas Oltmann
>
>
> (*) For those wo don't know, a font renderer handles the low-level
> parts of displaying text.
> That entails parsing font files and using them to draw characters into
> bitmaps at runtime, which can then be displayed on the screen.
> Currently, all suckless applications (and in fact most applications in
> general) use FreeType2 for this, mostly via a wrapper API called Xft.
>

Hi,

It looks interesting. I think it's useful if you're using the drw.c interfaces
(as a wrapper) for this. It can be found in the libsl repo:

https://git.suckless.org/libsl/files.html

I've had a similar project based on a stripped-down/cleanup version of stb_truetype:
https://github.com/nothings/stb/blob/master/stb_truetype.h

It used the drw.c interfaces and worked with dwm, dmenu and sent.
Personally I lost some interest in working on this though.

Thanks for sharing,

-- 
Kind regards,
Hiltjo
Received on Sun Apr 19 2020 - 21:20:15 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 19 2020 - 21:24:37 CEST