|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
|
2007-3-25 09:00 |
|
|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
|
2007-3-25 12:07 |
|
|
本是
银牌会员
    
积分 2221
发帖 789
注册 2005-1-27
状态 离线
|
『第 258 楼』:
使用 LLM 解释/回答一下
我查了UCWIN带的HZK16.GBK,发现它不是按照公式
“(ch1-0x81)*190+(ch2-0x40)-(ch2/128)”来计算的!
那是生成GBK码本的汉字顺序,不是字库中的排列顺序。
GBK字库是分区存放的!它为了兼容GB2312的HZK16,先原序存放1~94区,
然后另分3个区域存放扩充部分,详情见下面的列表:
GBK字符集范围
相当于
“GB区位码” 分区 高位 || 低位
—————————————————————————————
1~94区 ●GB汉字: A1~FE || A1~FE
— — — — — — — — — — — — — — —
95~126区 ●扩充汉字: 81~A0 || A1~FE
127~159区 ●扩充汉字: 81~A0 || 40~A0
159+~254+区●扩充汉字: A1~FE || 40~A0
—————————————————————————————
我观察下来好像就是这个顺序。不过,你再核对一下,确认无误后才能开始调整你的程序。
我困了,要睡了~~~
I checked the HZK16.GBK that comes with UCWIN and found that it is not calculated according to the formula "(ch1-0x81)*190+(ch2-0x40)-(ch2/128)"! That is the order of Chinese characters for generating the GBK codebook, not the arrangement order in the font. The GBK font is stored in partitions! In order to be compatible with the HZK16 of GB2312, it first stores areas 1 to 94 in the original order, and then stores the extended parts in 3 other areas. For details, see the following list:
GBK character set range
Equivalent to
"GB area code" Partition High || Low
—————————————————————————————
Areas 1~94 ●GB Chinese characters: A1~FE || A1~FE
— — — — — — — — — — — — — — —
Areas 95~126 ●Extended Chinese characters: 81~A0 || A1~FE
Areas 127~159 ●Extended Chinese characters: 81~A0 || 40~A0
Areas 159+~254+ ●Extended Chinese characters: A1~FE || 40~A0
—————————————————————————————
It seems that this is the order when I observed. However, you can check it again. Only after confirming it is correct can you start adjusting your program. I'm sleepy, going to sleep~~~
|

my major is english----my love is dos----my teacher is the buddha----my friends--how about U |
|
2007-3-25 14:48 |
|
|
jb88
新手上路

积分 18
发帖 8
注册 2006-11-12
状态 离线
|
|
2007-3-25 22:49 |
|
|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
『第 260 楼』:
使用 LLM 解释/回答一下
Originally posted by 本是 at 01:48 AM:
我查了UCWIN带的HZK16.GBK,发现它不是按照公式
那是生成GBK码本的汉字顺序,不是字库中的排列顺序。
GBK字 ...
头大,懒得去研究了,搞这么麻烦到时读取也麻烦!干脆就用
“(ch1-0x81)*190+(ch2-0x40)-(ch2/128)”来定位算了,
给字库起个新名字:GBK顺序字库,以前的则为兼容字库。
Originally posted by 本是 at 01:48 AM:
I checked the HZK16.GBK that comes with UCWIN and found that it is not according to the formula
That is the order of Chinese characters for generating the GBK codebook, not the arrangement order in the font.
GBK characters ...
Headache, too lazy to study, it's so complicated that reading will be troublesome later! Just use
“(ch1-0x81)*190+(ch2-0x40)-(ch2/128)” to locate it,
Give the font a new name: GBK order font, and the previous one is the compatible font.
|
|
2007-3-26 02:17 |
|
|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
『第 261 楼』:
使用 LLM 解释/回答一下
你试试用上述代码来读取我生成的那个GBK字库看看成功没?
You try to use the above code to read the GBK font library I generated to see if it succeeded?
|
|
2007-3-26 02:27 |
|
|
qingyangecho
初级用户
 
积分 97
发帖 40
注册 2006-11-1
状态 离线
|
『第 262 楼』:
使用 LLM 解释/回答一下
Originally posted by download at 2007-3-25 12:52 AM:
不开源,捆绑N个流氓插件,再加收注册费每台机50元 ^_^
嗯,鼓掌,中国未来的比而盖次
Originally posted by download at 2007-3-25 12:52 AM:
Not open source, bundles N rogue plugins, and charges a registration fee of 50 yuan per machine ^_^
Hmm, applause, the future Bill Gates of China
|
|
2007-3-26 02:36 |
|
|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
『第 263 楼』:
使用 LLM 解释/回答一下
Originally posted by 本是 at 01:48 AM:
我查了UCWIN带的HZK16.GBK,发现它不是按照公式
“(ch1-0x81)*190+(ch2-0x40)-(ch2/128)”来计算的!
那是生成GBK码本的汉字顺序,不是字库中的排列顺序。
GBK字 ...
前面的兼容区似乎是94/96个汉字每区,而不是190,这样排起来还真麻烦
Originally posted by Ben Shi at 01:48 AM:
I checked the HZK16.GBK that comes with UCWIN and found that it is not calculated according to the formula
"(ch1-0x81)*190+(ch2-0x40)-(ch2/128)"!
That is the order of Chinese characters in generating the GBK codebook, not the arrangement order in the font library.
GBK characters...
The previous compatible area seems to have 94/96 Chinese characters per area, not 190. It's really troublesome to arrange like this
|
|
2007-3-26 04:20 |
|
|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
『第 264 楼』:
使用 LLM 解释/回答一下
Originally posted by qingyangecho at 01:36 PM:
嗯,鼓掌,中国未来的比而盖次
比尔没什么好羡慕的,劳累过多,
近况看起来比实际岁数老太多
还是继续当我的处男实在一些……
Originally posted by qingyangecho at 01:36 PM:
Well, applause, the future Bill Gates of China
Bill is not something to envy, overworked too much,
The current situation looks much older than the actual age
It's more practical to continue being my virgin...
|
|
2007-3-26 04:22 |
|
|
本是
银牌会员
    
积分 2221
发帖 789
注册 2005-1-27
状态 离线
|
『第 265 楼』:
使用 LLM 解释/回答一下
Originally posted by download at 2007-3-26 02:27:
你试试用上述代码来读取我生成的那个GBK字库看看成功没?
我已经用字库显示程序浏览过,与GBK.TXT中的顺序
(公式“(ch1-0x81)*190+(ch2-0x40)-(ch2/128)”)是一致的。
但是,每个汉字的字模顺序是可载入VGA文本字模的格式,
即左右各16字节的单字节式,不是普通汉字库的双字节式!!!
所以,这样生成的字库不是通用字库!
建议:调整为单个汉字为双字节格式,整个字库为通用汉字库格式。
Originally posted by download at 2007-3-26 02:27:
Can you try using the above code to read the GBK font I generated and see if it works?
I have browsed it with the font display program, and it is consistent with the order in GBK.TXT
(formula "(ch1-0x81)*190+(ch2-0x40)-(ch2/128)").
However, the font pattern order of each Chinese character is in the format that can be loaded into VGA text fonts,
that is, a single-byte type with 16 bytes on the left and right, not the double-byte type of ordinary Chinese fonts!!!
Therefore, the font library generated in this way is not a universal font library!
Suggestion: Adjust to a double-byte format for a single Chinese character, and the entire font library to a universal Chinese font library format.
|

my major is english----my love is dos----my teacher is the buddha----my friends--how about U |
|
2007-3-26 05:22 |
|
|
hnlyzhd
高级用户
   
积分 544
发帖 164
注册 2004-10-17
状态 离线
|
|
2007-3-26 06:17 |
|
|
本是
银牌会员
    
积分 2221
发帖 789
注册 2005-1-27
状态 离线
|
『第 267 楼』:
使用 LLM 解释/回答一下
Originally posted by 本是 at 2007-3-26 05:22:
建议:调整为...整个字库为通用汉字库格式。
通用HZK16.GBK库
以32字节为单位的记录号计算方法如下
(假设汉字高位在ch1,低位在ch2中):
if ch1>A0h then
if ch2>A0h then '1-94:A1~FE || A1~FE
rec=(ch1-A1h)*94+(ch2-A1h)
else '159-254:A1~FE || 40~A0
rec=94*94+31*94+31*96+(ch1-A1h)*96+(ch2-40h) -(ch2/128)
endif
else
if ch2>A0h then '95-126:81~A0 || A1~FE
rec=94*94+(ch1-81h)*94+(ch2-A1h)
else '127-159:81~A0 || 40~A0
rec=94*94+31*94+(ch1-81h)*96+(ch2-40h) -(ch2/128)
endif
endif
Last edited by 本是 on 2007-3-26 at 09:03 AM ]
Originally posted by Ben Shi at 2007-3-26 05:22:
Suggestion: Adjust to... The entire character set is in the universal Chinese character set format.
Universal HZK16.GBK library
The calculation method of the record number in units of 32 bytes is as follows
(Assuming that the high byte of the Chinese character is in ch1 and the low byte is in ch2):
if ch1>A0h then
if ch2>A0h then '1-94:A1~FE || A1~FE
rec=(ch1-A1h)*94+(ch2-A1h)
else '159-254:A1~FE || 40~A0
rec=94*94+31*94+31*96+(ch1-A1h)*96+(ch2-40h) -(ch2/128)
endif
else
if ch2>A0h then '95-126:81~A0 || A1~FE
rec=94*94+(ch1-81h)*94+(ch2-A1h)
else '127-159:81~A0 || 40~A0
rec=94*94+31*94+(ch1-81h)*96+(ch2-40h) -(ch2/128)
endif
endif
Last edited by Ben Shi on 2007-3-26 at 09:03 AM ]
|

my major is english----my love is dos----my teacher is the buddha----my friends--how about U |
|
2007-3-26 06:29 |
|
|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
『第 268 楼』:
使用 LLM 解释/回答一下
红色部份应该是
ch2\128
The part in red should be ch2\128
|
|
2007-3-26 09:46 |
|
|
本是
银牌会员
    
积分 2221
发帖 789
注册 2005-1-27
状态 离线
|
『第 269 楼』:
使用 LLM 解释/回答一下
U R right.
|

my major is english----my love is dos----my teacher is the buddha----my friends--how about U |
|
2007-3-26 09:49 |
|
|
download
初级用户
 
积分 199
发帖 101
注册 2007-3-13
状态 离线
|
『第 270 楼』:
使用 LLM 解释/回答一下
公式不对,有重码。
The formula is incorrect, and there are duplicate codes.
|
|
2007-3-26 11:46 |
|