mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-12 09:57:05 +03:00
162ca649ef
bgitest: move to other/outdated git-svn-id: svn://kolibrios.org@7951 a494cfbc-eb01-0410-851d-a64ba20cac60
150 lines
7.1 KiB
Plaintext
150 lines
7.1 KiB
Plaintext
BGIFONT.INC v1.0 beta for MenuetOS
|
||
Œ®¤ã«ì ¤«ï à ¡®âë á ¢¥ªâ®à묨 èà¨äâ ¬¨ ä®à¬ â BGI
|
||
|
||
<20> ¯¨á ç¨á⮬ áᥬ¡«¥à¥ ˆ¢ãèª¨ë¬ €¤à¥¥¬ aka Willow
|
||
|
||
‚ áâ®ï饥 ¢à¥¬ï ®¯¥à 樮 ï á¨á⥬ Menuet ®¡« ¤ ¥â áªã¤ë¬¨ á।á⢠¬¨
|
||
®â®¡à ¦¥¨ï ᨬ¢®«®¢. ‚ ¤¨áâਡã⨢¥ ¨¬¥îâáï 2 à áâ஢ëå èà¨äâ (ä ©«ë CHAR.MT ¨
|
||
CHAR2.MT). <20> ¡®â á ¨¬¨ ¦¥á⪮ § è¨â ¢ ï¤à¥. Ž¯à¥¤¥«¥ë¥ ãᨫ¨ï ¯® ¢¥¤à¥¨î
|
||
¬ áèâ ¡¨à㥬ëå èà¨ä⮢ TTF-¯®¤®¡®£® ä®à¬ ⠯।¯à¨¨¬ ¥â Jarek Pelczar, ®¤ ª®
|
||
£à®¬®§¤ª ï MenuetOS C Library ¥ ¯®«ã稫 ¤® á¨å ¯®à ¡®«ì让 ¯®¯ã«ïà®á⨠¢
|
||
áᥬ¡«¥à®© Ž‘. <20>®«£ à᪮© ª®¬ ¤®© Menuet ¤¥« «¨áì ¯®¯ë⪨ ¢áâநâì ¢ ï¤à®
|
||
âà¥â¨© ¬ áèâ ¡¨àã¥¬ë© èà¨äâ, ®, ᪮«ìª® ¬¥ ¨§¢¥áâ®, ¥£® ᨬ¢®«ë 室ïâáï ¢
|
||
áâ ¤¨¨ ¤¨§ © . ’ ª¨¬ ®¡à §®¬, à §à ¡®âª ¡®«£ à ¯®ª ¥ ¯à¥¤áâ ¢«ï¥â 楮áâ¨
|
||
¤«ï à冷¢ëå ¯®«ì§®¢ ⥫¥©. Žç¥¢¨¤®, çâ® ¬ áèâ ¡¨àã¥¬ë¥ èà¨äâë ¯®¬®£ãâ
|
||
à §à ¡®âª¥ â ª¨å ¢ ¦ëå ª ⥣®à¨© ¯à®£à ¬¬ëå ¯à®¤ãªâ®¢, ª ª ¡à 㧥àë ¨
|
||
⥪áâ®¢ë¥ ¯à®æ¥áá®àë, £¤¥ ¡®«ìèãî à®«ì ¨£à ¥â ä®à¬ â¨à®¢ ¨¥ ᨬ¢®«®¢.
|
||
<20>।áâ ¢«ïî ¢ ®¡é¥á⢥®¥ ¯®«ì§®¢ ¨¥ ¢ª«îç ¥¬ë© ä ©« BGIFONT.INC ¤«ï à ¡®âë á
|
||
¢¥ªâ®à묨 èà¨äâ ¬¨ *.CHR, à §à ¡®â ë¥ § ¬¥¨â®© ä¨à¬®© Borland ¤«ï
|
||
¨á¯®«ì§®¢ ¨ï ¢ ª®¬¯¨«ïâ®à å Turbo Pascal, Turbo C ¨ Borland C++ ¥é¥ ¢ á।¥ MS-
|
||
DOS. Š ᮦ «¥¨î, ¯®ª çâ® ¬¥ ¥ 㤠¥âáï ®¡¥á¯¥ç¨âì ¯®¤¤¥à¦ªã BGI-èà¨ä⮢
|
||
ã஢¥ ï¤à - 㦮 £«ã¡¦¥ ¨§ãç âì î áë à á¯à¥¤¥«¥¨ï ¯ ¬ï⨠¨ ¢ë§®¢
|
||
á¨á⥬ëå äãªæ¨©. Ÿ ¤¥îáì, çâ® á¨á⥬騪¨ Menuet á £®â®¢®áâìî ¬¥ ¯®¬®£ãâ.
|
||
Š®¬¯¨«ïæ¨ï ¬®¤ã«ï ¢ á®áâ ¢¥ ï¤à ¯à¥¤¯®« £ ¥âáï á ¨á¯®«ì§®¢ ¨¥¬ ª®áâ âë
|
||
BGI_LEVEL equ KERNEL. <20>« £®¤ àï ãá«®¢®© ª®¬¯¨«ï樨 ¬®¤ã«ì ¬®¦® ¡ã¤¥â
|
||
¨á¯®«ì§®¢ âì á ¥§ ç¨â¥«ì묨 ¨§¬¥¥¨ï¬¨ ã஢¥ ª ª ï¤à , â ª ¨ ¯à¨«®¦¥¨ï.
|
||
<EFBFBD>¨¦¥¨§«®¦¥®¥ ª á ¥âáï à ¡®âë ¬®¤ã«ï ã஢¥ ¯à¨«®¦¥¨ï.
|
||
|
||
BGI-èà¨äâë ¬®£ãâ à ᯮ« £ âìáï ¢ «î¡®¬ ª â «®£¥ HD ¨«¨ RD. ˆå ¯®¨áª
|
||
®áãé¥á⢫ï¥âáï ¯® § ç¥¨î ª®áâ âë BGI_PATH. …᫨ ª®áâ â BGI_WINDOW_CLIP
|
||
ãáâ ®¢«¥ ¢ 1, ¯à®æ¥¤ãà ¬¨ ¬®¤ã«ï ¢ ¯à®æ¥áᥠ¢ë¢®¤ ¢¥ªâ®à®¢ èà¨äâ
|
||
®áãé¥á⢫ï¥âáï ¯à®¢¥àª ¢ë室 § £à ¨æë ®ª , çâ®¡ë ¨§¡¥¦ âì àâ¥ä ªâ®¢.
|
||
ˆá¯®«ì§ã©â¥ íâ®, ¥á«¨ ¢ë ¥ 㢥à¥ë, çâ® ¤¯¨á¨ ¡ã¤ãâ ¯®¬¥é âìáï ¢ ®ª¥. ‚
|
||
í⮬ á«ãç ¥ ¥®¡å®¤¨¬® ¤®¯®«¨â¥«ì® ®¯à¥¤¥«¨âì ª®áâ âã BGI_PRC_INFO - ¤à¥á
|
||
¢ ¯ ¬ï⨠(1024 ¡ ©â ), ªã¤ ¯à¨«®¦¥¨¥ ¬®¦¥â ¯®«ãç âì ¨ä®à¬ æ¨î ® ᢮¥¬ ®ª¥
|
||
ç¥à¥§ 9-î á¨á⥬ãî äãªæ¨î. ‚ᥠ¯à®æ¥¤ãàë ¬®¤ã«ï BGIFONT.INC ®¡ê¥ë ª ª
|
||
¬ ªà®áë, â.¥. ¢ë§ë¢ îâáï ¡¥§ call. „«ï § £à㧪¨ 11 èà¨ä⮢ ¢ ¤à¥á®¥
|
||
¯à®áâà á⢮ ¯à¨«®¦¥¨ï ¥®¡å®¤¨¬ ¥¯à¥àë¢ë© ãç á⮪ à §¬¥à®¬ ®ª®«® 120 ª¡.
|
||
<EFBFBD>ਠ§ £à㧪¥ ®áãé¥á⢫ï¥âáï ¯¥à¥¬¥é¥¨¥ ¤ ëå á 楫ìî íª®®¬¨¨ ¯ ¬ïâ¨. ‘奬
|
||
à §¬¥é¥¨ï èà¨ä⮢:
|
||
|
||
| ‘ç¥â稪 | | ‘âàãªâãà | |„ ë¥| |‘âàãªâãà | | „ ë¥| |‘âàãªâãà |
|
||
| èà¨ä⮢ | | BGIrec | |èà¨äâ | | BGIrec | | èà¨äâ | | BGIrec | ...
|
||
| (1 ¡ ©â)| | | | | |
|
||
| ------------->------ -------------->----- ----------
|
||
- áî¤ ááë« ¥âáï [BGIfont_Ptr]
|
||
|
||
<20>®«ï áâàãªâãàë BGIrec ¨¬¥îâ á«¥¤ãî饥 § 票¥:
|
||
|
||
+00 dword .FontName ç¥âëà¥å¡ãª¢¥®¥ ¨¬ï èà¨äâ
|
||
+04 byte .CharsCount ª®«¨ç¥á⢮ ᨬ¢®«®¢ ¢ èà¨äâ¥
|
||
+05 byte .FirstChar ª®¤ ¯¥à¢®£® ॠ«¨§®¢ ®£® ᨬ¢®«
|
||
+06 byte .UpperMargin ¢¥àåïï £à ¨æ ᨬ¢®«
|
||
+07 byte .LowerMargin ¨¦ïï £à ¨æ ᨬ¢®«
|
||
+08 dword .Widths ᬥ饨¥ ¬ áᨢ è¨à¨ ᨬ¢®«®¢
|
||
+12 dword .FirstData ᬥ饨¥ â ¡«¨æë ¢¥ªâ®à®¢
|
||
+16 dword .EOF 㪠§ ⥫ì á«¥¤ãî騩 BGIrec
|
||
+20 dword .font_data §¤¥áì ç¨ îâáï ¤ ë¥ èà¨äâ
|
||
|
||
‘®¡á⢥® § £à㧪㠨 ¢¥à¨ä¨ª æ¨î èà¨äâ ®áãé¥á⢫ï¥â ¯à®æ¥¤ãà
|
||
BGIfont_Prepare.
|
||
|
||
BGIfont_Prepare
|
||
¢å®¤: EDX - ç¥âëà¥å¡ãª¢¥®¥ ¨¬ï èà¨äâ , ¯®¤«¥¦ 饣® § £à㧪¥. „®«¦®
|
||
ᮢ¯ ¤ âì á ¨¬¥¥¬ ä ©« èà¨äâ (¡¥§ à áè¨à¥¨ï)
|
||
EDI - ¤à¥á ãç á⪠¯ ¬ïâ¨, ªã¤ á«¥¤ã¥â ¯®¬¥áâ¨âì ¤ ë¥ èà¨äâ .
|
||
ˆá¯®«ì§ã¥âáï ⮫쪮 ¯à¨ § £à㧪¥ ¯¥à¢®£® èà¨äâ . <20>â® § 票¥
|
||
§ ®á¨âáï ¢ [BGIfont_Ptr]
|
||
¢ë室: EAX=0, ¥á«¨ ¯à®¨§®è« ®è¨¡ª , ¨ ç¥ ¢ EAX - ¨¤¥â¨ä¨ª â®à (ID)
|
||
§ £à㦥®£® èà¨äâ . ‚¯®á«¥¤á⢨¨ ID ¬®¦® ¯®«ãç¨âì äãªæ¨ï¬¨
|
||
BGIfont_GetID ¨ BGIfont_GetName.
|
||
|
||
„«ï ¥¤¨®¢à¥¬¥®© § £à㧪¨ ¥áª®«ìª¨å èà¨ä⮢ ¬®¦® ¨á¯®«ì§®¢ âì ¯à®æ¥¤ãàã
|
||
BGIfont_Init.
|
||
|
||
BGIfont_Init
|
||
¢å®¤: ESI - 㪠§ ⥫ì ᯨ᮪ ¨¬¥ èà¨ä⮢ ( ¯à¨¬¥à db 'TRIPSIMPEURO')
|
||
ECX - ª®«¨ç¥á⢮ èà¨ä⮢ ¤«ï § £à㧪¨
|
||
EDI - á¬. BGIfont_Prepare
|
||
¢ë室: ¨ç¥£®.
|
||
|
||
„«ï § £à㧪¨ 10 áâ ¤ àâëå èà¨ä⮢ ¢ ¬®¤ã«¥ ®¯à¥¤¥«¥ ¬ áᨢ BGIfont_names
|
||
(¨á¯®«ì§®¢ ¨¥ á¬. ¢ BGITEST).
|
||
|
||
‚ 楫ïå ᮢ¬¥á⨬®á⨠¨ ¯®á«¥¤ãî饣® ¢¥¤à¥¨ï ¢ ï¤à® ¬®¤ã«ì ¯à¥¤« £ ¥â 2
|
||
¯à®æ¥¤ãàë ¤«ï ¢ë¢®¤ ᨬ¢®«®¢ ¢¥ªâ®à묨 èà¨äâ ¬¨. Ž¤ ¨§ ¨å ¨á¯®«ì§ã¥â
|
||
ॣ¨áâàë (¯®¤®¡® 4-© á¨á⥬®© äãªæ¨¨), ¤à㣠ï - áâàãªâãàã.
|
||
|
||
BGIfont_Outtext
|
||
¢å®¤: EAX - "â®çª ®âáç¥â " ¯à¨ ¢ë¢®¤¥ áâப¨ [x] shl 16+[y]
|
||
ECX - 梥â ⥪áâ ¨ à §¬¥à èà¨äâ 0xXYRRGGBB,
|
||
£¤¥ X - ID ¢¥ªâ®à®£® èà¨äâ (4..F),
|
||
Y - ¢¥«¨ç¨ ᨬ¢®«®¢/4, ¯à¨¬¥à 0x1 - 1/4 ®¡ë箣® à §¬¥à ,
|
||
0xC - âன®© à §¬¥à.
|
||
EDX - 㪠§ ⥫ì áâபã
|
||
ESI - ¤«¨ áâப¨ + ä« £¨ ä®à¬ â¨à®¢ ¨ï (á¬. ¨¦¥). ”« £¨
|
||
BGI_ITALIC ¨ BGI_NODRAW ¨£®à¨àãîâáï.
|
||
¢ë室: EAX - ª®®à¤¨ âë ª®æ ¤¯¨á¨ [x] shl 16+[y].
|
||
|
||
Š ª ¢¨¤¨¬, BGIfont_Outtext ¯® ᢮¨¬ ¯ à ¬¥âà ¬ á宦 á 4-© á¨á⥬®© äãªæ¨¥©,
|
||
® ¤®¯ã᪠¥â à áè¨à¥®¥ ã¯à ¢«¥¨¥ ¢ë¢®¤®¬ ᨬ¢®«®¢.
|
||
|
||
<20> ¨¡®«¥¥ ¯®«®¥ ¨á¯®«ì§®¢ ¨¥ ¢¥ªâ®àëå èà¨ä⮢ ®¡¥á¯¥ç¨¢ ¥â äãªæ¨ï
|
||
BGIfont_Freetext. <20> à ¬¥âàë ¢ë¢®¤ áâப¨ ¯¥à¥¤ îâáï ¢ áâàãªâãॠBGIfree.
|
||
|
||
<20>®«ï áâàãªâãàë BGIfree ¨¬¥îâ á«¥¤ãî饥 § 票¥:
|
||
|
||
+00 dword ç¥âëà¥å¡ãª¢¥®¥ ¨¬ï èà¨äâ
|
||
+04 dword "â®çª ®âáç¥â " ¯à¨ ¢ë¢®¤¥ áâப¨ [x] shl 16+[y]
|
||
+08 dword 㣮« ¯®¢®à®â (0 - £®à¨§®â «ì, ®âáç¥â ¯® ç ᮢ®© áâ५ª¥)
|
||
+12 dword ¬ áèâ ¡ ¯® ®á¨ X (§ 票¥ á ¯« ¢ î饩 â®çª®©!)
|
||
+16 dword ¬ áèâ ¡ ¯® ®á¨ Y (§ 票¥ á ¯« ¢ î饩 â®çª®©!)
|
||
+20 dword 㪠§ ⥫ì áâபã
|
||
+24 dword ¤«¨ áâப¨ <20>…‡ ä« £®¢ ä®à¬ â¨à®¢ ¨ï
|
||
+28 dword 梥â ⥪áâ 0x00RRGGBB
|
||
+32 dword ä« £¨ ä®à¬ â¨à®¢ ¨ï
|
||
|
||
Œ®¤ã«ì ®¯à¥¤¥«ï¥â á«¥¤ãî騥 ä« £¨ ä®à¬ â¨à®¢ ¨ï:
|
||
BGI_NODRAW - ¥ à¨á®¢ âì ᨬ¢®«ë
|
||
BGI_ITALIC - ªãàᨢ
|
||
BGI_BOLD - ¯®«ã¦¨àë© èà¨äâ
|
||
BGI_HALEFT - ¢ë஢ïâì ¯® «¥¢®¬ã ªà î
|
||
BGI_HARIGHT - ¢ë஢ïâì ¯® ¯à ¢®¬ã ªà î
|
||
BGI_HACENTER - ¢ë஢ïâì ¯® æ¥âàã
|
||
BGI_VABOTTOM - ¢ë஢ïâì ¯® ¨¦¥¬ã ªà î
|
||
BGI_VATOP - ¢ë஢ïâì ¯® ¢¥à奬㠪à î
|
||
BGI_VACENTER - ¢ë஢ïâì ¯® á¥à¥¤¨¥
|
||
|
||
Š®¬¡¨ æ¨ï ä« £®¢ ®¡à §ã¥âáï ¨å á«®¦¥¨¥¬ ¨«¨ ®¯¥à 樥© OR.
|
||
|
||
BGIfont_Freetext
|
||
¢å®¤: EBX - 㪠§ ⥫ì áâàãªâãàã BGIfree
|
||
¢ë室: EAX - ª®®à¤¨ âë ª®æ ¤¯¨á¨ [x] shl 16+[y].
|
||
|
||
”ãªæ¨ï BGIfont_GetID ¢®§¢à é ¥â ID èà¨äâ ¯® § ¤ ®¬ã ¨¬¥¨.
|
||
|
||
BGIfont_GetID
|
||
¢å®¤: EDX - ç¥âëà¥å¡ãª¢¥®¥ ¨¬ï èà¨äâ
|
||
¢ë室: EAX - ID èà¨äâ
|
||
EDI - 㪠§ ⥫ì BGIrec èà¨äâ .
|
||
|
||
ˆá¯®«ì§®¢ ¨¥ äãªæ¨© ¬®¤ã«ï BGIFONT.INC ¤¥¬®áâà¨àã¥â ¯à®£à ¬¬ BGITEST.
|
||
|
||
—â® ¥é¥ 㦮 ᤥ« âì:
|
||
1. <20>ਠ¬®¦¥á⢥®© § £à㧪¥ èà¨ä⮢ (ª ª ¢ BGITEST) ¨®£¤ ¯à®ï¢«ï¥âáï
|
||
ª®¢ àë© ¡ £, ¯®àâï騩 ¥áª®«ìª® ᨬ¢®«®¢. <20>ਠ¨§¬¥¥¨¨ ¯®à浪 § £à㧪¨
|
||
èà¨ä⮢ ® ¨á祧 ¥â... :-(
|
||
2. ˆá¯à ¢¨âì âà㤮¢®á¯à®¨§¢®¤¨¬ë© ¡ £ ¯à¨ ¤¢¨¦¥¨¨ ¯® ᯨáªã èà¨ä⮢.
|
||
3. “ᮢ¥àè¥á⢮¢ âì ¯à®à¨á®¢ªã ¯®«ã¦¨àëå èà¨ä⮢.
|
||
4. „®¡ ¢¨âì äãªæ¨¨ ¢ë¢®¤ ç¨á¥«.
|