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

Glyphs in Strings (Segoe UI Variable font) #480

Open
andreaxhearts opened this issue Jul 10, 2024 · 5 comments
Open

Glyphs in Strings (Segoe UI Variable font) #480

andreaxhearts opened this issue Jul 10, 2024 · 5 comments

Comments

@andreaxhearts
Copy link

  • You can already choose either the Segoe UI Fluent, Segoe MDL2 or NSS glyphs in each individual image property1 - 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 website3 (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..."))

Footnotes

  1. https://nilesoft.org/docs/functions/image

  2. Discord: glyph in string

  3. https://nilesoft.org/gallery/glyphs

  4. Icon Explorer

@ghost
Copy link

ghost commented Jul 10, 2024

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.

@moudey
Copy link
Owner

moudey commented Jul 10, 2024

// 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

@ghost
Copy link

ghost commented Jul 27, 2024

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?

@andreaxhearts
Copy link
Author

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 andreaxhearts changed the title Glyphs in Strings (and the Font) Glyphs in Strings (Segoe UI Variable font) Sep 14, 2024
@andreaxhearts
Copy link
Author

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants