function conformsToReference(font, criterion)
{
    for (const [ key, value ] of Object.entries(criterion)) {
        switch (key) {
            case 'family': {
                if (trim(font[key]) !== value) {
                    return false;
                }
                break;
            }

            case 'weight': {
                /**
                 * Note concerning font weights:
                 * Loose equality (`==`) is used to compare numeric weights,
                 * a number (`400`) and a numeric string (`"400"`).
                 * Comparison between numeric and keyword values is neglected.
                 *
                 * @link https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping
                 */
                if (font[key] != value) {
                    return false;
                }
                break;
            }

            default: {
                if (font[key] !== value) {
                    return false;
                }
                break;
            }
        }
    }

    return true;
}
Determines if the given font matches the given `FontFaceReference`.

@param {FontFace}          font      - The font to inspect.
@param {FontFaceReference} criterion - The object of property values to match.

@returns {boolean}