![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-10-31 11:43 |
47,815 topics / 349,930 posts / today 0 new / 48,290 members |
| DOS开发编程 & 发展交流 (开发室) » Program source code for displaying Chinese characters |
| Printable Version 3,390 / 28 |
| Floor1 qb45 | Posted 2003-09-23 00:00 |
| 高级用户 Posts 194 Credits 677 | |
|
This program requires the Chinese character library of UCDOS, with the file name: HZK16. If you want to use it in your own program, you can extract part of the character patterns for use in the program!
The following is the program code: OPEN "asc16" FOR BINARY AS #2 OPEN "hzk16" FOR BINARY AS #1 IF LOF(1) = 0 THEN PRINT "No Chinese character library! ":END SCREEN 12 hz1$ = "Microsoft Dedicated Operating System Installation Tool" hz 1, 100, hz1$, 11 SUB hz (x0, y0, hz.word$, hzcol) REM Subroutine to display Chinese characters savex0 = x0: savey0 = y0 FOR now = 1 TO LEN(hz.word$) qu = ASC(MID$(hz.word$, now, 1)) IF qu >= 161 THEN now = now + 1 IF now > LEN(hz.word$) THEN EXIT FOR wei = ASC(MID$(hz.word$, now, 1)) ps& = ((qu - 161) * 94& + wei - 161) * 32& + 1 SEEK #1, ps& zimo$ = INPUT$(32, 1) num = 1 FOR y = 0 TO 15 chr1$ = MID$(zimo$, num, 1) num = num + 1 chr2$ = MID$(zimo$, num, 1) num = num + 1 chr3$ = chr2$ + chr1$ LINE (x0, y0 + y)-STEP(15, 0), hzcol, , CVI(chr3$) NEXT y x0 = x0 + 16 ELSE SEEK #2, qu * 16 zimo$ = INPUT$(16, 2) FOR y = 1 TO 16 zmchr$ = CHR$(0) + MID$(zimo$, y, 1) LINE (x0, y0 + y)-STEP(15, 0), hzcol, , CVI(zmchr$) NEXT y x0 = x0 + 8 END IF NEXT now x0 = savex0: y0 = savey0 END SUB |
|
| Floor2 qb45 | Posted 2003-09-30 00:00 |
| 高级用户 Posts 194 Credits 677 | |
|
The HZK16 font in UCDOS is a 16*16 dot matrix, and each character pattern is 32 bytes. If you convert it into binary and arrange it in 16 rows, you will see the outline of a Chinese character.
Forget it, I won't write anymore... It's really tiring to do original work!!!!! No one is replying, hey! |
|
| Floor3 pfox | Posted 2003-09-30 00:00 |
| 银牌会员 Posts 446 Credits 1,451 | |
The following is a quote from QB45 on 2003-9-30 0:42:59: Some simplified Chinese character fonts have part of the 16*15 dot matrix font. Can a program be made to extract the hexadecimal dot matrix information of the 16*15 dot matrix font? It is best to provide both hexadecimal and binary extraction methods. |
|
| Floor4 lemonhall | Posted 2003-10-02 00:00 |
| 高级用户 Posts 183 Credits 639 | |
|
Support original, but these source programs all have source code under DOS, and QB45, I understand your mood of liking BASIC. But, translating a lot of C source code into QB code seems a bit...
After all, using QB45 to display Chinese characters directly is extremely, extremely slow... Especially when running your program on my 4M486. It is suggested to write C code for these low-level calls, improve the portability and reliability of the original code, encapsulating it into LIB or using C++ to increase its reusability are all good directions. |
|
| Floor5 lemonhall | Posted 2003-10-02 00:00 |
| 高级用户 Posts 183 Credits 639 | |
|
In addition, the support is:
It seems that the programs you wrote can be used to develop installation programs, right? If you really like QB45 so much, it's okay. After all, today there are not many people like me who still use 486. Then please add some comments to the source code, encapsulate the functions, write INCLUDE files. In the future, when you are not patient enough to continue developing this installation system, others can easily take over! Another suggestion is to use version control tools similar to RCS as soon as possible to lay the foundation for tomorrow's work. Come on!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
| Floor6 cn_archer | Posted 2003-10-02 00:00 |
| 元老会员 Posts 991 Credits 2,903 From 福建省 | |
|
Support!Dude, if you have original posts, I'll definitely reply.
![]() |
|
| Floor7 iceboy | Posted 2003-10-03 00:00 |
| 银牌会员 Posts 512 Credits 1,681 | |
|
I simply encapsulated it, added automatic line wrapping, automatically changed the current POS... can be used together with PRINT statements without causing character overlap... The statement name is PRINTH, call directly, but cannot use semicolons...
The file is a QBASIC program, with the extension BAS, but it is two SUBs. Call syntax: PRINTH "Chinese characters to input" Open the attachment |
|
| Floor8 lemonhall | Posted 2003-10-04 00:00 |
| 高级用户 Posts 183 Credits 639 | |
|
Support. If it's the PRINTH for installation,, if there are several commonly used color macro definitions, then unit testing can be entered. Finally, it's packaged into a LIB for all BASIC developers to use (not sure if there is a ready-made one in the DK of UCDOS??)
|
|
| Floor9 qb45 | Posted 2003-10-08 00:00 |
| 高级用户 Posts 194 Credits 677 | |
The following is a quote from lemonhall on 2003-10-2 18:17:46: I don't know C language at all, but I really want to learn it. I only know BASIC. On a 486 computer, to improve the display speed, some technical means can be taken, such as: directly writing to video memory, or reading character patterns into memory, and loading disk buffers. |
|
| Floor10 xy_god | Posted 2003-10-08 00:00 |
| 中级用户 Posts 56 Credits 276 | |
|
I used to see a program for displaying Chinese characters in QB, but I still hope QB45 can quickly learn C. It won't take too long. I switched from QB to C, but the most important thing is to understand microcomputer principles. Actually, I think it's feasible to develop an operating system with BASIC after understanding microcomputer principles. Hehe! Really, it's not alarmist!
|
|
| Floor11 qb45 | Posted 2003-10-13 00:00 |
| 高级用户 Posts 194 Credits 677 | |
The following is the statement of pfox on 2003-9-30 10:01:51: I don't have a 16*15 dot matrix character library here. If I had one, I could try. Can you provide this character library? |
|
| Floor12 pfox | Posted 2003-10-14 00:00 |
| 银牌会员 Posts 446 Credits 1,451 | |
The following is a quote from QB45 on 2003-10-13 19:22:14: Open attachmentOpen attachment This is the 16*15 dot matrix font. Please try it. |
|
| Floor13 qb45 | Posted 2003-10-14 00:00 |
| 高级用户 Posts 194 Credits 677 | |
|
pfox, I have analyzed the font file you sent. The source code is as follows. Actually, this is not a 16*15 dot matrix font, but a 14*14 dot matrix font. Because of your misguidance, I took a lot of detours! I don't know where you got this font file! Its order is arranged according to radicals!
The following is the source code input "Please enter the complete path and file name of the 16*15 dot matrix font_ ",file$ OPEN file$ FOR BINARY AS #1 SCREEN 12 FOR i1 = 0 TO 28 x0 = 0 FOR i = 1 TO 42 SEEK #1, 24709 + (i + i1 * 42) * 28 zimo$ = INPUT$(28, 1) num = 1 y0 = i1 * 16 FOR y = 0 TO 13 chr1$ = MID$(zimo$, num, 1) num = num + 1 chr2$ = MID$(zimo$, num, 1) num = num + 1 chr3$ = chr2$ + chr1$ LINE (x0, y0 + y)-STEP(14, 0), 7, , CVI(chr3$) NEXT y x0 = x0 + 15 NEXT i NEXT i1 close end |
|
| Floor14 Roy | Posted 2003-10-14 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
The following is a quote from QB45 on 2003-10-13 19:22:14:This is a 16*15 (or is it 14*14?) dot matrix font of the et3 Chinese system Open the attachment |
|
| Floor15 Roy | Posted 2003-10-14 00:00 |
| 管理员 Posts 1,633 Credits 4,869 | |
|
This is the 16*15 font of Zhenhan Chinese System Open attachment
This is the 16*16 font of Lujin Chinese System Open attachment |
|
| 1 2 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |