LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2747|回复: 16

[个人集]--Linux Registered User #268471

[复制链接]
发表于 2003-7-2 22:55:08 | 显示全部楼层 |阅读模式



http://ccns.ncku.edu.tw/~jimchyun/


http://ccns.ncku.edu.tw/~jimchyun/dillo/

[上有Dillo的patch,及支持中文的Dillo浏览器...]


  1. FROM: goodguy.csie.ncku.edu.twDATE: 11/28/2001

  2. 00:31:50SUBJECT:  [Dillo-dev][patch] Let Dillo display Traditional

  3. Chinese pages. Hi, all:

  4.    
  5.     I am a new user to Dillo Web Browser from Taiwan. I found it really
  6. nice for searching or browser. However, I also noticed that Dillo couldn't
  7. display Chinese Web page well, resulting from the fact that Dillo is not
  8. built in the manner of i18n programming paradigm.

  9.     So, I did a patch to Dillo to let Dillo support Traditional Chinese
  10. (the language used widely in Taiwan) display and its encoding, Big-5.
  11. As follows:

  12. in src/dw_style.c:

  13. static void Dw_style_font_realize (DwStyleFont *font, gboolean try_all)
  14. {
  15.         char fontname[256], *ItalicChar;

  16.         ItalicChar = prefs.use_oblique ? "o" : "i";
  17.         sprintf (fontname,
  18.                         "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1",
  19.                         font->name,
  20.                         font->bold ? "bold" : "medium",
  21.                         font->italic ? ItalicChar : "r",
  22.                         font->size);
  23. ++      strcat (fontname,
  24. ++                      ",-arphic technology co.-ar pl mingti2l big5"
  25. ++                      "-medium-r-normal-*-*-160-*-*-c-*-big5-0");
  26. --      font->font = gdk_font_load(fontname);
  27. ++      font->font = gdk_fontset_load(fontname);

  28. Here, I suppose that Taiwan Linux users all have "ar pl mingti2l big5"
  29. font provided by Arphic Technology. It seems to be stupid but it works
  30. like this:

  31.     [url]http://ccns.ncku.edu.tw/~jimchyun/misc/dillo-big5.jpg[/url]

  32. Regards,
  33. Jim Huang
复制代码


http://www.geocrawler.com/archives/3/702/2001/11/0/7184841/
发表于 2003-7-3 13:19:50 | 显示全部楼层
只在iPAQ中用过dillo,应该是很小巧的。
 楼主| 发表于 2003-7-3 13:33:53 | 显示全部楼层
Dillo是很小的一个浏览器,编译好了整个程序只有265 KB! ....

因我的机子旧,所以我特喜欢这个浏览器的

它的缺点是不提供传统浏览器应有的东西

它太简单了。。。。

也是在不断改进中。。。。。



http://www.dillo.org/
发表于 2003-7-3 14:03:45 | 显示全部楼层
中文版有没有更新一些的版本?
 楼主| 发表于 2003-7-3 14:24:22 | 显示全部楼层
参考前面的内容修改
src/dw_style.c

文件,就可以支持中文了......
发表于 2003-7-4 21:39:22 | 显示全部楼层
我patch了一下
感觉挺好的
就是cookie好像存不了,再就是浏览这里的时候好像很容易core dump

这个dillo用来看文档倒是真不错。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2003-7-4 21:48:07 | 显示全部楼层
我的patch部分。。

英文字体保持原样,中文需要simsun支持

patch -p0 < dillo-cn.txt
  1. --- src/dw_style.c        2003-04-15 12:16:12.000000000 -0700
  2. +++ src-patch/dw_style.c        2003-07-04 06:47:35.000000000 -0700
  3. @@ -245,42 +245,42 @@
  4.     char fontname[256], *ItalicChar;
  5.     ItalicChar = prefs.use_oblique ? "o" : "i";
  6. -   sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1",
  7. +   sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1,-*-simsun-medium-*-*-*-12-*-*-*-*-*-gbk-0",
  8.              font->name,
  9.              font->bold ? "bold" : "medium",
  10.              font->italic ? ItalicChar : "r",
  11.              font->size);
  12. -   font->font = gdk_font_load (fontname);
  13. +   font->font = gdk_fontset_load (fontname);
  14.     if (font->font == NULL && font->italic) {
  15. -      sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1",
  16. +      sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1, -*-simsun-medium-*-*-*-12-*-*-*-*-*-gbk-0",
  17.                 font->name,
  18.                 font->bold ? "bold" : "medium",
  19.                 (*ItalicChar == 'o') ? "i" : "o",
  20.                 font->size);
  21. -      font->font = gdk_font_load (fontname);
  22. +      font->font = gdk_fontset_load (fontname);
  23.     }
  24.     if (try_all) {
  25.        if (font->font == NULL) {
  26.           /* Can't load the font - substitute the default instead. */
  27.           font->font =
  28. -            gdk_font_load
  29. -            ("-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1");
  30. +            gdk_fontset_load
  31. +            ("-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1,-*-simsun-medium-*-*-*-12-*-*-*-*-*-gbk-0");
  32.        }
  33.        if (font->font == NULL) {
  34.           /* Try another platform-font that should be available. (iPaq) */
  35.           font->font =
  36. -            gdk_font_load
  37. -            ("-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1");
  38. +            gdk_fontset_load
  39. +            ("-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1,-*-simsun-medium-*-*-*-12-*-*-*-*-*-gbk-0");
  40.        }
  41.        if (font->font == NULL) {
  42.           /* Can't load any suitable font!  */
  43.           g_warning ("Can't load any ISO8859-1 font!?! :(");
  44.           font->font =
  45. -            gdk_font_load ("-adobe-helvetica-*-*-*--*-*-*-*-*-*-*-*");
  46. +            gdk_fontset_load ("-adobe-helvetica-*-*-*--*-*-*-*-*-*-*-*, -*-simsun-medium-*-*-*-12-*-*-*-*-*-gbk-0");
  47.        }
  48.     }
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2003-7-4 21:54:42 | 显示全部楼层
你的patch是哪个版本的?
发表于 2003-7-4 22:01:28 | 显示全部楼层
0.7.2
不过没找到选择encoding的地方,也懒得再研究了
发表于 2003-7-5 09:50:52 | 显示全部楼层
要用gtk1.2, 我放弃了
等到出gtk2.*的吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表