-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Font Spec #4842
base: master
Are you sure you want to change the base?
Font Spec #4842
Conversation
This comment has been minimized.
This comment has been minimized.
|
||
If a user specifies a specific name such as : | ||
|
||
`winget fonts list --name 'Arial'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this support a substring match like winget list
? Can I do something like winget fonts list --name 'Nerd Font'
(display all nerd fonts installed on my system) or winget fonts list 'Italic'
(list out all italic fonts)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or also --version
, --exact
, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am thinking of creating an index in memory that we can use to better search the installed fonts like the examples you have above.
|
||
### Font File Types | ||
|
||
This feature will support font files with the following file types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From our talks, do we actually need to specify the file types that are supported? It seemed like we could support whatever font formats Windows supports with no additional work per-type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just for general knowledge, I don't plan to do anything different based on file type. Installation support will be based on the results from IdWriteFontFile::Analyze
doc/specs/#166 - Font Support.md
Outdated
--- | ||
|
||
### 1. Initial Validation | ||
Winget will check that `effectiveInstallerType == font` before kicking off the font installation flow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that this check is necessary. My expectation is that we:
- Have a separate source for fonts, marked as explicit
winget fonts install
is the same aswinget install -s winget-fonts
(or whatever the name of the source is).- The actual workflow is identical post source selection; the font installer type is not special.
The goal is logically separate fonts for our repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated spec to align with this. Made sure to call out that the workflow should not change post source selection.
doc/specs/#166 - Font Support.md
Outdated
|
||
`winget fonts uninstall --name 'Baskerville Old Face'` | ||
|
||
Winget will uninstall a font family with a single font face without any warnings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A warning should only be generated when the set of things being removed would be larger than the set of things requested to be removed. Specifying a single face might require removing multiple faces or families because they are all in the same file. This applies to all uninstall command permutations.
So generally:
- determine the set of files that back the target
- determine the set of faces that this will remove
- if there are faces outside of the target, warn and require --force
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated spec to align with above.
doc/specs/#166 - Font Support.md
Outdated
|
||
4. **Uninstalling a font face that shares the same font file as another font face:** | ||
|
||
`winget fonts uninstall --name 'Arial' --font-face 'Bold'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how this example and example 1 exist together. It doesn't seem like name has a consistent meaning across these commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that using a font family that includes the word 'face' was slightly confusing...
I've updated the arguments to more accurately reflect the difference between --family-name
and --face-name
This comment has been minimized.
This comment has been minimized.
From a PowerShell point of view are we thinking something like: WinGetFont as the Object type as opposed to a WinGetPackage? |
I would prefer not to have to create an entire COM and PowerShell interface that is 90% the same with different names. That does mean a slant mapping of faces to versions. But version can be used to describe different flavors of things, and faces of fonts are just versions of the primary theme. So it still fits, somewhat. |
> Font types will not be treated differently. Support for font installation will be determined by calling [IDWriteFontFile::Analyze](https://learn.microsoft.com/en-us/windows/win32/api/dwrite/nf-dwrite-idwritefontfile-analyze). | ||
|
||
### Installing Fonts | ||
Typically, a user would download the font file and drag it to the `C:\Windows\Fonts` directory in the explorer view, but there are a couple things happening behind the scenes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the drag and drop flow trigger the same endpoints as double clicking the file in File Explorer? Just trying to understand if all the current methods of installing fonts end up at the same place
|
||
|
||
## Manifest Changes | ||
- Addition of `font` to `installerType` and `nestedInstallerType` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way for the manifest to specify the font name and not just the path to it? Thinking of a use case where the file is something like ARandomFont.ttf
when it the name of the font is actually something like Really Awesome Font
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that the font files contain face and family metadata already and we are planning to always use that. If that is not always the case, then we do probably need a way to specify the name. The registry value names don't appear to have any actual impact on the enumerated fonts (from what I remember of @ryfu-msft investigation), but maybe they are important in the event that the file doesn't contain the relevant metadata.
|
||
If a user specifies a specific name such as : | ||
|
||
`winget fonts list --name 'Arial'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or also --version
, --exact
, etc.
|
||
### 1. Selection From Font Source | ||
Font source: | ||
There will be a separate source specifically for fonts. This source will be marked as explicit. The workflows following font source selection will be the same as if an executable package was selected. A user will be enter the following commands and experience the same behavior of installing a font. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this new source interact with the GPO for allowed / disallowed sources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question for @denelon
The new source was just my thought on how we would separate the data and keep the index size from growing. My expectation is that it would respect configured policy just the same, but the question is whether it would be in the umbrella of some existing controls or not (the one that controls the winget source for example).
|
||
## CLI Behavior / Implementation Details | ||
|
||
New Command: `winget fonts` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will there be any new GPO to prevent the installation of fonts, or uninstallation of specific fonts?
Thinking about how an enterprise could use a custom standard font for all of their branding / marketing and would want to ensure that users at the company can't uninstall it using WinGet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, how will this interact with existing Font GPOs, if at all?
Related to #166
Adds the initial font specification document. This outlines the planned implementation for supporting fonts. This will be updated to match the actual implementation.
Microsoft Reviewers: Open in CodeFlow