Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji Presentation for Julia Logo #201

Open
mnemnion opened this issue Mar 9, 2024 · 6 comments
Open

Emoji Presentation for Julia Logo #201

mnemnion opened this issue Mar 9, 2024 · 6 comments
Labels
enhancement may be implemented as an enhancement need more info not sure what needs to be done to fix this

Comments

@mnemnion
Copy link

mnemnion commented Mar 9, 2024

add more glyphs? Well, perhaps if lots more people ask...

This is an "add more glyphs" feature request, yes.

In a thread on the Discourse the question was raised of which emoji is the most Julia-associated. I pointed out that your excellent font has the logo in the Private Use Area, albeit in monochrome, as is normal for anything but emoji.

What would be rather nice would be to add a full-color double-width emoji variation of the logo. This shouldn't be a new codepoint, but rather, a ligature of the existing logo with the emoji presentation selector. Typing this could be a bit of a challenge, but you could add print("\ue800\ufe0f") to the documentation, which would print it at the REPL, where it could then be copy-pasted at leisure.

Something to consider, I hope. I know that I'd use it.

@cormullion
Copy link
Owner

add more glyphs? Well, perhaps if lots more people ask...

This is an "add more glyphs" feature request, yes.

I must edit that to read "monochrome" 😂

I'll investigate this. Last time I looked, colored glyph support was a bit of a mess, with multiple competing formats and spotty support from browsers and applications. But it's been a few years, so perhaps the formats and support situation has improved since then.

@cormullion cormullion added enhancement may be implemented as an enhancement need more info not sure what needs to be done to fix this labels Mar 9, 2024
@mnemnion
Copy link
Author

Colored fonts are reasonably well supported at this point in time, thanks to emoji. One of the nice things about the emoji presentation selector is that renderers which don't support it will fall back to the monochrome glyph.

I know little about fontography, but three colored dots without any detail or gradients is about the least demanding emoji possible. And I know that OpenType supports SVG fonts, so "define ligature on variation selector, drop SVG of Julia logo in the font" might be all it takes if SVG in fonts is sufficiently well-supported. If not, bitmaps would work well for three circles, and support for the oldest color font formats is practically speaking ubiquitous now.

Whatever you decide is of course fine. I'll also just add that "the Julia font has one color glyph, the Julia logo, and will not be adding more" is a defensible position to take. In case you're concerned about letting the camel's nose into the tent.

@cormullion
Copy link
Owner

It's easy enough to add, fortunately. Initial results are mixed. I think the idea is that the colored version is shown automatically if present (no selector required).

Success in Terminal and iTerm (MacOS):

Terminal:

Screenshot 2024-03-10 at 10 17 13

iTerm:

Screenshot 2024-03-10 at 10 20 20

iTerm:

Screenshot 2024-03-10 at 10 31 48

WezTerm: No response in WezTerm, which is concerning, since the font support is usually great:

Screenshot 2024-03-10 at 10 28 49

Well-behaved Mac apps are happy to automatically show a colored version:

Cot Editor (left) and Pages:

Screenshot 2024-03-10 at 10 29 57

But VS-Code unfortunately doesn't do a good job:

Screenshot 2024-03-10 at 10 18 48

seeming to default to black if a colored glyph is detected in the font...?

If you want to have a go yourself, here are three TTF fonts with the colored version of E800 added:

Archive.zip

@mnemnion
Copy link
Author

It's easy enough to add, fortunately. Initial results are mixed. I think the idea is that the colored version is shown automatically if present (no selector required).

I installed the patched fonts, the idea here is that '\ue800' becomes the colorful version of the font? Valid choice, the suggestion of a ligature with the emoji presentation selector was that the base glyph could stay as-is, and with the selector would be in color (and ideally double-width like an emoji). Not attached to that idea, just explaining what I meant by it.

Can confirm: shows up in iTerm, still black and white in WezTerm, displays fine in random Mac-native programs like TextEdit. In Sublime Text... at the moment Sublime Text hard-crashes when I try to open settings or the font selector, that's what I get for running the dev build.

VSCode renders it just fine, in color, in both the editor and the terminal. I use a dark mode for both, and the text is still white on dark, the icon shows up in color in both places. VSCode 1.87.0 on macOS.

WezTerm (my daily driver) uses HarfBuzz, the rendering is more likely to be an issue with how WezTerm configures it than an inability of HarfBuzz to render, support looks fairly complete.

I didn't go maximalist on trying it out, but wasn't able to find a program where it wouldn't render at all. Emoji-sized would be nice to have, simply so it renders the same size as other emoji, I have a tendency to use them in terminal programs for icons. But yeah looks good ^_^.

@cormullion
Copy link
Owner

cormullion commented Mar 11, 2024

Thanks for doing some testing - I was mistaken about VSCode, I think, because after some updates and restarts it works fine in the xterm.js terminal.

I didn't get into the emoji presentation selector business; I'm not sure quite how it works, whether it's possible to define "one's own emojis" (I see references to emoji "lists") and how to use/define selectors in a font. Perhaps I'll be able to find some more information about how other fonts implement it, but emoji handling is a deep rabbit-hole and much of the discussion is way over my head... Perhaps one day.

Although applications and terminal emulators often handle and combine emojis and different width characters from various fonts well (mostly), I think it's standard practice to ensure that every glyph in a monospaced font is the same width; I've seen reports of some fonts that don't pass some checks and therefore fail to be treated as monospace. This is another font-related rabbit-hole - which I won't be able to investigate at present ... :)

@mnemnion
Copy link
Author

That's something I wouldn't have known about monospaced fonts. Naively, I assumed that a monospaced meant that you can have single width and double width characters, but the double width have to be precisely double the single width, and the single width all have to be one size.

Regardless, it's your project, and I wouldn't want you to think I have any expectations of you here. I think the colored dot Julia logo looks great, I hope you consider adding it to a release at some point. Have a great week ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement may be implemented as an enhancement need more info not sure what needs to be done to fix this
Projects
None yet
Development

No branches or pull requests

2 participants