diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index 427df7cd3d8f1..7b49f5b0deafe 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -94,6 +94,10 @@ class MinimapOptions { public readonly minimapCharWidth: number; public readonly sectionHeaderFontFamily: string; public readonly sectionHeaderFontSize: number; + /** + * Space in between the characters of the section header (in CSS px) + */ + public readonly sectionHeaderLetterSpacing: number; public readonly sectionHeaderFontColor: RGBA8; public readonly charRenderer: () => MinimapCharRenderer; @@ -139,6 +143,7 @@ class MinimapOptions { this.minimapCharWidth = Constants.BASE_CHAR_WIDTH * this.fontScale; this.sectionHeaderFontFamily = DEFAULT_FONT_FAMILY; this.sectionHeaderFontSize = minimapOpts.sectionHeaderFontSize * pixelRatio; + this.sectionHeaderLetterSpacing = minimapOpts.sectionHeaderLetterSpacing; // intentionally not multiplying by pixelRatio this.sectionHeaderFontColor = MinimapOptions._getSectionHeaderColor(theme, tokensColorTracker.getColor(ColorId.DefaultForeground)); this.charRenderer = createSingleCallFunction(() => MinimapCharRendererFactory.create(this.fontScale, fontInfo.fontFamily)); @@ -196,6 +201,7 @@ class MinimapOptions { && this.minimapLineHeight === other.minimapLineHeight && this.minimapCharWidth === other.minimapCharWidth && this.sectionHeaderFontSize === other.sectionHeaderFontSize + && this.sectionHeaderLetterSpacing === other.sectionHeaderLetterSpacing && this.defaultBackgroundColor && this.defaultBackgroundColor.equals(other.defaultBackgroundColor) && this.backgroundColor && this.backgroundColor.equals(other.backgroundColor) && this.foregroundAlpha === other.foregroundAlpha @@ -1788,6 +1794,7 @@ class InnerMinimap extends Disposable { private _renderSectionHeaders(layout: MinimapLayout) { const minimapLineHeight = this._model.options.minimapLineHeight; const sectionHeaderFontSize = this._model.options.sectionHeaderFontSize; + const sectionHeaderLetterSpacing = this._model.options.sectionHeaderLetterSpacing; const backgroundFillHeight = sectionHeaderFontSize * 1.5; const { canvasInnerWidth } = this._model.options; @@ -1798,7 +1805,8 @@ class InnerMinimap extends Disposable { const separatorStroke = foregroundFill; const canvasContext = this._decorationsCanvas.domNode.getContext('2d')!; - canvasContext.font = sectionHeaderFontSize + 'px ' + this._model.options.sectionHeaderFontFamily; + canvasContext.letterSpacing = sectionHeaderLetterSpacing + 'px'; + canvasContext.font = '500 ' + sectionHeaderFontSize + 'px ' + this._model.options.sectionHeaderFontFamily; canvasContext.strokeStyle = separatorStroke; canvasContext.lineWidth = 0.2; diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index fab223456feba..be4de9dc7c6db 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -3071,6 +3071,10 @@ export interface IEditorMinimapOptions { * Font size of section headers. Defaults to 9. */ sectionHeaderFontSize?: number; + /** + * Spacing between the section header characters (in CSS px). Defaults to 1. + */ + sectionHeaderLetterSpacing?: number; } /** @@ -3093,6 +3097,7 @@ class EditorMinimap extends BaseEditorOption { scale: 1, showRegionSectionHeaders: true, showMarkSectionHeaders: true, - sectionHeaderFontSize: 9 + sectionHeaderFontSize: 9, + sectionHeaderLetterSpacing: 1, }; options._write(EditorOption.minimap, minimapOptions); const scrollbarOptions: InternalEditorScrollbarOptions = { diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 7deb56947e189..ea2f3c43a06a7 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4318,6 +4318,10 @@ declare namespace monaco.editor { * Font size of section headers. Defaults to 9. */ sectionHeaderFontSize?: number; + /** + * Spacing between the section header characters (in CSS px). Defaults to 1. + */ + sectionHeaderLetterSpacing?: number; } /**