Skip to content
Myr

render: use the width of 'o' instead of 'W' when calculating window width

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This gives a better estimate when a variable width font is used. 'W' is one of the widest characters (in most fonts at least...) meaning we almost always were able to fit close to twice as many characters, than specified in --width. Also update the documentation of '--width', to mention that it is an estimate when a variable width font is used. Closes #560

authored by Daniel Eklöf · committed by Daniel Eklöf · parent aa29ae8 · Browse files · 4 files+13 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+13 added−5 removed

  • other:+13 added−5 removed

4 files+13 added−5 removed

modified:doc/fuzzel.1.scd+4 added-2 removed
217 unmodified lines
218 The (maximum) number of matches to display. This dictates the219 window height. Default: _15_.220221*-w*,*--width*222 Window width, in characters. Margins and borders not223 included. Default: _30_.222 Window width, in characters. Margins and borders not included. For223 variable width fonts this is an estimate, as the exact number of224 characters that will fit depends on which characters are being225 displayed. Default: _30_.226227*--tabs*=_COUNT_228 Number of spaces a tab is expanded to. Default: _8_.229
330 unmodified lines
modified:doc/fuzzel.ini.5.scd+4 added-2 removed
268 unmodified lines
269*lines*270 Number of matches to show. Default: _15_.271272*width*273 Window width, in characters. Border and margins are not included274 in this. Default: _30_.273 Window width, in characters. Margins and borders not included. For274 variable width fonts this is an estimate, as the exact number of275 characters that will fit depends on which characters are being276 displayed. Default: _30_.277278*tabs*279 Number of spaces a tab is expanded to. Default: _8_.280
351 unmodified lines
modified:CHANGELOG.md+4 added
61 unmodified lines
62 directories whose `Context` field is not `Application` or63 `Apps`. This is for performance reasons ([#553][553])64* Default down scaling filter changed from `lanczos3` to `box`65 ([#553][553]).66* Use the width of 'o' instead of 'W' when calculating the window67 width ([#560][560]).6869[560]: https://codeberg.org/dnkl/fuzzel/issues/560707172### Deprecated73### Removed74### Fixed75
924 unmodified lines
modified:render.c+1 added-1 removed
1562 unmodified lines
1563 render->dpi = dpi;1564 render->size_font_by_dpi = size_font_by_dpi;15651566 const struct fcft_glyph *W = fcft_rasterize_char_utf32(1567 font, U'W', render->subpixel);1567 font, U'o', render->subpixel);15681569 const unsigned x_margin = render->conf->pad.x * scale;1570 const unsigned y_margin = render->conf->pad.y * scale;1571 const unsigned inner_pad = render->conf->lines > 0
125 unmodified lines