Merge branch 'macos-thicken-font' of https://github.com/tbodt/kitty
This commit is contained in:
@@ -21,6 +21,10 @@ Changelog
|
|||||||
fullscreen/maximized/minimized. This replaces the ``--start-in-fullscreen``
|
fullscreen/maximized/minimized. This replaces the ``--start-in-fullscreen``
|
||||||
flag introduced in the previous release (:iss:`935`)
|
flag introduced in the previous release (:iss:`935`)
|
||||||
|
|
||||||
|
- macOS: Add a new :opt:`macos_thicken_font` to make text rendering
|
||||||
|
on macs thicker, which makes it similar to the result of
|
||||||
|
sub-pixel antialiasing (:pull:`950`)
|
||||||
|
|
||||||
- Fix drag-scrolling not working when the mouse leaves the window confines
|
- Fix drag-scrolling not working when the mouse leaves the window confines
|
||||||
(:iss:`917`)
|
(:iss:`917`)
|
||||||
|
|
||||||
|
|||||||
@@ -779,6 +779,13 @@ o('macos_window_resizable', True, long_text=_('''
|
|||||||
Disable this if you want kitty top-level (OS) windows to not be resizable
|
Disable this if you want kitty top-level (OS) windows to not be resizable
|
||||||
on macOS.
|
on macOS.
|
||||||
'''))
|
'''))
|
||||||
|
|
||||||
|
o('macos_thicken_font', 0, option_type=positive_float, long_text=_('''
|
||||||
|
Draw an extra border around the font with the given width, to increase
|
||||||
|
legibility at small font sizes. For example, a value of 0.75 will
|
||||||
|
result in rendering that looks similar to sub-pixel antialiasing at
|
||||||
|
common font sizes.
|
||||||
|
'''))
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
g('shortcuts') # {{{
|
g('shortcuts') # {{{
|
||||||
|
|||||||
@@ -372,7 +372,9 @@ render_glyphs(CTFontRef font, unsigned int width, unsigned int height, unsigned
|
|||||||
CGContextSetShouldAntialias(render_ctx, true);
|
CGContextSetShouldAntialias(render_ctx, true);
|
||||||
CGContextSetShouldSmoothFonts(render_ctx, true);
|
CGContextSetShouldSmoothFonts(render_ctx, true);
|
||||||
CGContextSetGrayFillColor(render_ctx, 1, 1); // white glyphs
|
CGContextSetGrayFillColor(render_ctx, 1, 1); // white glyphs
|
||||||
CGContextSetTextDrawingMode(render_ctx, kCGTextFill);
|
CGContextSetGrayStrokeColor(render_ctx, 1, 1);
|
||||||
|
CGContextSetLineWidth(render_ctx, global_state.opts.macos_thicken_font);
|
||||||
|
CGContextSetTextDrawingMode(render_ctx, kCGTextFillStroke);
|
||||||
CGContextSetTextMatrix(render_ctx, CGAffineTransformIdentity);
|
CGContextSetTextMatrix(render_ctx, CGAffineTransformIdentity);
|
||||||
CGContextSetTextPosition(render_ctx, 0, height - baseline);
|
CGContextSetTextPosition(render_ctx, 0, height - baseline);
|
||||||
CTFontDrawGlyphs(font, glyphs, positions, num_glyphs, render_ctx);
|
CTFontDrawGlyphs(font, glyphs, positions, num_glyphs, render_ctx);
|
||||||
|
|||||||
@@ -391,6 +391,7 @@ PYWRAP1(set_options) {
|
|||||||
S(macos_window_resizable, PyObject_IsTrue);
|
S(macos_window_resizable, PyObject_IsTrue);
|
||||||
S(x11_hide_window_decorations, PyObject_IsTrue);
|
S(x11_hide_window_decorations, PyObject_IsTrue);
|
||||||
S(macos_hide_from_tasks, PyObject_IsTrue);
|
S(macos_hide_from_tasks, PyObject_IsTrue);
|
||||||
|
S(macos_thicken_font, PyFloat_AsDouble);
|
||||||
|
|
||||||
PyObject *chars = PyObject_GetAttrString(opts, "select_by_word_characters");
|
PyObject *chars = PyObject_GetAttrString(opts, "select_by_word_characters");
|
||||||
if (chars == NULL) return NULL;
|
if (chars == NULL) return NULL;
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ typedef struct {
|
|||||||
double repaint_delay, input_delay;
|
double repaint_delay, input_delay;
|
||||||
bool focus_follows_mouse;
|
bool focus_follows_mouse;
|
||||||
bool macos_option_as_alt, macos_hide_titlebar, macos_hide_from_tasks, x11_hide_window_decorations, macos_quit_when_last_window_closed, macos_window_resizable;
|
bool macos_option_as_alt, macos_hide_titlebar, macos_hide_from_tasks, x11_hide_window_decorations, macos_quit_when_last_window_closed, macos_window_resizable;
|
||||||
|
float macos_thicken_font;
|
||||||
int adjust_line_height_px, adjust_column_width_px;
|
int adjust_line_height_px, adjust_column_width_px;
|
||||||
float adjust_line_height_frac, adjust_column_width_frac;
|
float adjust_line_height_frac, adjust_column_width_frac;
|
||||||
float background_opacity, dim_opacity;
|
float background_opacity, dim_opacity;
|
||||||
|
|||||||
Reference in New Issue
Block a user