Skip to content
Myr

fcft: update to 1.0.0

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

Allow/disallow subpixel antialiasing in font_glyph_for_wc(), not using font_enable_subpixel_antialias().

authored by Daniel Eklöf · committed by Daniel Eklöf · parent c7a1a50 · Browse files · 4 files+13 added−14 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−14 removed

  • other:+13 added−14 removed

4 files+13 added−14 removed

modified:main.c-8 removed
360 unmodified lines
361362 if ((font = font_from_name(&(const char *){font_name}, 1, font_attrs)) == NULL)363 goto out;364365 /* Enable subpixel antialiasing only when BOTH background and366 * selection colors are opaque */367 if (render_options.background_color.a == 1.0 &&368 render_options.selection_color.a == 1.0)369 {370 font_enable_subpixel_antialias(font);371 }372365 LOG_DBG(366 "font: height: %d, ascent: %d, descent: %d",367 font->height, font->ascent, font->descent);368
56 unmodified lines
modified:meson.build+1 added-1 removed
24 unmodified lines
25wlroots = dependency('wlroots')26xkb = dependency('xkbcommon')2728tllist = dependency('tllist', version: '>=1.0.0', fallback: ['tllist', 'tllist'])29fcft = dependency('fcft', version: ['>=0.4.3', '<0.5.0'], fallback: ['fcft', 'fcft'])29fcft = dependency('fcft', version: ['>=1.0.0', '<2.0.0'], fallback: ['fcft', 'fcft'])3031wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')3233wscanner = dependency('wayland-scanner', native: true)
60 unmodified lines
modified:PKGBUILD+1 added-1 removed
4 unmodified lines
5arch=('x86_64')6url=https://codeberg.org/dnkl/fuzzel7license=(mit)8makedepends=('meson' 'ninja' 'scdoc' 'tllist>=1.0.0')9depends=('libxkbcommon' 'wayland' 'wlroots' 'cairo' 'librsvg' 'fcft>=0.4.3')9depends=('libxkbcommon' 'wayland' 'wlroots' 'cairo' 'librsvg' 'fcft>=1.0.0')10source=()1112pkgver() {13 cd ../.git &> /dev/null && git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
11 unmodified lines
modified:render.c+11 added-4 removed
113 unmodified lines
114115 const wchar_t *ptext = prompt_text(prompt);116 const size_t text_len = wcslen(ptext);117118 const bool subpixel_antialias =119 render->options.background_color.a == 1. &&120 render->options.selection_color.a == 1.;121122 int x = render->options.border_size + render->options.x_margin;123 int y = render->options.border_size + render->options.y_margin + font->ascent;124125 wchar_t prev = 0;126127 for (size_t i = 0; i < prompt_len + text_len; i++) {128 wchar_t wc = i < prompt_len ? pprompt[i] : ptext[i - prompt_len];125 const struct glyph *glyph = font_glyph_for_wc(font, wc);129 const struct glyph *glyph = font_glyph_for_wc(font, wc, subpixel_antialias);130 if (glyph == NULL) {131 prev = wc;132 continue;133 }
20 unmodified lines
154155static void156render_match_text(struct buffer *buf, double *_x, double _y,157 const wchar_t *text, ssize_t start, size_t length,154 struct font *font,158 struct font *font, bool subpixel_antialias,159 pixman_color_t regular_color, pixman_color_t match_color)160{161 int x = *_x;162 int y = _y;163164 for (size_t i = 0; i < wcslen(text); i++) {161 const struct glyph *glyph = font_glyph_for_wc(font, text[i]);165 const struct glyph *glyph = font_glyph_for_wc(font, text[i], subpixel_antialias);166 if (glyph == NULL)167 continue;168169 long x_kern = 0;
18 unmodified lines
188 const double y_margin = render->options.y_margin;189 const double border_size = render->options.border_size;190 const size_t match_count = matches_get_count(matches);191 const size_t selected = matches_get_match_index(matches);192 const bool subpixel_antialias =193 render->options.background_color.a == 1. &&194 render->options.selection_color.a == 1.;195196 assert(match_count == 0 || selected < match_count);197198 const double row_height = 2 * y_margin + font->height;
83 unmodified lines
282 /* Application title */283 render_match_text(284 buf, &cur_x, y,285 match->application->title, match->start_title, wcslen(prompt_text(prompt)),279 render->regular_font,286 render->regular_font, subpixel_antialias,287 render->options.pix_text_color, render->options.pix_match_color);288289 y += row_height;290 }
27 unmodified lines