microsoft/Terminal

Refactor `_GetProposedFont` into a static function

Offen

#11.763 geöffnet am 15.11.2021

 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (9.275 Forks)batch import
Area-CodeHealthArea-PerformanceHelp WantedIssue-TaskPriority-2Product-Terminal

Repository-Metriken

Stars
 (103.173 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 27T 19h) (24 gemergte PRs in 30 T)

Beschreibung

Ported from MSFT-21254947

With Dart/OpenConsole!3129098, I instantiate an entire DxEngine just to get the initial size of the control.

Turns out there's only two things that _GetProposedFont really needs from the instance - the dwriteFactory, and the _chainMode. If we make those params, then we could make GetProposedFont a public static function, and not need to instantiate an entire engine (including all the dx resources it needs) just to get the font size.

We should not be spinning up an entire DX Renderer to ask it how big a cell should be.

Contributor Guide