mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-09 21:55:29 +02:00
Add option to control using color emoji or not
This commit is contained in:
@@ -291,6 +291,7 @@ type_map = {
|
||||
'active_tab_font_style': tab_font_style,
|
||||
'inactive_tab_font_style': tab_font_style,
|
||||
'url_style': url_style,
|
||||
'prefer_color_emoji': to_bool,
|
||||
}
|
||||
|
||||
for name in (
|
||||
|
||||
@@ -195,7 +195,7 @@ create_fallback_face(PyObject UNUSED *base_face, Cell* cell, bool bold, bool ita
|
||||
AP(FcPatternAddString, FC_FAMILY, (const FcChar8*)(emoji ? "emoji" : "monospace"), "family");
|
||||
if (!emoji && bold) { AP(FcPatternAddInteger, FC_WEIGHT, FC_WEIGHT_BOLD, "weight"); }
|
||||
if (!emoji && italic) { AP(FcPatternAddInteger, FC_SLANT, FC_SLANT_ITALIC, "slant"); }
|
||||
if (emoji) { AP(FcPatternAddBool, FC_COLOR, true, "color"); }
|
||||
if (emoji) { AP(FcPatternAddBool, FC_COLOR, OPT(prefer_color_emoji), "color"); }
|
||||
size_t num = cell_as_unicode(cell, true, char_buf, ' ');
|
||||
add_charset(pat, num);
|
||||
PyObject *d = _fc_match(pat);
|
||||
|
||||
@@ -356,3 +356,9 @@ macos_option_as_alt yes
|
||||
# The number is a percentage of maximum volume.
|
||||
# See man XBell for details.
|
||||
x11_bell_volume 80
|
||||
|
||||
# Prefer color emoji fonts when available. Note that this only works
|
||||
# on systems such as Linux that use fontconfig. On other OSes, the emoji
|
||||
# font used is system dependent. It can be overriden using symbol_map in the kitty
|
||||
# configuration.
|
||||
prefer_color_emoji yes
|
||||
|
||||
@@ -305,6 +305,7 @@ PYWRAP1(set_options) {
|
||||
#define S(name, convert) { GA(name); global_state.opts.name = convert(ret); Py_DECREF(ret); if (PyErr_Occurred()) return NULL; }
|
||||
S(visual_bell_duration, PyFloat_AsDouble);
|
||||
S(enable_audio_bell, PyObject_IsTrue);
|
||||
S(prefer_color_emoji, PyObject_IsTrue);
|
||||
S(focus_follows_mouse, PyObject_IsTrue);
|
||||
S(cursor_blink_interval, PyFloat_AsDouble);
|
||||
S(cursor_stop_blinking_after, PyFloat_AsDouble);
|
||||
|
||||
@@ -21,6 +21,7 @@ typedef struct {
|
||||
double repaint_delay, input_delay;
|
||||
bool focus_follows_mouse;
|
||||
bool macos_option_as_alt, macos_hide_titlebar;
|
||||
bool prefer_color_emoji;
|
||||
int adjust_line_height_px;
|
||||
int x11_bell_volume;
|
||||
float adjust_line_height_frac;
|
||||
|
||||
Reference in New Issue
Block a user