mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-10 05:35:05 +08:00
When font-variation-settings don't match the one supported by relevant font faces, display a warning icon with warnings next to the font-variation-settings property in the Styles panel. Screenshot: https://i.imgur.com/JaHEvn1.png Bug: 971878 Change-Id: I19a83bc003c282e19585edeabe0650e43bc4a36a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2292280 Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> Reviewed-by: Changhao Han <changhaohan@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org>
30 lines
787 B
JavaScript
30 lines
787 B
JavaScript
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
export class CSSFontFace {
|
|
/**
|
|
* @param {!Protocol.CSS.FontFace} payload
|
|
*/
|
|
constructor(payload) {
|
|
this._fontFamily = payload.fontFamily;
|
|
this._fontVariationAxes = payload.fontVariationAxes || [];
|
|
/** @type {!Map<string, !Protocol.CSS.FontVariationAxis>} */
|
|
this._fontVariationAxesByTag = new Map();
|
|
for (const axis of this._fontVariationAxes) {
|
|
this._fontVariationAxesByTag.set(axis.tag, axis);
|
|
}
|
|
}
|
|
|
|
getFontFamily() {
|
|
return this._fontFamily;
|
|
}
|
|
|
|
/**
|
|
* @param {string} tag
|
|
*/
|
|
getVariationAxisByTag(tag) {
|
|
return this._fontVariationAxesByTag.get(tag);
|
|
}
|
|
}
|