9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Acme fonts
       [not found] <CAA8EjDRkQDO+wL1tuTQ6GMxs7rqNji4qFM80F5Kz-H0UR24R4w@mail.gmail.com>
@ 2020-07-21 23:21 ` Anthony Martin
  2020-07-22 18:52   ` [9fans] " Russ Cox
  0 siblings, 1 reply; 10+ messages in thread
From: Anthony Martin @ 2020-07-21 23:21 UTC (permalink / raw)
  To: Russ Cox; +Cc: 9fans

[cc -golang-nuts, +9fans]

> io/fs draft design
>  - Video: https://golang.org/s/draft-iofs-video

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?

Or did you modify Acme to support some sort of rich text mark-up?

Cheers,
  Anthony

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-07-21 23:21 ` Acme fonts Anthony Martin
@ 2020-07-22 18:52   ` Russ Cox
  2020-07-22 22:47     ` Charles Forsyth
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Russ Cox @ 2020-07-22 18:52 UTC (permalink / raw)
  To: 9fans


[-- Attachment #1.1: Type: text/plain, Size: 752 bytes --]

On Tue, Jul 21, 2020 at 7:22 PM Anthony Martin <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.

[image: 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.

Best,
Russ

[-- Attachment #1.2: Type: text/html, Size: 1240 bytes --]

[-- Attachment #2: Screen Shot 2020-07-21 at 2.59.23 PM.png --]
[-- Type: image/png, Size: 195304 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  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  5:27     ` Lucio De Re
  2020-11-20 21:31     ` Yaroslav K
  2 siblings, 1 reply; 10+ messages in thread
From: Charles Forsyth @ 2020-07-22 22:47 UTC (permalink / raw)
  To: 9fans


[-- Attachment #1.1: Type: text/plain, Size: 1323 bytes --]

Which films do not involve some sleight of hand to make the scene? I like
the io/fs suggestion.

On Wed, Jul 22, 2020 at 7:55 PM Russ Cox <rsc@swtch.com> wrote:

> On Tue, Jul 21, 2020 at 7:22 PM Anthony Martin <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.
>
> [image: 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.
>
> Best,
> Russ
>
>
> *9fans <https://9fans.topicbox.com/latest>* / 9fans / see discussions
> <https://9fans.topicbox.com/groups/9fans> + participants
> <https://9fans.topicbox.com/groups/9fans/members> + delivery options
> <https://9fans.topicbox.com/groups/9fans/subscription> Permalink
> <https://9fans.topicbox.com/groups/9fans/T9673b88bfb3c3d3b-M7d56ced3d248172b5763d6eb>
>

[-- Attachment #1.2: Type: text/html, Size: 2520 bytes --]

[-- Attachment #2: Screen Shot 2020-07-21 at 2.59.23 PM.png --]
[-- Type: image/png, Size: 195304 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-07-22 22:47     ` Charles Forsyth
@ 2020-07-22 23:05       ` Rob Pike
  2020-07-23  3:38         ` ori
  0 siblings, 1 reply; 10+ messages in thread
From: Rob Pike @ 2020-07-22 23:05 UTC (permalink / raw)
  To: 9fans

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

>
> *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.*


I don't understand that. Acme knows the characters' location or it couldn't
draw them. Are you sure it's not just the frame library's lousy handling of
italic fonts?

-rob

[-- Attachment #2: Type: text/html, Size: 615 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-07-22 23:05       ` Rob Pike
@ 2020-07-23  3:38         ` ori
  2020-07-23  4:31           ` Rob Pike
  0 siblings, 1 reply; 10+ messages in thread
From: ori @ 2020-07-23  3:38 UTC (permalink / raw)
  To: 9fans

> I don't understand that. Acme knows the characters' location or it couldn't
> draw them. Are you sure it's not just the frame library's lousy handling of
> italic fonts?

Unless I'm misunderstanding how this works, ',' (0x2c) gets mangled
to something like 0x10002c.

So, acme knows the location, but not the character types. That means
'foo,bar,baz' with a mangled ',' codepoint would treat ',' as a word
character instead of a separator. Double clicking within foo would
select [foo,bar,baz] rather than just foo.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-07-23  3:38         ` ori
@ 2020-07-23  4:31           ` Rob Pike
  0 siblings, 0 replies; 10+ messages in thread
From: Rob Pike @ 2020-07-23  4:31 UTC (permalink / raw)
  To: 9fans

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

I see, yes. Well, that's not too terrible.

-rob


On Thu, Jul 23, 2020 at 1:40 PM <ori@eigenstate.org> wrote:

> > I don't understand that. Acme knows the characters' location or it
> couldn't
> > draw them. Are you sure it's not just the frame library's lousy handling
> of
> > italic fonts?
>
> Unless I'm misunderstanding how this works, ',' (0x2c) gets mangled
> to something like 0x10002c.
>
> So, acme knows the location, but not the character types. That means
> 'foo,bar,baz' with a mangled ',' codepoint would treat ',' as a word
> character instead of a separator. Double clicking within foo would
> select [foo,bar,baz] rather than just foo.
>
>
> ------------------------------------------
> 9fans: 9fans
> Permalink:
> https://9fans.topicbox.com/groups/9fans/T9673b88bfb3c3d3b-Ma1bbc7a36aef69605f5b4f10
> Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
>

[-- Attachment #2: Type: text/html, Size: 1555 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-07-22 18:52   ` [9fans] " Russ Cox
  2020-07-22 22:47     ` Charles Forsyth
@ 2020-07-23  5:27     ` Lucio De Re
  2020-07-23 13:08       ` Ethan Gardener
  2020-11-20 21:31     ` Yaroslav K
  2 siblings, 1 reply; 10+ messages in thread
From: Lucio De Re @ 2020-07-23  5:27 UTC (permalink / raw)
  To: 9fans

On 7/22/20, Russ Cox <rsc@swtch.com> wrote:
> On Tue, Jul 21, 2020 at 7:22 PM Anthony Martin <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.

Remembering a discussion on 9fans where I suggested that capital
letters ought to be a different font, not a unique glyph (Russian, for
example, I believe just changes the font size, which we know is a
different font), I think Russ's is an excellent solution, given those
8 bits between 24 and 32 that one can abuse for the purpose.

It does mean that acme needs some way to extend its grasp of
delimiters into the extended fonts. Solving that without resorting to
a total separation between input and rendering, would be a winner, but
I am not competent enough to know if it is even remotely possible.

Incidentally, I opted for a tag line that looks like this:

     "... Snarf Undo Put  |Fmt |q |f78 look |b |e Font"

where I use "b" and "e" /bin commands to generate time stamps in my
"notepad" document. The details don't seem worth going into, "q", if I
remember right, is straight out of Russ's $home/bin/rc from years back
(with "g" which I have yet to enhance correctly to work on ".go"
directories). I got my inspiration remembering that a friend and
colleague (Windows user) adopted single letter command for all sorts
of shortcuts he memorised and even changed in different contexts.

The temptation to add a vertical edge to each acme window with a
single letter in little blocks - lower case and possibly capitals - is
only resisted by my reluctance to tackle a task I may not be
sufficiently competent to complete.

And for other ".go" developers, how many of you have found renaming a
module from ".go" to ".no" a practical approach to get it,
temporarily, perhaps, out of the way of the compiler?

Lucio.

PS: Sorry about the off-topic diversion. I do happen to be marvelling
over fonts among many other distractions from my day job. I still
don't quite have a proper understanding, so I get odd results when I
try to do anything creative,  but not everything is a failure,
thankfully.

PPS: Like Forsyth, I like the io/fs idea. I like "generics" a lot
less, and I find go modules (sorry, Russ) quite incomprehensible
<sigh!>.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-07-23  5:27     ` Lucio De Re
@ 2020-07-23 13:08       ` Ethan Gardener
  0 siblings, 0 replies; 10+ messages in thread
From: Ethan Gardener @ 2020-07-23 13:08 UTC (permalink / raw)
  To: 9fans

On Thu, Jul 23, 2020, at 6:27 AM, Lucio De Re wrote:
> 
> It does mean that acme needs some way to extend its grasp of
> delimiters into the extended fonts.

How about just masking off the top few bits when checking for delimiters? Not really a clean solution, but certainly simple. It would mean some long numbers in subfont files. If we use the top 4 bits:
    0x10000000 0x1000001f /mnt/font/MyriadPro-It/36a/x0000.bit
That doesn't look as bad as I thought it would.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-07-22 18:52   ` [9fans] " Russ Cox
  2020-07-22 22:47     ` Charles Forsyth
  2020-07-23  5:27     ` Lucio De Re
@ 2020-11-20 21:31     ` Yaroslav K
  2020-11-20 22:01       ` Stuart Morrow
  2 siblings, 1 reply; 10+ messages in thread
From: Yaroslav K @ 2020-11-20 21:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- 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 --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [9fans] Acme fonts
  2020-11-20 21:31     ` Yaroslav K
@ 2020-11-20 22:01       ` Stuart Morrow
  0 siblings, 0 replies; 10+ messages in thread
From: Stuart Morrow @ 2020-11-20 22:01 UTC (permalink / raw)
  To: 9fans

a.k.a. twitalics

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T9673b88bfb3c3d3b-Mebf727ef2c439ab357e56fe2
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-11-20 22:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAA8EjDRkQDO+wL1tuTQ6GMxs7rqNji4qFM80F5Kz-H0UR24R4w@mail.gmail.com>
2020-07-21 23:21 ` Acme fonts 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
2020-11-20 22:01       ` Stuart Morrow

9fans - fans of the OS Plan 9 from Bell Labs

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/9fans

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9fans 9fans/ http://inbox.vuxu.org/9fans \
		9fans@9fans.net
	public-inbox-index 9fans

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9fans


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git