Shell icon indicating copy to clipboard operation
Shell copied to clipboard

Glyphs in Strings (Segoe UI Variable font)

Open andreaxhearts opened this issue 1 year ago • 6 comments

  • You can already choose either the Segoe UI Fluent, Segoe MDL2 or NSS glyphs in each individual image property^1 - e.g. image.fluent(\u____) or image.glyph(0x____, #ffffff, 12, "Segoe MDL2 Assets").

  • Additionally, you can put an icon in a string by just putting \u____. For example, how one is used in terminal.nss for a tooltip, or how they can be used in a title,[^2] There doesn't seem to be a way to define a source (or color).

Either case, you replace the blank part in the unicode hex with that of the glyph you want to use. IDs can be found on the website[^3] (built-in glyphs, not Segoe font), Character Map, or by using a custom script: Icon Explorer.[^4]


//custom theme
theme
{
...

// image.glyph='Segoe Fluent Icons'
// font name for default glyph

...

font
{
size = 14
name = "Segoe UI Variable Text"
italic = 0
}

I tried changing the font for the theme, and that's where my confusion about glyphs came from. What's being used when in a string? Setting image.glyph to something in the theme didn't change this missing icon:

"Press SHIFT key to run Command Prompt as administrator". Tool tip message in Nilesoft's Terminal menu - with the missing "admin" icon being replaced with the square representing an undefined symbol.

What's the default font? Does Segoe UI Symbol usually get used here?

Would it be possible to be able to customize this font?

example : terminal.nss:

menu(type='*' where=(sel.count or wnd.is_taskbar or wnd.is_edit) title=title.terminal sep=sep.top image=icon.run_with_powershell)
{
	$tip_run_admin=["\xE1A7 Press SHIFT key to run " + this.title + " as administrator", tip.warning, 1.0]
	$has_admin=key.shift() or key.rbutton()
	
	item(title=title.command_prompt tip=tip_run_admin admin=has_admin image cmd-prompt=`/K TITLE Command Prompt &ver& PUSHD "@sel.dir"`)
	item(title=title.windows_powershell admin=has_admin tip=tip_run_admin image cmd-ps=`-noexit -command Set-Location -Path '@sel.dir'`)
	item(where=package.exists("WindowsTerminal") title=title.Windows_Terminal tip=tip_run_admin admin=has_admin image='@package.path("WindowsTerminal")\WindowsTerminal.exe' cmd="wt.exe" arg=`-d "@sel.path\."`)
}

example :

item(type="*" title="Icon Test \xE2B4" image=image.fluent(\uE171, 10) cmd=msg("\uE28C A Test..."))

[^2]: Discord: glyph in string [^3]: https://nilesoft.org/gallery/glyphs [^4]: Icon Explorer

andreaxhearts avatar Jul 10 '24 03:07 andreaxhearts

Additionally, you can put an icon in a string by just putting \u____. For example, how one is used in terminal.nss for a tooltip, or how they can be used in a title,2 There doesn't seem to be a way to define a source (or color).

Re: There doesn't seem to be a way to define a source The glyphs inside double quotes are sourced from the current display font. This evident from the 2nd reference you have given. I had used Shell's own font as base and was able to utilize it's glyphs inside double quotes. After setting it as display font of course. Re: (or color) Possibly because they are not interpreted as images by shell but as literal Unicode characters.

I tried changing the font for the theme, and that's where my confusion about glyphs came from. What's being used when in a string?

I have no idea why the glyph is not showing up. It's being displayed correctly at my end. image

To confirm if its an issue with Shell at your end you can try installing shell.ttf from here. Set it as the display font and use some glyphs in titles or tips to see if they show up or not.

ghost avatar Jul 10 '24 05:07 ghost

// image.glyph='Segoe Fluent Icons'
// font name for default glyph

This option exists, but it is not currently activated. I will try to activate it in the next update

moudey avatar Jul 10 '24 12:07 moudey

I was wondering if this is related to your issue at all? Can you give an update whether the glyphs are being rendered properly or not after installing the fonts manually?

ghost avatar Jul 27 '24 06:07 ghost

I have those four fonts installed. I was only missing Marlett and Back Button Icons before. No change there. I installed the Nilesoft Shell font you linked to as well. . . .

font
{
size = 14
name = "Segoe UI"
italic = 0
// good
}
font
{
size = 14
name = "Shell"
italic = 0
// good
}

Using any other fonts for the theme other than the above ones give missing glyphs for me.

I noticed I didn't include any operating system details in the op. I'm running Windows 10 Home x64, version 22H2 (build 19045.4651). Someone can test on Win 10 and see if it's normal or not for them too. I'm having computer trouble atm, otherwise I'd try a Win 11 vm on the nvme ssd I'd normally use.

andreaxhearts avatar Jul 28 '24 06:07 andreaxhearts

I finally got around to sorting this out. Turns out I was using the wrong font name. It's "Segoe UI Variable", and that's the name that shows up in Windows, too. No missing glyph.

Although… Each variant of the variable font family Segoe UI Variable does work under Windows 11 for nss with no issue. (Small, Text, Display)

I took the font file directly from the Windows 11 iso and installed on my system, so... idk btw there's a version 1.03 and a version 2.03 of the font. one is in the user fonts folder, and the other, in C:\Windows\Fonts. v1.03 is used for the tray clock in Win11! so… now you know that. no, it's completely irrelevant. :)

andreaxhearts avatar Sep 14 '24 06:09 andreaxhearts

Just a small note to clarify: Windows has a few ways to define the idea of a 'display font', it doesn't just come from one place. What we're looking for in this case is the MENU FONT. Evidentially I had changed it - and it wasn't until I intentionally reset & made the tweak recently that I noticed. I get how it works now. And all you have to do to is reset the menu font back to the Windows default if you find this happening. (maybe it was changed!)

winaero-tweaker-menufont

andreaxhearts avatar Sep 24 '24 08:09 andreaxhearts