9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Yaroslav K <yarikos@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Acme fonts
Date: Fri, 20 Nov 2020 21:31:24 +0000	[thread overview]
Message-ID: <95A50E88-1476-405A-8B01-3880FCDFE94D@gmail.com> (raw)
In-Reply-To: <CADSkJJXK2WwPLUkWm-uyvxoY_f7Dir60AbObPvDTtpMxash73w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3002 bytes --]



> On 22 Jul 2020, at 19:52, Russ Cox <rsc@swtch.com <mailto:rsc@swtch.com>> wrote:
> 
> On Tue, Jul 21, 2020 at 7:22 PM Anthony Martin <ality@pbrane.org <mailto:ality@pbrane.org>> wrote:
> Russ, what did you do to that poor little Acme?! ☺
> 
> Did you take the less daunting route using
> 
>  - a combined font file with shapes for normal, italic, bold, etc. and
>  - a filter to offset runes into "planes" for each font shape?
> 
> Yes, that's what I did. Completely awful - the text being displayed isn't usable as text. You can tell because when I double-click on the modified text acme doesn't know where the word boundaries are and ends up highlighting across punctuation that it normally wouldn't.
> 
> <Screen Shot 2020-07-21 at 2.59.23 PM.png>
> 
> I'd like to do something better at some point, but it's unclear exactly how.
> 

Inspired by the Russ'es hack, I figured there are official Unicode ranges <http://unicode.org/charts/PDF/Unicode-3.1/U31-1D400.pdf> for alternative font variants:, "to be used for mathematical variables where style variations are important semantically". The ranges are not properly aligned into "planes", and some of the ranges are disjoint, but hey, who said standards are well engineered.

So I wrote a bunch of tr's and came up with a script called tfont <https://9p.io/sources/contrib/yk/lab/fontmix/tfont> which translates an arbitrary text into a selected code point range.



Reverse translations back into ASCII are available through "|tfont R".

Macs have a decent fallback font mechanism but to have more control over the appearance we may plant subfont overrides similar to Russ'es but in the standard ranges. Take GoFont for example:



To make it easier to experiment with different font combinations and sizes, I made an awk script, fontmap.awk <https://9p.io/sources/contrib/yk/lab/fontmix/fontmix.awk>, which can be invoked like this:

        gofonts = (-v 'fR=GoRegular' -v 'fL=GoMono' -v 'fHB=Go-Bold' -v 'fHI=Go-Italic' -v 'fHX=Go-BoldItalic')
        awk -v 'vsz=16a' -v 'msz=14a' $gofonts -f fontmix.awk > regular.16.font

Being a standard unicode, the resulting text  text is suitable for transmission. See yourself:

𝙻       𝙷𝚎𝚕𝚕𝚘, 𝚠𝚘𝚛𝚕𝚍!
𝐁       𝐇𝐞𝐥𝐥𝐨, 𝐰𝐨𝐫𝐥𝐝!
𝗛𝗕      𝗛𝗲𝗹𝗹𝗼, 𝘄𝗼𝗿𝗹𝗱!
𝘏𝘐      𝘏𝘦𝘭𝘭𝘰, 𝘸𝘰𝘳𝘭𝘥!
𝙃𝙓      𝙃𝙚𝙡𝙡𝙤, 𝙬𝙤𝙧𝙡𝙙!

Depending on your system's font coverage your mileage may vary.

The scripts along with some generated font files are available under /n/sources/contrib/yk/lab/fontmix/ <https://9p.io/sources/contrib/yk/lab/fontmix/>.

Enjoy!

____
Yaroslav Kolomiiets
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T9673b88bfb3c3d3b-M9c3597711d577410b2e44d0a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2.1: Type: text/html, Size: 19419 bytes --]

[-- Attachment #2.2: tfont.png --]
[-- Type: image/png, Size: 167151 bytes --]

[-- Attachment #2.3: fontmap.png --]
[-- Type: image/png, Size: 239350 bytes --]

  parent reply	other threads:[~2020-11-20 21:32 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAA8EjDRkQDO+wL1tuTQ6GMxs7rqNji4qFM80F5Kz-H0UR24R4w@mail.gmail.com>
2020-07-21 23:21 ` Anthony Martin
2020-07-22 18:52   ` [9fans] " Russ Cox
2020-07-22 22:47     ` Charles Forsyth
2020-07-22 23:05       ` Rob Pike
2020-07-23  3:38         ` ori
2020-07-23  4:31           ` Rob Pike
2020-07-23  5:27     ` Lucio De Re
2020-07-23 13:08       ` Ethan Gardener
2020-11-20 21:31     ` Yaroslav K [this message]
2020-11-20 22:01       ` Stuart Morrow
2013-12-11 18:45 [9fans] Acme: fonts Blake McBride
2013-12-11 18:52 ` andrey mirtchovski
2013-12-11 19:05   ` Christopher Wilson
2013-12-11 19:12   ` Blake McBride
2013-12-11 19:15     ` erik quanstrom
2013-12-11 19:19       ` Christopher Wilson
2013-12-11 19:26     ` sl
2013-12-11 19:33       ` Rubén Berenguel
2013-12-11 19:50         ` Blake McBride
2013-12-11 19:53           ` Rubén Berenguel
2013-12-11 20:04             ` Blake McBride
2013-12-11 20:12               ` Rubén Berenguel
2013-12-11 20:26                 ` Mark van Atten
2013-12-11 20:03           ` sl
2013-12-11 20:06             ` erik quanstrom
2013-12-11 20:30               ` sl
2013-12-11 20:40                 ` erik quanstrom
2013-12-11 20:47                 ` Mark van Atten
2013-12-11 21:04                   ` sl
2013-12-11 20:15           ` Aram Hăvărneanu
2013-12-11 20:38             ` Blake McBride
2013-12-11 21:10               ` Blake McBride
2013-12-11 21:14                 ` andrey mirtchovski
2013-12-11 21:21                   ` Blake McBride
2013-12-11 21:25                     ` Blake McBride
2013-12-11 21:25                 ` Lyndon Nerenberg
2013-12-11 21:56                   ` Blake McBride
2013-12-11 22:00                     ` Lyndon Nerenberg
2013-12-11 22:05                     ` Blake McBride
2013-12-11 22:08                     ` Mark van Atten
2013-12-11 19:32 ` Oleksandr Iakovliev
  -- strict thread matches above, loose matches on Subject: below --
2003-10-14 12:17 [9fans] acme fonts David Presotto
2003-10-14 15:51 ` Rob Pike
2003-10-15  3:27   ` david presotto
2003-10-14 16:04 ` chris
2003-10-13 16:43 Fco.J.Ballesteros
2003-10-13 16:49 ` David Presotto
2003-10-13 16:56   ` Fco.J.Ballesteros
2003-10-13 19:02   ` vdharani
2003-10-13 19:35     ` Dan Cross
2003-10-14  8:09   ` Charles Forsyth
2003-10-14  8:13     ` Rob Pike
2003-10-14 11:17       ` David Presotto
2003-10-14 23:44       ` George Michaelson
2003-10-15  5:30         ` Charles Forsyth
2003-10-15 10:28           ` Brantley Coile
2003-10-14 19:36     ` vdharani
2003-10-15  5:40       ` Charles Forsyth
2003-10-14  0:04 ` rob pike, esq.
2003-10-15  7:29   ` Fco.J.Ballesteros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95A50E88-1476-405A-8B01-3880FCDFE94D@gmail.com \
    --to=yarikos@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).