microsoft / microsoft/terminal
Refactor `_GetProposedFont` into a static function
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
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
Research direction
Start by locating `_GetProposedFont` and the `DxEngine` code that currently calls it. Trace its uses of `dwriteFactory` and `_chainMode`, then assess how those values can become parameters without constructing the full renderer. Done means the font-size calculation is exposed as a static function and callers no longer need an entire DxEngine for it; the issue names no tests to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100