Help,thanks.

Moderators: Lone_Rifle, unlinux

leiting
Posts: 15
Joined: Sun Jun 11, 2006 4:01 am

Help,thanks.

Post by leiting »

怎么在ROS里显示中文?不用汉化,只要显示中文就行了.我在SUPPORT里发帖问过,回应是:
That is becoset or font does not support chinese sign or some others. dejavu font does. and some other 3 party font. if u delete ros current font and install a 3 party font u will see chinese sign. We need figout how we should implement dejavu font in ros without regress in cmd, and cmd apps. for the font are to big in the size even we are using same size. we need fixed font size and chater size like 8x8.
也不大看的懂,个人人为,在系统里是不应该有个定义每个字符ASCII值的程序或者什么的,反正要显示汉语应该怎么弄啊?
billyswong
Posts: 55
Joined: Tue Nov 29, 2005 7:20 pm
Location: Hong Kong, China

Post by billyswong »

這一段英文大意是說中文顯示關乎字體問題,要解決只需把ROS的字體換成懂中文的字體就可以了。他們打算加入dejavu字體,可是cmd.exe卻會因此出事,因為字粒太大...
leiting
Posts: 15
Joined: Sun Jun 11, 2006 4:01 am

Post by leiting »

哦,那有没有简单挂接字库的办法呢?现在,没有人有支持汉显的ROS么
billyswong
Posts: 55
Joined: Tue Nov 29, 2005 7:20 pm
Location: Hong Kong, China

Post by billyswong »

不知道,其實我一直未測試過ROS...(汗)

不過我想應該大概和Windows差不多,在"\ReactOS\Fonts\"裡頭加進去吧
Larryli
Posts: 27
Joined: Sun Dec 19, 2004 3:19 pm
Location: Wuhan, China
Contact:

Post by Larryli »

很早的时候,我就使用 simsun 字体实现过 ros 的中文显示,改动量很小。
应该说 win32 的体系本身就很好的支持中文问题,虽然相关的 API 都没有完全实现。
现在,能够自由使用的符合版权规定的中文字体很少,我一直在等待文泉驿字体项目。
leiting
Posts: 15
Joined: Sun Jun 11, 2006 4:01 am

Post by leiting »

billyswong wrote:不知道,其實我一直未測試過ROS...(汗)

不過我想應該大概和Windows差不多,在"\ReactOS\Fonts"裡頭加進去吧
在ReactOS下并没有Fonts目录,而且新建Fonts目录并把XP的字体文件都拷过去也没用,还是不支持.
billyswong
Posts: 55
Joined: Tue Nov 29, 2005 7:20 pm
Location: Hong Kong, China

Post by billyswong »

查啊查...
http://svn.reactos.org/svn/reactos/bran ... sion=21881

Code: Select all

[Directories]
6 = media\fonts
原來ReactOS把fonts搬到了media裡面......
Larryli
Posts: 27
Joined: Sun Dec 19, 2004 3:19 pm
Location: Wuhan, China
Contact:

Post by Larryli »

leiting wrote:
billyswong wrote:不知道,其實我一直未測試過ROS...(汗)

不過我想應該大概和Windows差不多,在"\ReactOS\Fonts"裡頭加進去吧
在ReactOS下并没有Fonts目录,而且新建Fonts目录并把XP的字体文件都拷过去也没用,还是不支持.
安装字体不是简单的复制,需要在注册表里登记相关信息,特别是ttf字体是有字符集映射的,必须告诉系统这个字体可以显示哪些字符。这样才能使用字体。
HomePage: http://larryli.51.net [url=tencent://message/?uin=203138&Site=reactos.org&Menu=yes]QQ 203138[/url]
leiting
Posts: 15
Joined: Sun Jun 11, 2006 4:01 am

Post by leiting »

在系统里有没有哪个文件是规定ASCII字符与字的对应关系的?
Larryli
Posts: 27
Joined: Sun Dec 19, 2004 3:19 pm
Location: Wuhan, China
Contact:

Post by Larryli »

tools/unicode/c_936.c 是 GBK 和 Unicode 的转换表。
系统使用是 system32/c_936.nls 需要在注册表里登记。
字体安装和本地化资源显示都需要设置这个。
HomePage: http://larryli.51.net [url=tencent://message/?uin=203138&Site=reactos.org&Menu=yes]QQ 203138[/url]
leiting
Posts: 15
Joined: Sun Jun 11, 2006 4:01 am

Post by leiting »

tools/unicode/c_936.c这个文件,为什么全是 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
这类字符?这个怎么用啊??
Larryli
Posts: 27
Joined: Sun Dec 19, 2004 3:19 pm
Location: Wuhan, China
Contact:

Post by Larryli »

呵呵,两个转码表前面当然顺序对照的。
因为 GBK 兼容 ASCII,Unicode 也算是兼容 ASCII(从 8 位扩展到 16 位)。
所以 GBK 和 Unicode 转码表的开始部分,也就是 ASCII 部分是按顺序一一对应。
而汉字的转码就不是一一对应。对于 Unicode 转 GBK 直接查表即可,GBK 转 Unicode 则首先要对 GBK 两个字节进行顺序计算后再查表。

前段时间看到一篇文档写的当年实际上有两套国际字符集处理方案,分别由 ISO 和 Unicode 组织主导,Unicode 基本是厂商联盟。中国人参与的方案是 ISO 主导的,也就是说当年 ISO 的国际字符集和 GBK 有某种程度的兼容,也就是一一对应(我以前也似乎在某个报纸上看到过相关的报道)。而 Unicode 的参与有日韩政府和台湾,属于另一阵营。最后 ISO 选择和 Unicode 融合,也就是直接采用了 Unicode 的方案。所以目前的 Unicode 和 JIS KSC BIG5 存在一定对应关系,和 GBK 基本是乱序。据说 GB18030 和当年中国在 ISO 提出的方案有一定继承性。

不管怎样,个人认为 Unicode 已经是事实上和现实上的标准。大多数操作系统都是在内部以 Unicode(或变种,如 UTF-8)实现,而在表现层面使用另一种字符集来处理。中间采用转码。而 c_936.c 就是用来实现这个转换。
ReactOS 也就是 Windows NT 内部是使用 Unicode 的。
所以 ReactOS 本身并不存在中文显示和处理的问题。
HomePage: http://larryli.51.net [url=tencent://message/?uin=203138&Site=reactos.org&Menu=yes]QQ 203138[/url]
Larryli
Posts: 27
Joined: Sun Dec 19, 2004 3:19 pm
Location: Wuhan, China
Contact:

Post by Larryli »

载入 TTF 字体文件大小被限制在 4096K 以内了,也就是说不能像我以前那次一样使用 win98 的 simsun.ttf 字体做试验。
而现在符合版权需要的 fireflysung.ttf 比 simsun.ttf 还要大,有 15M。
另外一个 wqy-bsong.ttf 只有 3M 但是文泉驿现在还只有 9,10,11,12pt 点阵字体,而且这个 ttf 的 Charset 设置有问题,在 ros 中显示为朝鲜语,而不是简体中文的 GB2312。

测试中文字体实际很简单,因为现在的 ros 已经可以自动遍历 media/fonts 目录,用 UltraISO 之类的编辑软件把字体放入 reactos/media/fonts 用虚拟机测试就可以。可以使用 notepad 的字体设置对话框。

怀疑是在 TTF 载入程序 subsystem\win32\win32k\objects\text.c 中的问题。
里面多次出现了我经过多次测试出来的 0x4000 这个立即数(恰好有两个字体文件大小分别是 4047K 和 4131K)。

找不到能用的中文 TTF 字体,始终不能完成中文显示的问题。。。
HomePage: http://larryli.51.net [url=tencent://message/?uin=203138&Site=reactos.org&Menu=yes]QQ 203138[/url]
Larryli
Posts: 27
Joined: Sun Dec 19, 2004 3:19 pm
Location: Wuhan, China
Contact:

Post by Larryli »

使用 wqy-bsong.ttf 截图:

[ external image ]

http://wenq.org 下载的 0.70 ttf(不能在 Windows XP 使用)。
修改了一下 subsystems/win32/win32k/objects/text.c 的 FontFamilyFillInfo() 函数
在最后部分:

Code: Select all

              if (DEFAULT_CHARSET != CharSetInfo.ciCharset)
                {
                  Info->EnumLogFontEx.elfLogFont.lfCharSet = CharSetInfo.ciCharset;
                  if (NULL != ElfScripts[i])
                    {
                      wcscpy(Info->EnumLogFontEx.elfScript, ElfScripts[i]);
                    }
                  else
                    {
                      DPRINT1("Unknown elfscript for bit %d\n", i);
                    }
                  //???
                  if (CharSetInfo.ciCharset == GB2312_CHARSET)
                    {
					  break;
                    }
                  //???
                }
//??? 之间是增加的代码,原因是 wqy-bsong 包含有 CJK 三个代码集,而当前的 ros 一个字体只能使用一个代码集。为了避免后面的 Hangul(Johab) 冲掉前面的 CHINESE_GB2312 在发现 GB2312 就退出循环。
HomePage: http://larryli.51.net [url=tencent://message/?uin=203138&Site=reactos.org&Menu=yes]QQ 203138[/url]
Larryli
Posts: 27
Joined: Sun Dec 19, 2004 3:19 pm
Location: Wuhan, China
Contact:

Post by Larryli »

设置 CodePage 启动出错。
boot/bootdata/hivesys.inf

HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","ACP",0x00000000,"936"

Code: Select all

A problem has been detected and ReactOS has been shut down to prevent damage to 
your computer.

The problem seems to be caused by the following file: ntoskrnl.exe

KMODE_EXCEPTION_NOT_HANDLED

Technical information:

*** STOP: 0x0000001E (0xc0000005,0x8005d77b,0x00000000,0x006b4001)

***    ntoskrnl.exe - Address 0x8005d77b base at 0x80000000, DataStamp 0x0

Page Fault Exception: 14(0)
Processor: 0 CS:EIP 8:8005d77b <ntoskrnl.exe: 5d77b>
cr2 806b4001 cr3 26000 Proc: 80804c20 Pid: 4 <System> Thrd: 80805660 Tid: 0
DS 23 ES 23 FS 30 GS 0
EAX: 00000000   EBX: 0034c23e   ECX: 806b4001
EDX: ff9e81dd   EBP: 80097ba0   ESI: 8061f220   ESP: 80097b0c
EDI: 80097b9c   EFLAGS: 00200297 kESP 80097b0c kernel stack base 80095000
Frames:
<ntoskrnl.exe: 61088>
<ntoskrnl.exe: 6294c>
<ntoskrnl.exe: 2545c>
<ntoskrnl.exe: 70fc5>
<ntoskrnl.exe: 45fa>
<ntoskrnl.exe: 6f529>
<0>
HKLM,"SYSTEM\CurrentControlSet\Control\NLS\CodePage","OEMCP",0x00000000,"936"

Code: Select all

A problem has been detected and ReactOS has been shut down to prevent damage to 
your computer.

The problem seems to be caused by the following file: ntoskrnl.exe

KMODE_EXCEPTION_NOT_HANDLED

Technical information:

*** STOP: 0x0000001E (0x80000003,0x8005cca1,0x80096d9c,0x80004433)

***    ntoskrnl.exe - Address 0x8005cca1 base at 0x80000000, DataStamp 0x0

Exception: -1160049408(0)
Processor: 0 CS:EIP 8:8005cca1 <ntoskrnl.exe: 5cca1>
cr2 8d3ba000 cr3 26000 Proc: 80804c20 Pid: 4 <System> Thrd: 80805660 Tid: 0
DS 23 ES 23 FS 30 GS 0
EAX: 00000000   EBX: 80082c3f   ECX: 00000000
EDX: 00000000   EBP: 80096e70   ESI: 80096fac   ESP: 80096df4
EDI: 80096ef4   EFLAGS: 00200286 kESP 80096df4 kernel stack base 80095000
Frames:
<ntoskrnl.exe: 5dc11>
<ntoskrnl.exe: 62707>
<ntoskrnl.exe: 66963>
<cdfs.sys: 2bcb>
<cdfs.sys: 2f77>
<cdfs.sys: 14db>
<ntoskrnl.exe: 1c6d4>
<ntoskrnl.exe: 2c13d>
<ntoskrnl.exe: 2d289>
<ntoskrnl.exe: 57277>
<ntoskrnl.exe: 1931d>
<ntoskrnl.exe: 73031>
<ntoskrnl.exe: 70fd8>
<ntoskrnl.exe: 45fa>
<ntoskrnl.exe: 6f529>
<0>
HomePage: http://larryli.51.net [url=tencent://message/?uin=203138&Site=reactos.org&Menu=yes]QQ 203138[/url]
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests