Giter Club home page Giter Club logo

Comments (17)

DHowett avatar DHowett commented on May 24, 2024 1

Thanks for following up!

from terminal.

lhecker avatar lhecker commented on May 24, 2024 1

I'd like to apologize for not noticing the extra font face entry in your settings file. 😣
I'm glad however, that you were to able to resolve the issue!

from terminal.

zadjii-msft avatar zadjii-msft commented on May 24, 2024

Did you install that font for all users? Or just for your current user/? We've had persistent problems with fonts that aren't installed for all users 🀷

from terminal.

inglepriyanka148867 avatar inglepriyanka148867 commented on May 24, 2024

Ensure the custom fonts are correctly installed, restart the application, and verify font configuration settings.

from terminal.

ShaneLee-9 avatar ShaneLee-9 commented on May 24, 2024

Did you install that font for all users? Or just for your current user/? We've had persistent problems with fonts that aren't installed for all users 🀷

The problem I'm having is that I've selected font A, but Windows Terminal tells me can't find font B!

from terminal.

zadjii-msft avatar zadjii-msft commented on May 24, 2024

Could you share your settings.json file/?

from terminal.

lhecker avatar lhecker commented on May 24, 2024

@zadjii-msft I believe this occurs because they're using DxRenderer. It gets the font family from the font file here:

[[nodiscard]] std::wstring DxFontInfo::_GetFontFamilyName(const gsl::not_null<IDWriteFontFamily*> fontFamily,
std::wstring& localeName)
{
// See: https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nn-dwrite-idwritefontcollection
Microsoft::WRL::ComPtr<IDWriteLocalizedStrings> familyNames;
THROW_IF_FAILED(fontFamily->GetFamilyNames(&familyNames));
// First we have to find the right family name for the locale. We're going to bias toward what the caller
// requested, but fallback if we need to and reply with the locale we ended up choosing.
UINT32 index = 0;
BOOL exists = false;
// This returns S_OK whether or not it finds a locale name. Check exists field instead.
// If it returns an error, it's a real problem, not an absence of this locale name.
// https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritelocalizedstrings-findlocalename
THROW_IF_FAILED(familyNames->FindLocaleName(localeName.data(), &index, &exists));
// If we tried and it still doesn't exist, try with the fallback locale.
if (!exists)
{
localeName = L"en-us";
THROW_IF_FAILED(familyNames->FindLocaleName(localeName.data(), &index, &exists));
}
// If it still doesn't exist, we're going to try index 0.
if (!exists)
{
index = 0;
// Get the locale name out so at least the caller knows what locale this name goes with.
UINT32 length = 0;
THROW_IF_FAILED(familyNames->GetLocaleNameLength(index, &length));
localeName.resize(length);
// https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritelocalizedstrings-getlocalenamelength
// https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritelocalizedstrings-getlocalename
// GetLocaleNameLength does not include space for null terminator, but GetLocaleName needs it so add one.
THROW_IF_FAILED(familyNames->GetLocaleName(index, localeName.data(), length + 1));
}
// OK, now that we've decided which family name and the locale that it's in... let's go get it.
UINT32 length = 0;
THROW_IF_FAILED(familyNames->GetStringLength(index, &length));
// Make our output buffer and resize it so it is allocated.
std::wstring retVal;
retVal.resize(length);
// FINALLY, go fetch the string name.
// https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritelocalizedstrings-getstringlength
// https://docs.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritelocalizedstrings-getstring
// Once again, GetStringLength is without the null, but GetString needs the null. So add one.
THROW_IF_FAILED(familyNames->GetString(index, retVal.data(), length + 1));
// and return it.
return retVal;
}

The warning pops up if that family name does not match the font name in the settings.

This issue has been solved in two ways:

  • DxRenderer does not exist anymore. You can only use AtlasEngine in the latest builds.
  • #16821 refactored the way we emit renderer warnings, so this can't happen anymore.

@ShaneLee-9 As a workaround you can simply use AtlasEngine until 1.21 is released.

from terminal.

ShaneLee-9 avatar ShaneLee-9 commented on May 24, 2024

Could you share your settings.json file/?

Hi, this is my settings.json

settings.json

from terminal.

lhecker avatar lhecker commented on May 24, 2024

Now that you have AtlasEngine enabled, does the error go away? If it still happens for some reason, please feel free to temporarily use our Canary build (our nightly version): https://aka.ms/terminal-canary-installer

from terminal.

ShaneLee-9 avatar ShaneLee-9 commented on May 24, 2024

Now that you have AtlasEngine enabled, does the error go away? If it still happens for some reason, please feel free to temporarily use our Canary build (our nightly version): https://aka.ms/terminal-canary-installer

AtlasEngine enabled, but the problem persists!
I installed the Canary version (our nightly version)
1
2
3

from terminal.

lhecker avatar lhecker commented on May 24, 2024

Hmm... I see, that's surprising.

Can you please provide a link to the font so I can download it?

from terminal.

ShaneLee-9 avatar ShaneLee-9 commented on May 24, 2024

Hmm... I see, that's surprising.

Can you please provide a link to the font so I can download it?

https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/D2Coding.zip

from terminal.

lhecker avatar lhecker commented on May 24, 2024

Are you certain that this is the exact same font that you're using? It only contains an US English name which is "D2CodingLigature Nerd Font":
image

There's no mention of "FragmentMono". Do you have a different font installed which is called "FragmentMono"? If so, can you provide a download link for that font as well? I know that Fragment Mono exists, but there's no official "Nerd Font" variant for it.

"D2CodingLigature Nerd Font" does properly show up in Windows Terminal 1.19.10821.0 for me:
image

Selecting it doesn't result in any error messages for me either. If I manually enter "FragmentMono Nerd Font" the correct font name shows up in the error message:
image

from terminal.

ShaneLee-9 avatar ShaneLee-9 commented on May 24, 2024

Are you certain that this is the exact same font that you're using? It only contains an US English name which is "D2CodingLigature Nerd Font": image

There's no mention of "FragmentMono". Do you have a different font installed which is called "FragmentMono"? If so, can you provide a download link for that font as well? I know that Fragment Mono exists, but there's no official "Nerd Font" variant for it.

"D2CodingLigature Nerd Font" does properly show up in Windows Terminal 1.19.10821.0 for me: image

Selecting it doesn't result in any error messages for me either. If I manually enter "FragmentMono Nerd Font" the correct font name shows up in the error message: image

The root cause of my problem is that I installed the font "D2CodingLigature Nerd Font Mono" about a week ago. One day I removed "D2CodingLigature Nerd Font Mono" from my computer and installed "FragmentMono Nerd Font". Then I wanted to change my Terminal font to "FragmentMono Nerd Font". Termina then shows the above error message. It actually can't find the "D2CodingLigature Nerd Font Mono" that I used and deleted. After that, no matter what fonts I select in Terminal's settings, it will report that it can't find "D2CodingLigature Nerd Font Mono".

PixPin_2024-04-21_16-09-55

from terminal.

lhecker avatar lhecker commented on May 24, 2024

Oh no. I hope this doesn't mean that your font cache is corrupted. 😣

Can you please try this series of steps? My hope is that this brings the cache back into a good state:

  • Open %LOCALAPPDATA%\Microsoft\Windows\Fonts and check if the folder is empty. If it's not empty, open the Fonts control panel (search for "fonts" in the start menu):
    image
    Find and delete each corresponding font until the %LOCALAPPDATA%\Microsoft\Windows\Fonts folder is empty.
  • Download the D2CodingLigature font (https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/D2Coding.zip) again and install it for all users.
  • Uninstall both, your "D2CodingLigature Nerd Font" and "FragmentMono Nerd Font" fonts simultaneously.

Afterwards, reboot your PC and try installing the "D2CodingLigature Nerd Font" (for all users).

from terminal.

ShaneLee-9 avatar ShaneLee-9 commented on May 24, 2024

Oh no. I hope this doesn't mean that your font cache is corrupted. 😣

Can you please try this series of steps? My hope is that this brings the cache back into a good state:

  • Open %LOCALAPPDATA%\Microsoft\Windows\Fonts and check if the folder is empty. If it's not empty, open the Fonts control panel (search for "fonts" in the start menu):
    image
    Find and delete each corresponding font until the %LOCALAPPDATA%\Microsoft\Windows\Fonts folder is empty.
  • Download the D2CodingLigature font (https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/D2Coding.zip) again and install it for all users.
  • Uninstall both, your "D2CodingLigature Nerd Font" and "FragmentMono Nerd Font" fonts simultaneously.

Afterwards, reboot your PC and try installing the "D2CodingLigature Nerd Font" (for all users).

I tried reinstalling "D2CodingLigature Nerd Font Mono" and it didn't pop up again, but I have a new problem: I can't select any font. It looks like some program is locking up my Terminal fonts!
PixPin_2024-04-22_16-00-56

from terminal.

ShaneLee-9 avatar ShaneLee-9 commented on May 24, 2024

Oh, I seem to have found the reason. I don’t know when the font of Powershell was set separately in my terminal.
image
image

from terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.