This commit is contained in:
Kovid Goyal 2017-11-11 21:15:19 +05:30
parent 5f4e003bed
commit 604e82fd65
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -118,10 +118,10 @@ set_font_size(Face *self, FT_F26Dot6 char_width, FT_F26Dot6 char_height, FT_UInt
bool
set_size_for_face(PyObject *s, unsigned int UNUSED desired_height) {
Face *self = (Face*)s;
FT_UInt w = (FT_UInt)(ceilf(global_state.font_sz_in_pts * 64));
FT_UInt w = (FT_UInt)(ceil(global_state.font_sz_in_pts * 64.0));
if (self->char_width == w && self->char_height == w && self->xdpi == (FT_UInt)global_state.logical_dpi_x && self->ydpi == (FT_UInt)global_state.logical_dpi_x) return true;
((Face*)self)->size_in_pts = global_state.font_sz_in_pts;
return set_font_size(self, w, w, self->xdpi, self->ydpi);
return set_font_size(self, w, w, (FT_UInt)global_state.logical_dpi_x, (FT_UInt)global_state.logical_dpi_y);
}
static inline int

View File

@ -155,7 +155,6 @@ def setup_opengl(opts):
def initialize_window(window, opts, debug_gl=False):
set_logical_dpi(*get_logical_dpi())
viewport_size.width, viewport_size.height = window.get_framebuffer_size()
w, h = window.get_window_size()
viewport_size.x_ratio = viewport_size.width / float(w)
@ -201,6 +200,7 @@ def run_app(opts, args):
elif not iswayland: # no window icons on wayland
with open(logo_data_file, 'rb') as f:
window.set_icon(f.read(), 256, 256)
set_logical_dpi(*get_logical_dpi())
initialize_window(window, opts, args.debug_gl)
boss = Boss(window, opts, args)
boss.start()