kolibrios/programs/cmm/example fonts/example original font.c
pavelyakov 4e5ae9b95e Added library font
git-svn-id: svn://kolibrios.org@5730 a494cfbc-eb01-0410-851d-a64ba20cac60
2015-08-17 00:16:17 +00:00

66 lines
2.1 KiB
C

#define MEMSIZE 0x7E80
#include "../lib/font.h"
byte id,key;
FONT TimeNewRoman = 0;
FONT Verdana = 0;
void main()
{
SetEventMask(1100111b);
Verdana.load("font/Verdana 15px original");
font.load("font/Georgia 45px original");
TimeNewRoman.load("font/Times New Roman 30px original");
loop()
{
switch(WaitEvent())
{
case evMouse:
mouse.get();
break;
case evButton:
id=GetButtonID();
if (id==1) ExitProcess();
break;
case evKey:
key = GetKey();
if (key==013){ //Enter
draw_window();
}
break;
case evReDraw:
draw_window();
break;
}
}
}
void draw_window()
{
proc_info Form;
int i =0;
DefineAndDrawWindow(215,100,450,500,0x33,0xFFFFFF,"Window header");
GetProcessInfo(#Form, SelfInfo);
font.text(0,0,"Georgia 45px original",0x5522DD);
font.text(3,43,"Ñúåøü åùå ýòèõ ìÿãêèõ ôðàíöóçêèõ áóëîê, äà âûïåé ÷àþ. 1234567890",0xDEDEDE);
font.text(0,40,"Ñúåøü åùå ýòèõ ìÿãêèõ ôðàíöóçêèõ áóëîê, äà âûïåé ÷àþ. 1234567890",0x0);
font.text(0,80,"Times New Roman 30px original",0x993366);
TimeNewRoman.text(3,113,"Ñúåøü åùå ýòèõ ìÿãêèõ ôðàíöóçêèõ áóëîê, äà âûïåé ÷àþ. 1234567890",0xDEDEDE);
TimeNewRoman.text(0,110,"Ñúåøü åùå ýòèõ ìÿãêèõ ôðàíöóçêèõ áóëîê, äà âûïåé ÷àþ. 1234567890",0x0);
Verdana.textarea(0,150,"Ýòîò ïðèìåð äåìîíñòðèðóåò âîçìîæíîñòè øðèôòà, \rêîòîðûé ñîçäàí ñïåöèàëüíî äëÿ êîëèáðèÎÑ.\r áëèæàéøåå âðåìÿ àêòèâíî äîáàâëÿþòñÿ øðèôòû.\rÐåäàêòèðîâàòü øðèôòû ìîæíî íà ñàéòå: http://font.ga.\rÄëÿ ðåäàêòèðîâàíèÿ øðèôòà, øðèôò äîëæåí áûòü â íåñæàòîì âèäå,\ròàêæå ñîîòâåòñòâîâàòü ñòàíäàðòó!\r ïëàíàõ ñäåëàòü êîìïàêòíûé ôàéë,\rêîòîðûé áóäåò ñîäåðæàòü ðàçíûå ðàçìåðû îäíîãî øðèôòà.\rÎðèãèíàëüíûé ôàéë (ò.å.) íå ñæàòûé ôàéë ìíîãî çàíèìàåò ìåñòà,\rïîýòîìó ðåêîìåíäóþ ñæèìàòü kpack. Øðèôòû íà çàêàç https://vk.com/pavelyakov39\rÏðîðèñîâêà ïîêà ÷òî ìåäëåííàÿ - âðåìåííî.Êîäèðîâêà øðèôòà ANSII.",0x5522DD);
Verdana.text(30,350,"À òåïåðü...",0xAA4444);
font.text(60,370,"Äî âñòðå÷è!!!",0xDD4444);
}