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
Provenance
- Commit
6a9fd86- Tree
5991acf- Author
Daniel Eklöf <daniel@ekloef.se>- Committer
Daniel Eklöf <daniel@ekloef.se>- Parent
c7a1a50
4 files changed+13 added−14 removed
modified:main.c-8 removed
360 unmodified lines361 362 if ((font = font_from_name(&(const char *){font_name}, 1, font_attrs)) == NULL)363 goto out;364 365- /* 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- }372-365 LOG_DBG(366 "font: height: %d, ascent: %d, descent: %d",367 font->height, font->ascent, font->descent);368 56 unmodified linesmodified:meson.build+1 added-1 removed
24 unmodified lines25 wlroots = dependency('wlroots')26 xkb = dependency('xkbcommon')27 28 tllist = dependency('tllist', version: '>=1.0.0', fallback: ['tllist', 'tllist'])29-fcft = dependency('fcft', version: ['>=0.4.3', '<0.5.0'], fallback: ['fcft', 'fcft'])29+fcft = dependency('fcft', version: ['>=1.0.0', '<2.0.0'], fallback: ['fcft', 'fcft'])30 31 wayland_protocols_datadir = wayland_protocols.get_pkgconfig_variable('pkgdatadir')32 33 wscanner = dependency('wayland-scanner', native: true)60 unmodified linesmodified:PKGBUILD+1 added-1 removed
4 unmodified lines5 arch=('x86_64')6 url=https://codeberg.org/dnkl/fuzzel7 license=(mit)8 makedepends=('meson' 'ninja' 'scdoc' 'tllist>=1.0.0')9-depends=('libxkbcommon' 'wayland' 'wlroots' 'cairo' 'librsvg' 'fcft>=0.4.3')9+depends=('libxkbcommon' 'wayland' 'wlroots' 'cairo' 'librsvg' 'fcft>=1.0.0')10 source=()11 12 pkgver() {13 cd ../.git &> /dev/null && git describe --tags --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||11 unmodified linesmodified:render.c+11 added-4 removed
113 unmodified lines114 115 const wchar_t *ptext = prompt_text(prompt);116 const size_t text_len = wcslen(ptext);117 118+ const bool subpixel_antialias =119+ render->options.background_color.a == 1. &&120+ render->options.selection_color.a == 1.;121+122 int x = render->options.border_size + render->options.x_margin;123 int y = render->options.border_size + render->options.y_margin + font->ascent;124 125 wchar_t prev = 0;126 127 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 lines154 155 static void156 render_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;163 164 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;168 169 long x_kern = 0;18 unmodified lines188 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.;195 196 assert(match_count == 0 || selected < match_count);197 198 const double row_height = 2 * y_margin + font->height;83 unmodified lines282 /* 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);288 289 y += row_height;290 }27 unmodified lines