Bundled fonts affecting other unrelated software #14298

Closed
opened 2026-01-31 04:06:36 +00:00 by claunia · 7 comments
Owner

Originally created by @sparrowt on GitHub (Jun 22, 2021).

Windows Terminal version (or Windows build number)

1.9.1523.0

Other Software

Firefox 78.11.0esr (64-bit)

Steps to reproduce

Other applications (such as Firefox) are picking up Cascadia font files from under the Windows Terminal directory in WindowsApps despite the font not being installed system-wide (no results for "cascadia" in windows settings > Fonts).

I noticed this only because Stack Overflow code snippets started rendering with italic/cursive fonts, which led me to investigate which font was used and discover that Firefox was loading Cascadia (italic variant for some reason?!) possibly due to corruption of the non-italic version (possibly linked to https://github.com/microsoft/terminal/issues/9375) e.g:
image
but even ignoring the issue of why it's italic, the font bundled in WT should not be picked up by other apps as is not "installed".

Procmon shows this occurring:
image

The following font files exist bundled with the current version of WTP I have installed:

C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\Cascadia.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\CascadiaCodeItalic.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\CascadiaMonoItalic.ttf

as well as these from previous versions (not sure why so many are left behind...):

C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\Cascadia.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.5.3242.0_x64__8wekyb3d8bbwe\Cascadia.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.5.3242.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1445.0_x64__8wekyb3d8bbwe\CascadiaCodeItalic.ttf
C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1445.0_x64__8wekyb3d8bbwe\CascadiaMonoItalic.ttf

Expected Behavior

The inclusion of these fonts with Windows Terminal should not result in the font being used by other software, as if I had actually installed the font into Windows which I have not.

Actual Behavior

Other applications are served fonts from the Windows Terminal directory - procmon shows the stack in Firefox for example:

8	ntdll.dll	NtQueryInformationFile + 0x14	0x7ffa0b36d044	C:\Windows\System32\ntdll.dll
9	KernelBase.dll	GetFileInformationByHandle + 0x84	0x7ffa08a6df24	C:\Windows\System32\KernelBase.dll
10	DWrite.dll	File::TryOpen + 0x52	0x7ff9f039c5b2	C:\Windows\System32\DWrite.dll
11	DWrite.dll	File::TryOpen + 0x93	0x7ff9f039c517	C:\Windows\System32\DWrite.dll
12	DWrite.dll	DWriteFactory::OpenFontFile + 0x2b	0x7ff9f039c45b	C:\Windows\System32\DWrite.dll
13	DWrite.dll	LocalFileLoader::CreateFontFileStream + 0x131	0x7ff9f0358acd	C:\Windows\System32\DWrite.dll
14	DWrite.dll	LocalFileLoader::CreateStreamFromKey + 0x4b	0x7ff9f035890b	C:\Windows\System32\DWrite.dll
15	DWrite.dll	FontFileReference::GetStreamInternal + 0x64	0x7ff9f0373554	C:\Windows\System32\DWrite.dll
16	DWrite.dll	FontFaceConstructionTask::FontFaceConstructionTask + 0xac	0x7ff9f038a80c	C:\Windows\System32\DWrite.dll
17	DWrite.dll	FontFaceExtendedElementKey::CreateTask + 0x44	0x7ff9f038ad24	C:\Windows\System32\DWrite.dll
18	DWrite.dll	ElementTaskList::AddTask + 0x33	0x7ff9f0393ebf	C:\Windows\System32\DWrite.dll
19	DWrite.dll	IBaseCacheContextImpl::GetElementData + 0xb2	0x7ff9f0393db2	C:\Windows\System32\DWrite.dll
20	DWrite.dll	FontFace::FontFace + 0x2fd	0x7ff9f035ec95	C:\Windows\System32\DWrite.dll
21	DWrite.dll	DWriteFontFace::DWriteFontFace + 0x35	0x7ff9f035e319	C:\Windows\System32\DWrite.dll
22	DWrite.dll	DWriteFontFace::Create + 0xfc	0x7ff9f0378eb4	C:\Windows\System32\DWrite.dll
23	DWrite.dll	DWriteFont::CreateFontFace + 0xb3	0x7ff9f0378d43	C:\Windows\System32\DWrite.dll
24  xul.dll
...
Originally created by @sparrowt on GitHub (Jun 22, 2021). ### Windows Terminal version (or Windows build number) 1.9.1523.0 ### Other Software Firefox 78.11.0esr (64-bit) ### Steps to reproduce Other applications (such as Firefox) are picking up Cascadia font files from under the Windows Terminal directory in WindowsApps despite the font not being installed system-wide (no results for "cascadia" in windows settings > Fonts). I noticed this only because Stack Overflow code snippets started rendering with italic/cursive fonts, which led me to investigate which font was used and discover that Firefox was loading Cascadia (italic variant for some reason?!) _possibly_ due to corruption of the non-italic version (possibly linked to https://github.com/microsoft/terminal/issues/9375) e.g: ![image](https://user-images.githubusercontent.com/793763/122912488-4d244880-d350-11eb-9944-2cb9b4f6f50e.png) but even ignoring the issue of why it's italic, the font bundled in WT should not be picked up by other apps as is not "installed". Procmon shows this occurring: ![image](https://user-images.githubusercontent.com/793763/122911859-a475e900-d34f-11eb-9d98-f9df9b513ba3.png) The following font files exist bundled with the current version of WTP I have installed: ``` C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\Cascadia.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\CascadiaCodeItalic.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1523.0_x64__8wekyb3d8bbwe\CascadiaMonoItalic.ttf ``` as well as these from previous versions (not sure why so many are left behind...): ``` C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\Cascadia.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.5.3242.0_x64__8wekyb3d8bbwe\Cascadia.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.5.3242.0_x64__8wekyb3d8bbwe\CascadiaMono.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1445.0_x64__8wekyb3d8bbwe\CascadiaCodeItalic.ttf C:\Program Files\WindowsApps\Microsoft.WindowsTerminalPreview_1.9.1445.0_x64__8wekyb3d8bbwe\CascadiaMonoItalic.ttf ``` ### Expected Behavior The inclusion of these fonts with Windows Terminal should not result in the font being used by other software, as if I had actually installed the font into Windows which I have not. ### Actual Behavior Other applications are served fonts from the Windows Terminal directory - procmon shows the stack in Firefox for example: ``` 8 ntdll.dll NtQueryInformationFile + 0x14 0x7ffa0b36d044 C:\Windows\System32\ntdll.dll 9 KernelBase.dll GetFileInformationByHandle + 0x84 0x7ffa08a6df24 C:\Windows\System32\KernelBase.dll 10 DWrite.dll File::TryOpen + 0x52 0x7ff9f039c5b2 C:\Windows\System32\DWrite.dll 11 DWrite.dll File::TryOpen + 0x93 0x7ff9f039c517 C:\Windows\System32\DWrite.dll 12 DWrite.dll DWriteFactory::OpenFontFile + 0x2b 0x7ff9f039c45b C:\Windows\System32\DWrite.dll 13 DWrite.dll LocalFileLoader::CreateFontFileStream + 0x131 0x7ff9f0358acd C:\Windows\System32\DWrite.dll 14 DWrite.dll LocalFileLoader::CreateStreamFromKey + 0x4b 0x7ff9f035890b C:\Windows\System32\DWrite.dll 15 DWrite.dll FontFileReference::GetStreamInternal + 0x64 0x7ff9f0373554 C:\Windows\System32\DWrite.dll 16 DWrite.dll FontFaceConstructionTask::FontFaceConstructionTask + 0xac 0x7ff9f038a80c C:\Windows\System32\DWrite.dll 17 DWrite.dll FontFaceExtendedElementKey::CreateTask + 0x44 0x7ff9f038ad24 C:\Windows\System32\DWrite.dll 18 DWrite.dll ElementTaskList::AddTask + 0x33 0x7ff9f0393ebf C:\Windows\System32\DWrite.dll 19 DWrite.dll IBaseCacheContextImpl::GetElementData + 0xb2 0x7ff9f0393db2 C:\Windows\System32\DWrite.dll 20 DWrite.dll FontFace::FontFace + 0x2fd 0x7ff9f035ec95 C:\Windows\System32\DWrite.dll 21 DWrite.dll DWriteFontFace::DWriteFontFace + 0x35 0x7ff9f035e319 C:\Windows\System32\DWrite.dll 22 DWrite.dll DWriteFontFace::Create + 0xfc 0x7ff9f0378eb4 C:\Windows\System32\DWrite.dll 23 DWrite.dll DWriteFont::CreateFontFace + 0xb3 0x7ff9f0378d43 C:\Windows\System32\DWrite.dll 24 xul.dll ... ```
claunia added the Resolution-By-DesignNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 04:06:36 +00:00
Author
Owner

@LuanVSO commented on GitHub (Jun 24, 2021):

so, StackOverflow changed their default fonts earlier this year to match "platform defaults", that includes windows using Segoe ui for, well the ui and using Cascadia code for code blocks if it is available, falling back to consolas if not.
windows terminal registers the font with the os so that it is available to others programs to use, so this is expected behavior.

@LuanVSO commented on GitHub (Jun 24, 2021): so, StackOverflow changed their default fonts earlier this year to match "platform defaults", that includes windows using Segoe ui for, well the ui and using Cascadia code for code blocks if it is available, falling back to consolas if not. windows terminal registers the font with the os so that it is available to others programs to use, so this is expected behavior.
Author
Owner

@LuanVSO commented on GitHub (Jun 24, 2021):

it also shows up on font settings:
image

@LuanVSO commented on GitHub (Jun 24, 2021): it also shows up on font settings: ![image](https://user-images.githubusercontent.com/43626415/123338200-ca9db380-d51e-11eb-9dd1-88c21706e7fa.png)
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Jun 25, 2021):

I was curious about how this works, so:

https://github.com/microsoft/terminal/blob/2531454bcd46eadc14273ca85acc76231b8810cb/src/cascadia/CascadiaPackage/Package.appxmanifest#L140-L147

uap7:SharedFonts documentation says these fonts are shared with other apps.

I wonder whether the uap7:SharedFonts behavior is any different from uap4:SharedFonts.

@KalleOlaviNiemitalo commented on GitHub (Jun 25, 2021): I was curious about how this works, so: <https://github.com/microsoft/terminal/blob/2531454bcd46eadc14273ca85acc76231b8810cb/src/cascadia/CascadiaPackage/Package.appxmanifest#L140-L147> [uap7:SharedFonts](https://docs.microsoft.com/uwp/schemas/appxpackage/uapmanifestschema/element-uap7-sharedfonts) documentation says these fonts are shared with other apps. I wonder whether the uap7:SharedFonts behavior is any different from [uap4:SharedFonts](https://docs.microsoft.com/uwp/schemas/appxpackage/uapmanifestschema/element-uap4-sharedfonts).
Author
Owner

@sparrowt commented on GitHub (Jun 30, 2021):

Interesting, I didn't realise this was deliberate, thanks for clarifying!

When I filed the ticket I had tried searching and they weren't present in the modern settings UI:

no results for "cascadia" in windows settings > Fonts

However doing the same thing today I do see them (and I'm still on WTP 1.9.1523) so who knows what changed since then (a Windows update?) or whether I made an error at the time 🤷‍♂️

Either way, I guess this is "Not a bug" from your point of view given you are intending to share them. However due to the corruption of the installed copy which I experienced (thus causing Stack Overflow to fall back to the cursive version) - which may be related to the installation issues https://github.com/microsoft/terminal/issues/9375 et al - it's possibly not an ideal choice to install the font system-wide such that a corruption within WTP causes other apps to have broken fonts?

@sparrowt commented on GitHub (Jun 30, 2021): Interesting, I didn't realise this was deliberate, thanks for clarifying! When I filed the ticket I had tried searching and they weren't present in the modern settings UI: > no results for "cascadia" in windows settings > Fonts However doing the same thing today I do see them (and I'm still on WTP 1.9.1523) so who knows what changed since then (a Windows update?) or whether I made an error at the time 🤷‍♂️ Either way, I guess this is "Not a bug" from your point of view given you are intending to share them. However due to the corruption of the installed copy which I experienced (thus causing Stack Overflow to fall back to the cursive version) - which may be related to the installation issues https://github.com/microsoft/terminal/issues/9375 et al - it's possibly not an ideal choice to install the font system-wide such that a corruption within WTP causes other apps to have broken fonts?
Author
Owner

@DHowett commented on GitHub (Jul 6, 2021):

Yep--Terminal is currently the primary shipping vehicle for the Cascadia font family, and we opted to use the app package feature that shares our fonts with other applications. All stuff the folks before me covered in detail 😄

We've had so many problems with it thanks to the upgrade issues you mentioned that we would so love to pull back, but at this point with Visual Studio 2022 taking a dependency on it we're in a tight spot.

Fortunately, our friends over on the app platform team are keen to fix any installation corruption issues that come their way. I know it's not an excellent resolution, but... I consider it strictly better than the font disappearing for everyone who currently uses it, annoying though it may be when we ship app updates.

@DHowett commented on GitHub (Jul 6, 2021): Yep--Terminal is currently the primary shipping vehicle for the Cascadia font family, and we opted to use the app package feature that shares our fonts with other applications. All stuff the folks before me covered in detail :smile: We've had so many problems with it thanks to the upgrade issues you mentioned that we would so love to pull back, but at this point with Visual Studio 2022 taking a dependency on it we're in a tight spot. Fortunately, our friends over on the app platform team are keen to fix any installation corruption issues that come their way. I know it's not an excellent resolution, but... I consider it strictly better than the font disappearing for everyone who currently uses it, annoying though it may be when we ship app updates.
Author
Owner

@DHowett commented on GitHub (Jul 6, 2021):

(As well -- thanks for bringing this up! It's a good discussion for us to be having 😄)

@DHowett commented on GitHub (Jul 6, 2021): (As well -- thanks for bringing this up! It's a good discussion for us to be having :smile:)
Author
Owner

@sparrowt commented on GitHub (Aug 4, 2021):

with Visual Studio 2022 taking a dependency on it

As in VS 2022 will require you to have Terminal installed, purely in order to get a font which it provides? That seems... strange.

Nevertheless I understand the difficulty of going back given where things are, and thanks for explaining!

@sparrowt commented on GitHub (Aug 4, 2021): > with Visual Studio 2022 taking a dependency on it As in VS 2022 will require you to have Terminal installed, purely in order to get a font which it provides? That seems... strange. Nevertheless I understand the difficulty of going back given where things are, and thanks for explaining!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14298