Support font family picker in settings
See original GitHub issueCurrently our font pickers don’t know anything about system fonts:
By enabling and using the font access API we can provide suggestions for this which is really nice:
Unfortunately this doesn’t work well currently when syncing across machines and/or using font fallbacks as warnings will appear. For example this is valid on this machine but it throws an error:
I’ve tried a few things but none of them work:
- The
example
JSON schema property is what we’re after, optional suggestions, but we don’t seem to support it. - Using
pattern: '.*'
in combination withenum
still warns about not matching an enum value. - This works but is a bit hacky to avoid matching both
oneOf
values and it doesn’t show up in the settings UI.anyOf
doesn’t work:oneOf: [ { type: 'string', enum: fontFamilies, enumDescriptions: [`The system's default monospace font`], }, { type: 'string', pattern: `^(?!(${fontFamilies.join('|')})).*` } ]
Ideally any string value would be accepted and we would have a combobox in the settings editor to allow selecting from a dropdown or manual freeform entry.
@aeschli Am I interpreting example
correctly and could we update the schema parsing to support it?
@roblourens @rzhao271 If we support example
could we add a combobox renderer to the settings editor?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:19 (15 by maintainers)
Top GitHub Comments
Any update on this issue?
Yes, the settings editor would have to learn about this ‘pattern’ (anyOf with enum and string). Alternative would be to define it as
string
and usedefaultSnippets
to teach the editor about god proposals.This is something that should be easier for the settings editor to adopt.