Conversation
Centralizes ANSI width measurement for shared sizing logic.
Provides candidate sorting with deterministic width or height priority.
Adds opt-in fit flags for sizing-based font selection and preview.
Adds opt-in fit flags for sizing-based font selection and preview.
|
interesting. this is certainly a cool idea. i'm just thinking if it's useful enough to merge to the main. what are you using this for yourself? |
|
@superstarryeyes I’m using this mainly in the context of my own projects, particularly a new format called neotex, which aims to make ANSI files easier to read without requiring a dedicated ANSI viewer: https://github.com/badele/neotex I’m also working on an ANSI compositor: https://github.com/badele/ansi-compositor The font-dimension matching feature is important for me because the compositor relies on precise width and height constraints to assemble ANSI content correctly. Being able to automatically find a font that satisfies those constraints simplifies the workflow and avoids manual adjustments. You can find examples in the repositories, including:
In short, this feature allows me to maintain consistent layout constraints across tools and ensures predictable rendering. I’ve switched the PR to draft mode so I can properly test the tool’s viability. This will allow me to provide you with more concrete feedback in the future. Would that be okay for you ? |
|
very interesting projects you have! take your time, draft mode i fine. |
This PR adds an optional fit mode to the CLI that ranks and previews fonts based on how closely their rendered output matches a target width and/or height, letting users quickly find the best font and scale for a desired dimension, with optional display of measured dimensions and distance to the target.