China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-19 05:13
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Program source code for displaying Chinese characters View 2,754 Replies 28
Original Poster Posted 2003-09-23 00:00 ·  中国 湖北 武汉 联通
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
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



Floor 2 Posted 2003-09-30 00:00 ·  中国 湖北 宜昌 电信
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
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!
Floor 3 Posted 2003-09-30 00:00 ·  中国 广东 汕头 电信
银牌会员
★★★
Credits 1,451
Posts 446
Joined 2002-10-20 00:00
23-year member
UID 29
Gender Male
Status Offline
The following is a quote from QB45 on 2003-9-30 0:42:59:
The HZK16 font in UCDOS is a 16*16 dot matrix, with each character pattern being 32 bytes. If you convert it to binary and arrange it into 16 rows, you will see the outline of a Chinese character.
Well, I won't write anymore... It's really tiring to do original work!!!!!
No one is replying, huh!



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.
Floor 4 Posted 2003-10-02 00:00 ·  中国 陕西 西安 教育网
高级用户
★★
OS/2女孩
Credits 639
Posts 183
Joined 2003-06-14 00:00
23-year member
UID 5148
Gender Female
Status Offline
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.
REM 喜欢DOS,因为它的简单
REM 喜欢OS/2,因为它不再矫饰
REM 喜欢BASIC,因为它并不幼稚
REM 喜欢GNU,因为它杂乱无章
Floor 5 Posted 2003-10-02 00:00 ·  中国 陕西 西安 教育网
高级用户
★★
OS/2女孩
Credits 639
Posts 183
Joined 2003-06-14 00:00
23-year member
UID 5148
Gender Female
Status Offline
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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
REM 喜欢DOS,因为它的简单
REM 喜欢OS/2,因为它不再矫饰
REM 喜欢BASIC,因为它并不幼稚
REM 喜欢GNU,因为它杂乱无章
Floor 6 Posted 2003-10-02 00:00 ·  中国 福建 福州 电信
元老会员
★★★
农民
Credits 2,903
Posts 991
Joined 2003-07-23 00:00
22-year member
UID 7391
Gender Male
From 福建省
Status Offline
Support!Dude, if you have original posts, I'll definitely reply.
艰难奋长戟,万古用一夫

中国DOS联盟 http://www.cn-dos.net 欢迎大家来共同学习
我的MSN&E-Mail cn_archer@hotmail.com QQ 56049418
Floor 7 Posted 2003-10-03 00:00 ·  中国 湖北 武汉 联通
银牌会员
★★★
Credits 1,681
Posts 512
Joined 2003-08-02 00:00
22-year member
UID 7953
Gender Male
Status Offline
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
Somehow somewhere I've got to choose.
No matter if it is win or lose.
Floor 8 Posted 2003-10-04 00:00 ·  中国 陕西 西安 教育网
高级用户
★★
OS/2女孩
Credits 639
Posts 183
Joined 2003-06-14 00:00
23-year member
UID 5148
Gender Female
Status Offline
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??)
REM 喜欢DOS,因为它的简单
REM 喜欢OS/2,因为它不再矫饰
REM 喜欢BASIC,因为它并不幼稚
REM 喜欢GNU,因为它杂乱无章
Floor 9 Posted 2003-10-08 00:00 ·  中国 湖北 武汉 联通
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
The following is a quote from lemonhall on 2003-10-2 18:17:46:
Support original works, but these source programs all have source code in DOS, and
QB45, I understand your mood of liking BASIC. But, translating many C source codes
into QB code seems a bit...

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.
Floor 10 Posted 2003-10-08 00:00 ·  中国 河北 石家庄 桥西区 联通
中级用户
★★
疯狂的流浪者
Credits 276
Posts 56
Joined 2003-09-25 00:00
22-year member
UID 10329
Gender Male
Status Offline
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!
临河居士
http://www.xygod.pc5.org
Floor 11 Posted 2003-10-13 00:00 ·  中国 湖北 武汉 联通
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
The following is the statement of pfox on 2003-9-30 10:01:51:
There are some simplified Chinese character libraries with 16*15 dot matrix character libraries. Can a program be made to extract the 16 - bit dot matrix information of the 16*15 dot matrix character library? It is best to be able to provide both 16 - bit and 2 - bit extraction methods.

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?
Floor 12 Posted 2003-10-14 00:00 ·  中国 广东 汕头 电信
银牌会员
★★★
Credits 1,451
Posts 446
Joined 2002-10-20 00:00
23-year member
UID 29
Gender Male
Status Offline
The following is a quote from QB45 on 2003-10-13 19:22:14:

I don't have a 16*15 dot matrix font here. If I did, I could try it. Can you provide this font?



Open attachmentOpen attachment

This is the 16*15 dot matrix font. Please try it.
Floor 13 Posted 2003-10-14 00:00 ·  中国 湖北 武汉 联通
高级用户
★★
Credits 677
Posts 194
Joined 2003-09-13 00:00
22-year member
UID 9778
Gender Male
Status Offline
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
Floor 14 Posted 2003-10-14 00:00 ·  中国 香港
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
The following is a quote from QB45 on 2003-10-13 19:22:14:
I don't have a 16*15 dot matrix font here. If I did, I could try it. Can you provide this font?
This is a 16*15 (or is it 14*14?) dot matrix font of the et3 Chinese system Open the attachment
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Floor 15 Posted 2003-10-14 00:00 ·  中国 香港
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
This is the 16*15 font of Zhenhan Chinese System Open attachment
This is the 16*16 font of Lujin Chinese System Open attachment
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Forum Jump: