/* * Initialise vim to use the font with the given name. Return FAIL if the font * could not be loaded, OK otherwise. */ int gui_mch_init_font(char_u *font_name, int fontset) { vimjs_init_font((char*)font_name); gui.char_width = vimjs_get_char_width(); gui.char_height = vimjs_get_char_height(); gui.char_ascent = gui.char_height; char_u buf[100]; gui.norm_font = vim_strsave(font_name); vim_strncpy(buf, "bold ", 99); // should report 1 less to vim_strncpy vim_strcat(buf, font_name, 100); gui.bold_font = vim_strsave(buf); vim_strncpy(buf, "italic ", 99); // should report 1 less to vim_strncpy vim_strcat(buf, font_name, 100); gui.ital_font = vim_strsave(buf); vim_strncpy(buf, "bold italic ", 99); // should report 1 less to vim_strncpy vim_strcat(buf, font_name, 100); gui.boldital_font = vim_strsave(buf); int w,h; w = vimjs_get_window_width(); h = vimjs_get_window_height(); gui_resize_shell(w, h); return OK; }
/* * Initialise vim to use the font with the given name. Return FAIL if the font * could not be loaded, OK otherwise. */ int gui_mch_init_font(char_u *font_name, int fontset) { vimjs_init_font((char*)font_name); gui.char_width = vimjs_get_char_width(); gui.char_height = vimjs_get_char_height(); gui_browser_resize(); return OK; }