Skip to content

Commit 96c35c2

Browse files
committed
[css-font-loading] Add IDL for discovery of information about a font
This is for w3c#520. The [resolution](w3c#520 (comment)) is: > RESOLVED: [add this functionality to] css-font-loading, level TBD I added this to level 3, because level 4 doesn't exist. If the editor prefers this go in a level 4, that's no problem. The GitHub thread hasn't come to a conclusion about what should go in the `FontFaceFeatures` interface, so I left it blank for now.
1 parent e28e900 commit 96c35c2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

css-font-loading-3/Overview.bs

+48
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,54 @@ Interaction with CSS’s ''@font-face'' Rule</h3>
427427
and <a>CSS-connected</a> to the ''@font-face''.
428428
(This will also remove the old and add the new {{FontFace}} objects from any <a>font sources</a> they appear in.)
429429

430+
<h3 id='discovery'>
431+
Discovery of information about a font</h3>
432+
433+
A {{FontFace}} object includes a variety of read-only information about the contents of the font file.
434+
435+
<xmp class="idl">
436+
interface FontFaceFeatures {
437+
/* The CSSWG is still discussing what goes in here */
438+
};
439+
440+
interface FontFaceVariationAxis {
441+
readonly attribute DOMString name;
442+
readonly attribute DOMString axisTag;
443+
readonly attribute double minimumValue;
444+
readonly attribute double maximumValue;
445+
readonly attribute double defaultValue;
446+
};
447+
448+
interface FontFaceVariations {
449+
readonly setlike<FontFaceVariationAxis>;
450+
};
451+
452+
interface FontFacePalette {
453+
iterable<DOMString>;
454+
readonly attribute unsigned long length;
455+
getter DOMString (unsigned long index);
456+
readonly attribute bool usableWithLightBackground;
457+
readonly attribute bool usableWithDarkBackground;
458+
};
459+
460+
interface FontFacePalettes {
461+
iterable<FontFacePalette>;
462+
readonly attribute unsigned long length;
463+
getter FontFacePalette (unsigned long index);
464+
};
465+
466+
partial interface FontFace {
467+
readonly attribute FontFaceFeatures features;
468+
readonly attribute FontFaceVariations variations;
469+
readonly attribute FontFacePalettes palettes;
470+
};
471+
</xmp>
472+
473+
Note: This read-only data is intended to help authors know which values are accepted by
474+
'font-feature-settings!!property',
475+
'font-variation-settings!!property',
476+
and ''@font-palette-values''.
477+
430478
<!--
431479
████████ ███████ ██ ██ ████████ ████████ ███ ██████ ████████ ██████ ████████ ████████
432480
██ ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██

0 commit comments

Comments
 (0)