From a4815234428ed3de84d1f32c54900b778736b604 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 9 Mar 2015 18:51:16 +0000 Subject: [PATCH] copyf: upload fixes git-svn-id: svn://kolibrios.org@5515 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/copyf.h | 10 ++----- programs/cmm/lib/obj/truetype.h | 53 ++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/programs/cmm/lib/copyf.h b/programs/cmm/lib/copyf.h index d3a58936f3..8d43f172ad 100644 --- a/programs/cmm/lib/copyf.h +++ b/programs/cmm/lib/copyf.h @@ -1,11 +1,10 @@ //copyf - copy file or folder with content -#define WIN_COPY_W 300 -#define WIN_COPY_H 50 + :int copyf(dword from1, in1) { dword error; BDVK CopyFile_atr1; - DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_COPY_W,GetSkinHeight()+WIN_COPY_H-1,0x34,sc.work,T_PASTE_WINDOW); + if (!from1) || (!in1) { notify("Error: too less copyf params!"); @@ -25,11 +24,6 @@ copyf_Draw_Progress(from1+strchr(from1, '/')); return CopyFile(from1, in1); } - if (CheckEvent()==evButton) - { - notify(T_CANCEL_PASTE); - CopyExit(); - } } :int CopyFile(dword copy_from3, copy_in3) diff --git a/programs/cmm/lib/obj/truetype.h b/programs/cmm/lib/obj/truetype.h index fe2529d4de..e26d765014 100644 --- a/programs/cmm/lib/obj/truetype.h +++ b/programs/cmm/lib/obj/truetype.h @@ -1,27 +1,38 @@ -//это вставить после загрузки основных библиотек - char fontinfo[28]; -dword libtruetype = #att; +dword libtruetype = #att_libtruetype; -char att[] = "/sys/lib/truetype.obj"; //"truetype.obj\0"; +char att_libtruetype[22] = "/sys/lib/truetype.obj\0"; -dword truetype = #att_truetype; -dword get_length = #att_get_length; -dword get_width = #att_get_width; -dword text_out = #att_text_out; -dword init_font = #att_init_font; +dword truetype = #att_truetype; // truetype(unsigned char *s, stbtt_fontinfo *buffer, char *screen1, int width, int height) +dword get_length = #att_get_length; // get_length(unsigned char *s, char *buffer, int height, int max_len) +dword get_width = #att_get_width; // get_width_utf8(unsigned char *s, stbtt_fontinfo *buffer, int height) +dword text_out = #att_text_out; // text_out(unsigned char *string, char *buffer, int height, int color,int back_color, int x, int y) +dword init_font = #att_init_font; // init_font(stbtt_fontinfo *font,unsigned char *FontData) +dword text_out_mem = #att_text_out_mem; // text_out_mem(unsigned char *string, stbtt_fontinfo *buffer, int height, int color,int back_color) +dword text_scale_EM = #att_text_scale; // scale_EM(stbtt_fontinfo *buffer, int size) $DD 2 dup 0 -//import libimg , \ - -char att_truetype[] = "truetype"; -char att_get_length[] = "get_length"; -char att_get_width[] = "get_width"; -char att_text_out[] = "text_out"; -char att_init_font[] = "init_font"; - -//load_dll2(libtruetype, #truetype,0); - -//а это - в момент отрисовки окна -//text_out stdcall (#text, -1, 40, 0xFF0000, 100, 100); +char att_truetype[] = "truetype"; +char att_get_length[] = "get_length"; +char att_get_width[] = "get_width"; +char att_text_out[] = "text_out"; +char att_init_font[] = "init_font"; +char att_text_out_mem[] = "text_out_mem"; +char att_text_scale[] = "scale_EM"; + +//============================================================ +//============================================================ + +struct stbtt_fontinfo +{ + dword userdata; + dword data; // pointer to .ttf file + int fontstart; // offset of start of font + + int numGlyphs; // number of glyphs, needed for range checking + + int loca,head,glyf,hhea,hmtx,kern; // table locations as offset from start of .ttf + int index_map; // a cmap mapping for our chosen character encoding + int indexToLocFormat; // format needed to map from glyph index to glyph +};