中国DOS联盟论坛

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-08-26 11:40
47,812 topics / 349,910 posts / today 0 new / 48,264 members
DOS汉化世界 & 中文系统 (中文化室) » Source code for Chinese character display program with curved font libraries for UCDOS version 5.0 and above
Printable Version  4,103 / 4
Floor1 lhsong Posted 2009-02-05 22:14
初级用户 Posts 12 Credits 47
If the font library is version 5.0, the following piece of code should be removed


Hope everyone can like it!!!!!!!

Floor2 lidawei Posted 2009-02-18 12:49
新手上路 Posts 3 Credits 6
Recently, out of whim, I started looking at UCDOS's rdfnt.com. Although the knowledge of DOS has been neglected for many years, and the information from back then is basically impossible to look up because it has been put aside (it seems I didn't have any UCDOS materials back then, and now I can't find things like the UCDOS system call specifications even after searching Google for a few days), I still spent several days looking at it out of interest. I mainly looked at the dot matrix font library, and only looked at the part where control codes are converted to coordinates in PS. Although I didn't finish reading it, I once again marveled at the delicacy of assembly programs. A program of about 30KB, among which there are more than 10KB of working storage areas, 4-5KB of various font library parameter definitions, and the instruction part is estimated to be only more than 10KB. Such a short program can complete operations such as retrieval, matching, decoding, and transformation of dot matrix, vector, and PS font libraries, which is really admirable.

I happened to see the post of the thread starter and want to talk about a little bit of my own opinion.

The beginning of the article has

If the font library is version 5.0, the following segment of code should be removed
 if(j==1){ //If it is a Chinese character, adjust the address offset value
  hz.offset-=0x10000000;
 }

According to my understanding, the offset of Chinese character data should not be subtracted by 0x10000000. This offset should actually be only 24 bits, that is, 3 bytes. The 4th byte does not define the offset, but the additional format of this Chinese character data. There is an operation in a process not far from the acquisition of the Chinese character dot matrix function entered from int 7eh into rdfnt:
 mov   ax,es: The lower word of the offset of the just-read 6-byte PS or vector data
 mov   dx,es: The higher word of the offset of the PS or vector data
 mov   cx,es: Length
 jcxz   ...
 or     zk_type,dh
 mov   dh,0     Clear the highest byte of the data pointer, leaving 3 bytes
...
 call   read_hz    Move the file pointer, dx, ax = offset, read the file, read cx bytes into ds:di
It can be seen that the highest byte of the 4 bytes is not used for addressing, but for defining information. In addition to reading the dot matrix font library and decoding the PS font library, rdfnt can also decode the vector font library. For different PS and vector font libraries, it is possible that this byte of some font libraries is not 0x10 (I haven't checked each Chinese character of each font library one by one, so I can't confirm). If this fixed value is subtracted from all, it may go wrong.

There is an article called "Analysis of UCDOS's Curve Outline Font Library", which also mentions that the offset in ucdos6 should be subtracted by 0x10000000. I wonder if the subtraction of 0x10000000 here by the thread starter is derived from that place?
Floor3 lhsong Posted 2009-02-21 21:16
初级用户 Posts 12 Credits 47
Thanks to the guidance from the person above,

The value "0x10000000" indeed comes from the article "Analysis of the Curve Outline Font Library of UCDOS", but I checked the 5.0 font library and the 6.0 font library, and it is true that a definition was added in the fourth byte of the 6.0 curve font library, but I don't know its actual use.

Still hope that the experts can give guidance.
Floor4 oookkk2008 Posted 2009-04-17 01:53
新手上路 Posts 2 Credits 5
Okay, learned it, thank you
Floor5 chenyucheng Posted 2023-08-01 10:16
初级用户 Posts 70 Credits 152 From 浙江省台州市

What is this?
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023