Font.h: option "use smooth"

Eolite: setting option "use smooth"

git-svn-id: svn://kolibrios.org@5846 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pavelyakov 2015-10-12 11:42:35 +00:00
parent 88d4ecd139
commit f8bce77141
3 changed files with 19 additions and 8 deletions

View File

@ -34,6 +34,7 @@ dword col_padding, col_selec, col_lpanel;
int toolbar_buttons_x[7]={9,46,85,134,167,203};
struct path_string { char Item[4096]; };
byte smooth_font=false;
byte active_about=0;
word about_window;
word settings_window;
@ -735,6 +736,7 @@ void Line_ReDraw(dword bgcol, filenum){
else
{
font.bg_color = bgcol;
font.use_smooth = smooth_font;
font.prepare(files.x + 23, files.item_h - font.height / 2 + y, file_name_off);
font.show();
}

View File

@ -6,6 +6,7 @@
?define SHOW_REAL_NAMES "<EFBFBD>®ª §ë¢ âì ¨¬¥­  ä ©«®¢ ­¥ ¬¥­ïï ॣ¨áâà"
?define FONT_SIZE_LABEL "<EFBFBD> §¬¥à èà¨äâ "
?define USE_TWO_PANELS "„¢¥ ¯ ­¥«¨"
?define USE_SMOOTH_FONT "ˆá¯®«ì§®¢ âì ᣫ ¦¥­­ë© èà¨äâ"
?define LIST_LINE_HEIGHT "‚ëá®â  áâப¨ ¢ ᯨ᪥"
?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襭¨¨ ª®¯¨à®¢ ­¨ï"
?define T_DOUBLE_CLICK "‚à¥¬ï ¤¢®©­®£® ª«¨ª  (¢ á®âëå)"
@ -17,6 +18,7 @@
?define SHOW_REAL_NAMES "Show real file names without changing case"
?define FONT_SIZE_LABEL "Font size"
?define USE_TWO_PANELS "Two panels"
?define USE_SMOOTH_FONT "Use smooth font"
?define LIST_LINE_HEIGHT "List line height"
?define NOTIFY_COPY_END "Notify when copying finished"
?define T_DOUBLE_CLICK "Double click time (in hundredths)"
@ -50,11 +52,12 @@ void settings_dialog()
else if (id==20) show_dev_name ^= 1;
else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
else if (id==22) info_after_copy ^= 1;
else if (id==24) two_panels ^= 1;
else if (id==24) two_panels ^= true;
else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
else if (id==26) && (files.item_h>18) files.item_h--;
else if (id==27) MOUSE_TIME++;
else if (id==28) && (MOUSE_TIME>29) MOUSE_TIME--;
else if (id==29) smooth_font ^= true;
else if (id==30) { font.size.text++; IF(!font.changeSIZE()) font.size.text--; BigFontsChange(); }
else if (id==31) { font.size.text--; IF(!font.changeSIZE()) font.size.text++; BigFontsChange(); }
EventRedrawWindow(Form.left,Form.top);
@ -67,10 +70,10 @@ void settings_dialog()
break;
case evReDraw:
DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 246+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
DefineAndDrawWindow(Form.left + Form.width/2-10, Form.top + Form.height/2 - 75, 300, 280+GetSkinHeight(),0x34,system.color.work,TITLE_SETT);
DrawSettingsCheckBoxes();
DrawFlatButton(9, 186, strlen(SAVE_PATH_AS_DEFAULT)+4*6, 22, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT);
DrawFlatButton(9, 216, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
DrawFlatButton(9, 208, strlen(SAVE_PATH_AS_DEFAULT)+4*6, 22, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT);
DrawFlatButton(9, 240, strlen(EDIT_FILE_ASSOCIATIONS)+4*6, 22, 5, 0xE4DFE1, EDIT_FILE_ASSOCIATIONS);
}
}
}
@ -89,9 +92,10 @@ void DrawSettingsCheckBoxes()
CheckBox2(10, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels);
MoreLessBox(10, 103, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
MoreLessBox(10, 130, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
if (font.data) MoreLessBox(10, 157, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
CheckBox2(10, 99, 29, USE_SMOOTH_FONT, smooth_font);
MoreLessBox(10, 125, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
MoreLessBox(10, 152, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
if (font.data) MoreLessBox(10, 179, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
}
@ -105,6 +109,7 @@ void LoadIniSettings()
ini_get_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", 0); info_after_copy = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "FontSize", 9); font.size.text = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "TwoPanels", 0); two_panels = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "UseSmoothFont", true);smooth_font = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "LineHeight", 18); files.item_h = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", 50); MOUSE_TIME = EAX;
ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = EAX;
@ -123,6 +128,7 @@ void SaveIniSettings()
ini_set_int stdcall (eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
ini_set_int stdcall (eolite_ini_path, #config_section, "FontSize", font.size.text);
ini_set_int stdcall (eolite_ini_path, #config_section, "TwoPanels", two_panels);
ini_set_int stdcall (eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
ini_set_int stdcall (eolite_ini_path, #config_section, "LineHeight", files.item_h);
ini_set_int stdcall (eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
@ -137,6 +143,7 @@ void SaveIniSettings()
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "InfoAfterCopy", info_after_copy);
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "FontSize", font.size.text);
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TwoPanels", two_panels);
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "UseSmoothFont", smooth_font);
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "LineHeight", files.item_h);
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "TimeDoubleClick", MOUSE_TIME);
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinX", Form.left);

View File

@ -26,6 +26,7 @@
__SIZE size;
byte r,g,b,weight,italic, smooth;
byte width,height;
byte use_smooth;
word left,top;
byte encoding;
dword color;
@ -219,7 +220,7 @@ FONT font = 0;
IF(weight)len+=math.ceil(size.text/17);
text1++;
}
IF (no_bg_copy) && (!color) SmoothFont(buffer, size.width, size.height);
IF (use_smooth) SmoothFont(buffer, size.width, size.height);
return len;
}
:void FONT::show()
@ -306,6 +307,7 @@ inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; }
:byte FONT::load(dword path)
{
buffer_size = 0;
use_smooth = true;
IF(data)free(data);
IF(!io.read(path)) { debug("Error while loading font: "); debugln(path); return false; }
begin = data = io.buffer_data;