Skip to content

[css-font-loading] [info discovery] Named instances should be discoverable too #6599

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

Open
litherum opened this issue Sep 10, 2021 · 3 comments

Comments

@litherum
Copy link
Contributor

litherum commented Sep 10, 2021

Currently, there are no facilities to expose named instances. At least being able to list them would seem valuable, as there's a font-named-instance descriptor which accepts these strings. We may want to go farther and actually describe their definitions, too.

@litherum
Copy link
Contributor Author

litherum commented Sep 10, 2021

I guess we could start with

interface FontFaceNamedInstance {
    readonly attribute DOMString name;
    /* Maybe more here in the future. For now, just the name. */
};

interface FontFaceNamedInstances {
    readonly setlike<FontFaceNamedInstance>;
};

partial interface FontFaceVariations {
    readonly attribute FontFaceNamedInstances namedInstances;
};

If the strings are localized (I think they are but I'm not sure), we'd have to deal with #6595 as well.

@litherum
Copy link
Contributor Author

Thinking about #6600, we may also want to expose information about members of a collection. There isn't much philosophically different between named instances and members in a collection (aside from the mechanisms they use internally).

@litherum
Copy link
Contributor Author

litherum commented Sep 10, 2021

Maybe what we actually want is something like

interface FontFaceNamedInstance {
    readonly attribute DOMString name;
    /* Maybe more here in the future. For now, just the name. */
};

interface FontFaceNamedInstances {
    readonly setlike<FontFaceNamedInstance>;
};

interface FontFaceCollectionMembers {
    maplike<DOMString, FontFace> members;
};

interface FontFaceCollection {
    /* It's expected that only one of these will have contents */
    readonly attribute FontFaceNamedInstances namedInstances;
    readonly attribute FontFaceCollectionMembers collectionMembers;
};

partial interface FontFace {
    readonly attribute FontFaceCollection collection;
};

Or maybe even something like this instead:

interface FontFaceMembers {
    setlike<DOMString>;
};

interface FontFaceCollection {
    /* It's expected that only one of these will have contents */
    readonly attribute FontFaceMembers namedInstances;
    readonly attribute FontFaceMembers collectionMembers;
};

partial interface FontFace {
    readonly attribute FontFaceCollection collection;
};

Or maybe even just:

partial interface FontFace {
    // Returns the union of collection member names and named instances names
    readonly sequence<DOMString> collectionMembers();
};

... Or maybe even reuse FontFaceSet?

partial interface FontFace {
    readonly attribute FontFaceSet collection;
}

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

No branches or pull requests

1 participant