Path: blob/main/src/vs/editor/browser/config/domFontInfo.ts
3294 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { FastDomNode } from '../../../base/browser/fastDomNode.js';6import { BareFontInfo } from '../../common/config/fontInfo.js';78export function applyFontInfo(domNode: FastDomNode<HTMLElement> | HTMLElement, fontInfo: BareFontInfo): void {9if (domNode instanceof FastDomNode) {10domNode.setFontFamily(fontInfo.getMassagedFontFamily());11domNode.setFontWeight(fontInfo.fontWeight);12domNode.setFontSize(fontInfo.fontSize);13domNode.setFontFeatureSettings(fontInfo.fontFeatureSettings);14domNode.setFontVariationSettings(fontInfo.fontVariationSettings);15domNode.setLineHeight(fontInfo.lineHeight);16domNode.setLetterSpacing(fontInfo.letterSpacing);17} else {18domNode.style.fontFamily = fontInfo.getMassagedFontFamily();19domNode.style.fontWeight = fontInfo.fontWeight;20domNode.style.fontSize = fontInfo.fontSize + 'px';21domNode.style.fontFeatureSettings = fontInfo.fontFeatureSettings;22domNode.style.fontVariationSettings = fontInfo.fontVariationSettings;23domNode.style.lineHeight = fontInfo.lineHeight + 'px';24domNode.style.letterSpacing = fontInfo.letterSpacing + 'px';25}26}272829