microsoft/Terminal

Refactor `_GetProposedFont` into a static function

開放

#11,763 建立於 2021年11月15日

 (2 則留言) (0 個反應) (0 位負責人)C++ (9,275 個分叉)batch import
Area-CodeHealthArea-PerformanceHelp WantedIssue-TaskPriority-2Product-Terminal

倉庫指標

星標
 (103,173 顆星)
PR 合併指標
 (平均合併 27天 19小時) (30 天內合併 24 個 PR)

描述

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.

貢獻者指南