forked from KolibriOS/kolibrios
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:
parent
88d4ecd139
commit
f8bce77141
@ -34,6 +34,7 @@ dword col_padding, col_selec, col_lpanel;
|
|||||||
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
int toolbar_buttons_x[7]={9,46,85,134,167,203};
|
||||||
struct path_string { char Item[4096]; };
|
struct path_string { char Item[4096]; };
|
||||||
|
|
||||||
|
byte smooth_font=false;
|
||||||
byte active_about=0;
|
byte active_about=0;
|
||||||
word about_window;
|
word about_window;
|
||||||
word settings_window;
|
word settings_window;
|
||||||
@ -735,6 +736,7 @@ void Line_ReDraw(dword bgcol, filenum){
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
font.bg_color = bgcol;
|
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.prepare(files.x + 23, files.item_h - font.height / 2 + y, file_name_off);
|
||||||
font.show();
|
font.show();
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
?define SHOW_REAL_NAMES "<EFBFBD>®ª §ë¢ âì ¨¬¥ ä ©«®¢ ¥ ¬¥ïï ॣ¨áâà"
|
?define SHOW_REAL_NAMES "<EFBFBD>®ª §ë¢ âì ¨¬¥ ä ©«®¢ ¥ ¬¥ïï ॣ¨áâà"
|
||||||
?define FONT_SIZE_LABEL "<EFBFBD> §¬¥à èà¨äâ "
|
?define FONT_SIZE_LABEL "<EFBFBD> §¬¥à èà¨äâ "
|
||||||
?define USE_TWO_PANELS "„¢¥ ¯ ¥«¨"
|
?define USE_TWO_PANELS "„¢¥ ¯ ¥«¨"
|
||||||
|
?define USE_SMOOTH_FONT "ˆá¯®«ì§®¢ âì ᣫ ¦¥ë© èà¨äâ"
|
||||||
?define LIST_LINE_HEIGHT "‚ëá®â áâப¨ ¢ ᯨ᪥"
|
?define LIST_LINE_HEIGHT "‚ëá®â áâப¨ ¢ ᯨ᪥"
|
||||||
?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襨¨ ª®¯¨à®¢ ¨ï"
|
?define NOTIFY_COPY_END "“¢¥¤®¬«ïâì ® § ¢¥à襨¨ ª®¯¨à®¢ ¨ï"
|
||||||
?define T_DOUBLE_CLICK "‚à¥¬ï ¤¢®©®£® ª«¨ª (¢ á®âëå)"
|
?define T_DOUBLE_CLICK "‚à¥¬ï ¤¢®©®£® ª«¨ª (¢ á®âëå)"
|
||||||
@ -17,6 +18,7 @@
|
|||||||
?define SHOW_REAL_NAMES "Show real file names without changing case"
|
?define SHOW_REAL_NAMES "Show real file names without changing case"
|
||||||
?define FONT_SIZE_LABEL "Font size"
|
?define FONT_SIZE_LABEL "Font size"
|
||||||
?define USE_TWO_PANELS "Two panels"
|
?define USE_TWO_PANELS "Two panels"
|
||||||
|
?define USE_SMOOTH_FONT "Use smooth font"
|
||||||
?define LIST_LINE_HEIGHT "List line height"
|
?define LIST_LINE_HEIGHT "List line height"
|
||||||
?define NOTIFY_COPY_END "Notify when copying finished"
|
?define NOTIFY_COPY_END "Notify when copying finished"
|
||||||
?define T_DOUBLE_CLICK "Double click time (in hundredths)"
|
?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==20) show_dev_name ^= 1;
|
||||||
else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
|
else if (id==21) { action_buf=109; real_files_names_case ^= 1; }
|
||||||
else if (id==22) info_after_copy ^= 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==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==26) && (files.item_h>18) files.item_h--;
|
||||||
else if (id==27) MOUSE_TIME++;
|
else if (id==27) MOUSE_TIME++;
|
||||||
else if (id==28) && (MOUSE_TIME>29) 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==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(); }
|
else if (id==31) { font.size.text--; IF(!font.changeSIZE()) font.size.text++; BigFontsChange(); }
|
||||||
EventRedrawWindow(Form.left,Form.top);
|
EventRedrawWindow(Form.left,Form.top);
|
||||||
@ -67,10 +70,10 @@ void settings_dialog()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case evReDraw:
|
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();
|
DrawSettingsCheckBoxes();
|
||||||
DrawFlatButton(9, 186, strlen(SAVE_PATH_AS_DEFAULT)+4*6, 22, 6, 0xE4DFE1, SAVE_PATH_AS_DEFAULT);
|
DrawFlatButton(9, 208, 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, 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, 33, 21, SHOW_REAL_NAMES, real_files_names_case);
|
||||||
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
|
CheckBox2(10, 55, 22, NOTIFY_COPY_END, info_after_copy);
|
||||||
CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels);
|
CheckBox2(10, 77, 24, USE_TWO_PANELS, two_panels);
|
||||||
MoreLessBox(10, 103, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
|
CheckBox2(10, 99, 29, USE_SMOOTH_FONT, smooth_font);
|
||||||
MoreLessBox(10, 130, 18, 25, 26, #system.color, files.item_h, LIST_LINE_HEIGHT);
|
MoreLessBox(10, 125, 18, 27, 28, #system.color, MOUSE_TIME, T_DOUBLE_CLICK);
|
||||||
if (font.data) MoreLessBox(10, 157, 18, 30, 31, #system.color, font.size.text, FONT_SIZE_LABEL);
|
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, "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, "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, "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, "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, "TimeDoubleClick", 50); MOUSE_TIME = EAX;
|
||||||
ini_get_int stdcall (eolite_ini_path, #config_section, "WinX", 200); WinX = 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, "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, "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, "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, "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, "TimeDoubleClick", MOUSE_TIME);
|
||||||
ini_set_int stdcall (eolite_ini_path, #config_section, "WinX", Form.left);
|
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, "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, "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, "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, "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, "TimeDoubleClick", MOUSE_TIME);
|
||||||
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinX", Form.left);
|
ini_set_int stdcall (fd_path_eolite_ini_path, #config_section, "WinX", Form.left);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
__SIZE size;
|
__SIZE size;
|
||||||
byte r,g,b,weight,italic, smooth;
|
byte r,g,b,weight,italic, smooth;
|
||||||
byte width,height;
|
byte width,height;
|
||||||
|
byte use_smooth;
|
||||||
word left,top;
|
word left,top;
|
||||||
byte encoding;
|
byte encoding;
|
||||||
dword color;
|
dword color;
|
||||||
@ -219,7 +220,7 @@ FONT font = 0;
|
|||||||
IF(weight)len+=math.ceil(size.text/17);
|
IF(weight)len+=math.ceil(size.text/17);
|
||||||
text1++;
|
text1++;
|
||||||
}
|
}
|
||||||
IF (no_bg_copy) && (!color) SmoothFont(buffer, size.width, size.height);
|
IF (use_smooth) SmoothFont(buffer, size.width, size.height);
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
:void FONT::show()
|
:void FONT::show()
|
||||||
@ -306,6 +307,7 @@ inline fastcall dword b24(EBX) { return DSDWORD[EBX] << 8; }
|
|||||||
:byte FONT::load(dword path)
|
:byte FONT::load(dword path)
|
||||||
{
|
{
|
||||||
buffer_size = 0;
|
buffer_size = 0;
|
||||||
|
use_smooth = true;
|
||||||
IF(data)free(data);
|
IF(data)free(data);
|
||||||
IF(!io.read(path)) { debug("Error while loading font: "); debugln(path); return false; }
|
IF(!io.read(path)) { debug("Error while loading font: "); debugln(path); return false; }
|
||||||
begin = data = io.buffer_data;
|
begin = data = io.buffer_data;
|
||||||
|
Loading…
Reference in New Issue
Block a user