<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jjgod / blog &#187; Browsers</title>
	<atom:link href="http://blog.jjgod.org/category/browsers/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jjgod.org</link>
	<description>Random notes by Jjgod Jiang.</description>
	<lastBuildDate>Sat, 07 Aug 2010 08:08:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Web 字体的出路在哪里？</title>
		<link>http://blog.jjgod.org/2009/04/22/web-fonts/</link>
		<comments>http://blog.jjgod.org/2009/04/22/web-fonts/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 08:59:03 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[fonts]]></category>

		<guid isPermaLink="false">http://blog.jjgod.org/?p=407</guid>
		<description><![CDATA[浏览器直接可用的 Web 字体在去年被重新提起，可是没过一段时间就沉寂下去，最近一期 A List Apart 上 Jeffrey Zeldman 采访 David Berlow 的这篇 Real Fonts on the Web 又引起了新一轮的讨论，这里摘录一些有趣的话。 David Berlow: How important dynamically rendered type is to design and use on the web must now be clear. In addition, the only other option—that the type industry cede its intellectual property to the public without [...]]]></description>
			<content:encoded><![CDATA[<p>浏览器直接可用的 Web 字体在去年被重新提起，可是没过一段时间就沉寂下去，最近一期 <a href="http://www.alistapart.com/">A List Apart</a> 上 Jeffrey Zeldman 采访 David Berlow 的这篇 <a href="http://www.alistapart.com/articles/realfontsontheweb">Real Fonts on the Web</a> 又引起了新一轮的讨论，这里摘录一些有趣的话。</p>

<p>David Berlow:</p>

<blockquote>
  <p>How important dynamically rendered type is to design and use on the web must now be clear. In addition, the only other option—that the type industry cede its intellectual property to the public without permission—is not going to happen.</p>
</blockquote>

<p><a href="http://talleming.com/2009/04/21/web-fonts/">Tal Leming</a>:</p>

<blockquote>
  <p>There should be a new file extension for this. I propose “.wtf” &#8211; “WebType Font”.</p>
</blockquote>

<p><a href="http://diveintomark.org/archives/2009/04/21/fuck-the-foundries">Mark Pilgrim</a>:</p>

<blockquote>
  <p>&#8230; What he fails to mention is that <em>every font-consuming application on every platform on every computer on Earth</em> will need to be “upgraded” to “respect” this permissions table. Because otherwise they’re not really permissions, are they? They’re just useless bits taking valuable chunks out of my metered bandwidth plan. Like the <a href="http://en.wikipedia.org/wiki/Bozo_bit">bozo bit</a> without the bozo.</p>
</blockquote>

<p><a href="http://www.typography.com/">Jonathan Hoefler</a>:</p>

<blockquote>
  <p>All of the type designers I know desperately want to find a way to enable people to use fonts online, and not just because we’re capitalist stooges, but because we live our lives online.</p>
</blockquote>

<p><a href="http://www.schneier.com/crypto-gram-0108.html#7">Bruce Schneier</a>:</p>

<blockquote>
  <p>Truth be told, I don’t know. I feel rather like the physicist who just explained relativity to a group of would-be interstellar travelers, only to be asked: ‘How do you expect us to get to the stars, then?’ I’m sorry, but I don’t know that, either.</p>
</blockquote>

<p>总结起来，未来还是很黑暗。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2009/04/22/web-fonts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>用来修正错误编码的文件名的 Safari 插件</title>
		<link>http://blog.jjgod.org/2009/03/04/safari-url-fix/</link>
		<comments>http://blog.jjgod.org/2009/03/04/safari-url-fix/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 12:15:49 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://blog.jjgod.org/?p=375</guid>
		<description><![CDATA[我之前讨论过一次这种文件名的错误编码，为了在浏览器下载时的不必手工修正这个问题，这里提供一个 Safari 的 SIMBL 插件: SafariURLFix。 使用步骤如下： 如果没装过，先安装 SIMBL； 下载 SafariURLFix.zip，解压后，放到 ~/Library/Application Support/SIMBL/Plugins 目录 (如果没这个目录就自己创建)； 在 Terminal 中输入: defaults write com.apple.Safari JJURLsToFix -dict newsmth.net GBK 其中 newsmth.net 为你希望应用修正的网站域名。也可以打开 ~/Library/Preferences/com.apple.Safari.plist 文件自己编辑 JJURLsToFix 这个 Dictionary，自行添加新的，见附图。 重新启动 Safari，尝试下载这样的文件，看看文件名是否被正确纠正了。 如果还有什么问题，欢迎在下面提出。]]></description>
			<content:encoded><![CDATA[<p>我之前<a href="/2008/02/17/cocoa-nsstring-decoding-error/">讨论过</a>一次这种文件名的错误编码，为了在浏览器下载时的不必手工修正这个问题，这里提供一个 Safari 的 SIMBL 插件: SafariURLFix。</p>

<p>使用步骤如下：</p>

<ol>
<li><p>如果没装过，先<a href="http://www.culater.net/software/SIMBL/SIMBL.php">安装 SIMBL</a>；</p></li>
<li><p>下载 <a href="http://jjgod.org/program/SafariURLFix.zip">SafariURLFix.zip</a>，解压后，放到 <code>~/Library/Application Support/SIMBL/Plugins</code> 目录 (如果没这个目录就自己创建)；</p></li>
<li><p>在 Terminal 中输入:</p>

<p><code>defaults write com.apple.Safari JJURLsToFix -dict newsmth.net GBK</code></p>

<p>其中 newsmth.net 为你希望应用修正的网站域名。也可以打开 <code>~/Library/Preferences/com.apple.Safari.plist</code> 文件自己编辑 <code>JJURLsToFix</code> 这个 Dictionary，自行添加新的，见附图。<img src="http://blog.jjgod.org/wp-content/uploads/2009/03/picture-3.png" alt="Edit Safari Preferences Manually" title="Edit Safari Preferences Manually" class="alignnone wp-image-382 noline" width="95%" /></p></li>
<li><p>重新启动 Safari，尝试下载<a href="http://att.newsmth.net/att.php?p.719.275418.308.png">这样</a>的文件，看看文件名是否被正确纠正了。</p></li>
</ol>

<p>如果还有什么问题，欢迎在下面提出。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2009/03/04/safari-url-fix/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to test a proxy autoconfiguration file</title>
		<link>http://blog.jjgod.org/2009/01/29/how-to-test-a-proxy-pac/</link>
		<comments>http://blog.jjgod.org/2009/01/29/how-to-test-a-proxy-pac/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 05:38:48 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM | Scripting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[gfw]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[pac]]></category>

		<guid isPermaLink="false">http://blog.jjgod.org/?p=348</guid>
		<description><![CDATA[Due to the existence of Greal Firewall, I have a terribly long proxy.pac file. Apparently, how to maintain that becomes a problem. Regularly, I use git to keep a &#8220;stable&#8221; version and make updates on it. Recently I just found the script stop working for no good reason, because the proxy server I&#8217;m using is [...]]]></description>
			<content:encoded><![CDATA[<p>Due to the existence of <a href="en.wikipedia.org/wiki/Golden_Shield_Project">Greal Firewall</a>, I have a terribly long <code>proxy.pac</code> file. Apparently, how to maintain that becomes a problem. Regularly, I use <a href="http://git-scm.com">git</a> to keep a &#8220;stable&#8221; version and make updates on it.</p>

<p>Recently I just found the script stop working for no good reason, because the proxy server I&#8217;m using is working, and I tried manually choose a proxy server (by entering its address and port into my browser directly) it also worked, so apparently there is something wrong with the script.</p>

<p>However, it has been a while since I last commit my changes to this script back to git. So there are some changes I wish to keep and I don&#8217;t want to do a binary search to find out the problem (Yep, I&#8217;m a lazy guy).</p>

<p>A few googling got me a tool called <a href="http://code.google.com/p/pactester/">pactester</a>, which turned out to be very useful. Basically it&#8217;s a Perl wrap of <a href="http://www.mozilla.org/js/spidermonkey">SpiderMonkey</a> JavaScript engine. Since the proxy autoconfiguration script is just a subset of plain JavaScript, it can safely executes that with SpiderMonkey and find out where is the problem.</p>

<p>So I installed it and did one test:</p>

<pre><code>$ pactester -p ~/Documents/Miscs/proxy.pac -u 'http://blog.iphone-dev.org'
Use of uninitialized value in numeric ne (!=) at pactester line 137.
Error: SyntaxError: missing ) after condition at line 98:
     if (dnsDomainIs(host, "cubes.fr") return "SOCKS 127.0.0.1:7777";
</code></pre>

<p>So that&#8217;s the problem. Fixed it, everything is back to normal again!</p>

<p>That&#8217;s a small tip on debugging a complex pac script, hope it helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2009/01/29/how-to-test-a-proxy-pac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pro JavaScript Techniques 的中文版上市</title>
		<link>http://blog.jjgod.org/2008/03/19/pro-javascript-techniques-chinese-ed/</link>
		<comments>http://blog.jjgod.org/2008/03/19/pro-javascript-techniques-chinese-ed/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 17:24:47 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[DOM | Scripting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.jjgod.org/2008/03/19/pro-javascript-techniques-uaodhiaaeeiedh/</guid>
		<description><![CDATA[相信熟悉 Web 设计的朋友已经了解，这本书是一本关于 JavaScript 的较有深度的书籍，中文版是由贤安 (realazy) 和我一起翻译的，中文译名是《精通 JavaScript》。 原书的价值，对于熟悉的朋友应该毋庸置疑，我们两人在翻译时也颇费了一番功夫，大致分工是我主要负责和语言特性相关的，贤安主要负责和 Web 应用相关的 (包括与 CSS 的配合)，如果有任何意见建议，欢迎致信 projsch@gmail.com，我们会将所有的更正与改进放在勘误页面上。]]></description>
			<content:encoded><![CDATA[<p>相信熟悉 Web 设计的朋友已经了解，这本书是一本关于 JavaScript 的较有深度的书籍，中文版是由贤安 (<a href="http://realazy.org/blog">realazy</a>) 和我一起翻译的，中文译名是《<a href="http://realazy.org/jspro/">精通 JavaScript</a>》。</p>

<p>原书的价值，对于熟悉的朋友应该毋庸置疑，我们两人在翻译时也颇费了一番功夫，大致分工是我主要负责和语言特性相关的，贤安主要负责和 Web 应用相关的 (包括与 CSS 的配合)，如果有任何意见建议，欢迎致信 <a href="mailto:projsch@gmail.com">projsch@gmail.com</a>，我们会将所有的更正与改进放在<a href="http://realazy.org/jspro/erratra">勘误页面</a>上。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2008/03/19/pro-javascript-techniques-chinese-ed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mozilla 2</title>
		<link>http://blog.jjgod.org/2006/12/04/mozilla-2/</link>
		<comments>http://blog.jjgod.org/2006/12/04/mozilla-2/#comments</comments>
		<pubDate>Mon, 04 Dec 2006 07:52:37 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>

		<guid isPermaLink="false">http://blog.jjgod.org/2006/12/04/mozilla-2/</guid>
		<description><![CDATA[Brendan Eich 的这篇 Mozilla 2，过了一个多月我才来看。还是有些新内容的。 现在“Mozilla”这个词比较怪，它不再指以前那个“Mozilla Suite”浏览器 (自从 SeaMonkey 分出去之后)，也不专指“Firefox”，更不仅限于“Gecko”渲染引擎 (虽然现在给 Mozilla 起的版本号还是和 Gecko 同步的)，按我的理解，指的是 Mozilla 组织这面大旗下的整个平台的统称，Web 渲染，XUL, XBL, JavaScript, XML/XSL 等许多引擎的统称，而其招牌产品就是 Firefox。 其中，Mozilla 1.9 将对应着 Firefox 3.0，其路线大致已经确定了。Brendan 讨论的是在架构上将有巨大变化的 Mozilla 2，它预期在 2008 年出现。 最引人注目的是基于 JIT 的 JavaScript 虚拟机的出现，加上改进的垃圾回收，将给 JavaScript 的效率 (在 DOM 访问和内存占用方面) 带来巨大提升，据说。同时，它支持的语言会是 ECMAScript 4 (俗称 JavaScript 2)。 其他的改进对普通用户则不大可见，比如放弃 XPCOM，而更多的依赖标准 C++ 的特性来写程序，去掉一些为了兼容性遗留的旧 API，简化代码组织，放弃 CVS [...]]]></description>
			<content:encoded><![CDATA[<p>Brendan Eich 的这篇 <a href="http://weblogs.mozillazine.org/roadmap/archives/2006/10/mozilla_2.html">Mozilla 2</a>，过了一个多月我才来看。还是有些新内容的。</p>

<p>现在“Mozilla”这个词比较怪，它不再指以前那个“Mozilla Suite”浏览器 (自从 SeaMonkey 分出去之后)，也不专指“Firefox”，更不仅限于“Gecko”渲染引擎 (虽然现在给 Mozilla 起的版本号还是和 Gecko 同步的)，按我的理解，指的是 Mozilla 组织这面大旗下的整个平台的统称，Web 渲染，XUL, XBL, JavaScript, XML/XSL 等许多引擎的统称，而其招牌产品就是 Firefox。</p>

<p>其中，Mozilla 1.9 将对应着 Firefox 3.0，其路线大致已经确定了。Brendan 讨论的是在架构上将有巨大变化的 Mozilla 2，它预期在 2008 年出现。</p>

<p>最引人注目的是基于 JIT 的 JavaScript 虚拟机的出现，加上改进的垃圾回收，将给 JavaScript 的效率 (在 DOM 访问和内存占用方面) 带来巨大提升，据说。同时，它支持的语言会是 <a href="http://weblogs.mozillazine.org/roadmap/archives/2006/05/javascript_2_ecmascript_editio.html">ECMAScript 4</a> (俗称 JavaScript 2)。</p>

<p>其他的改进对普通用户则不大可见，比如放弃 XPCOM，而更多的依赖标准 C++ 的特性来写程序，去掉一些为了兼容性遗留的<a href="http://wiki.mozilla.org/Gecko:Obsolete_API">旧 API</a>，简化代码组织，放弃 CVS 换用新的版本管理工具，等等。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2006/12/04/mozilla-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>FreeType 2.2.1 的一点测试</title>
		<link>http://blog.jjgod.org/2006/05/13/new-freetype-test/</link>
		<comments>http://blog.jjgod.org/2006/05/13/new-freetype-test/#comments</comments>
		<pubDate>Sat, 13 May 2006 09:48:28 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://jjgod.3322.org/2006/05/13/new-freetype-test/</guid>
		<description><![CDATA[最近 FreeType 2.2.1 刚刚发布，尽管由于 API 的变化 (许多内部函数被隐藏起来了)，多数的 distro 并未把系统使用的 FreeType 升级到这一版本——我相信要过很长一段时间才有可能这 么做。但使用源代码编译的版本，我做了一点小小的对比分析。 因为精力有限，只对 FreeType 2.1.10 (目前绝大多数发行版正在使用的版本) 进行了比较，试图给出基于 FreeType 的程序 (如 fontconfig) 应当如何配置字体 才能获得最好的效果的一点建议。而事实上，font rasterizer (字体光栅化工具) 必须和其他的 rasterizer 比较才能看出明显的区别来，例如 ATSUI, Win32 GDI 等等。 同时，我也只对随 Windows 附的 simsun.ttc 做了测试。如果你有兴趣，欢迎分享 更多的测试结果。 测试的截图在 flickr 上。 经过比较，我们可以给出这样一些建议： 必须打开 anti-alias，gamma 才会起作用。 gamma = 0.0 时启用 sRGB (次像素反锯齿) 模式，这种模式要比默认的 gamma = 1.0 [...]]]></description>
			<content:encoded><![CDATA[<p>最近 <a href="http://download.savannah.gnu.org/releases/freetype/">FreeType 2.2.1</a> 
刚刚发布，尽管由于 API 的变化 (许多内部函数被隐藏起来了)，多数的 distro 
并未把系统使用的 FreeType 升级到这一版本——我相信要过很长一段时间才有可能这
么做。但使用源代码编译的版本，我做了一点小小的对比分析。</p>

<p>因为精力有限，只对 FreeType 2.1.10 (目前绝大多数发行版正在使用的版本) 
进行了比较，试图给出基于 FreeType 的程序 (如 fontconfig) 应当如何配置字体
才能获得最好的效果的一点建议。而事实上，font rasterizer (字体光栅化工具) 
必须和其他的 rasterizer 比较才能看出明显的区别来，例如 ATSUI, Win32 GDI 
等等。</p>

<p>同时，我也只对随 Windows 附的 simsun.ttc 做了测试。如果你有兴趣，欢迎分享
更多的测试结果。</p>

<p>测试的截图在 <a href="http://www.flickr.com/photos/jjgod/tags/freetype/">flickr</a> 上。</p>

<p>经过比较，我们可以给出这样一些建议：</p>

<ol>
<li>必须打开 anti-alias，gamma 才会起作用。</li>
<li>gamma = 0.0 时启用 sRGB (次像素反锯齿) 模式，这种模式要比默认的 
gamma = 1.0 显示得更清晰锐利一些。</li>
<li>绝大多数情况下，打开 hinting 能达到更好的效果。</li>
<li>小于 12px 的情况下，关闭 anti-alias，打开 hinting 能使字体勉强可读，
但仍然建议绝对不要使用这么小的字体。</li>
<li>12px 以上，即 12-16px, 18px 的汉字必须使用嵌入的 bitmap。事实上，AA + 
hinting 的汉字要到 28px 以上才可以称为比较可读。</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2006/05/13/new-freetype-test/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Why Cairo?</title>
		<link>http://blog.jjgod.org/2006/04/18/why-cairo/</link>
		<comments>http://blog.jjgod.org/2006/04/18/why-cairo/#comments</comments>
		<pubDate>Mon, 17 Apr 2006 17:32:35 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://jjgod.3322.org/2006/04/18/why-cairo/</guid>
		<description><![CDATA[因为想写一个 lightweight &#38; fast 的文本布局引擎，这两天在留意一些新的图形 API。其实有些都不算很新了，像 Anti-Grain Geometry、Amanith 和 Xara。 曾被誉为“Linux 图形未来希望”的 cairo 广受诟病的是它的效率，尽管从一开始 cairo 便宣称将会利用 glitz 这样的 backend 实现硬件加速的矢量图形绘制，从而达到软件绘制无法达到的效果。结果现在戏剧性的是，cairo 比所有这些用软件绘制的引擎都慢得多。 所以才有人写了这么一篇 Why Cairo?，意思大概说得很清楚了，Mozilla 选用 cairo 的借口现在看来是非常苍白无力的，比如说 cairo 引以为傲的“bring vector graphics to print”有多少人需要把网页输出到 PDF/PS？如果最基本的页面渲染都做不到高效，谈何页面印刷的高效？ 所以我觉得啊，rendering model 好当然不错，cross-platform 性能好也很好，但 cairo 是不是中 gnome 社群的毒太深了？什么东西都来搞个 backend，结果最后每个 backend 都半死不活的，没错，也许某天 David Reveman 搞定了 xgl 腾出手来整 glitz 了，可 David Reveman 就算搞定了 [...]]]></description>
			<content:encoded><![CDATA[<p>因为想写一个 lightweight &amp; fast 的文本布局引擎，这两天在留意一些新的图形 API。其实有些都不算很新了，像 <a href="http://www.antigrain.com/">Anti-Grain Geometry</a>、<a href="http://www.amanith.org">Amanith</a> 和 <a href="http://www.xaraxtreme.org/">Xara</a>。</p>

<p>曾被誉为“Linux 图形未来希望”的 <a href="http://www.cairographics.org">cairo</a> 广受诟病的是它的效率，尽管从一开始 cairo 便宣称将会利用 glitz 这样的 backend 实现硬件加速的矢量图形绘制，从而达到软件绘制无法达到的效果。结果现在戏剧性的是，cairo 比所有这些用软件绘制的引擎都<strong>慢得多</strong>。</p>

<p>所以才有人写了这么一篇 <a href="http://weblogs.mozillazine.org/tor/archives/2006/04/why_cairo.html">Why Cairo?</a>，意思大概说得很清楚了，Mozilla 选用 cairo 的借口现在看来是非常苍白无力的，比如说 cairo 引以为傲的“bring vector graphics to print”有多少人需要把网页输出到 PDF/PS？如果最基本的页面渲染都做不到高效，谈何页面印刷的高效？</p>

<p>所以我觉得啊，rendering model 好当然不错，cross-platform 性能好也很好，但 cairo 是不是中 gnome 社群的毒太深了？什么东西都来搞个 backend，结果最后每个 backend 都半死不活的，没错，也许某天 David Reveman 搞定了 xgl 腾出手来整 glitz 了，可 David Reveman 就算搞定了 glitz，也未必能在 win32 下用啊。</p>

<p>&#8230; 今天测试的结果是，pango 用 cairo 作 backend，cairo 用 win32 backend，结果渲染一行字 (4 个字母)，要半秒钟。嗯，没看错，就是 0.5s。</p>

<p>效率还是很重要的呀，虽然某位大人物说过：</p>

<p>预优化是万恶之源。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2006/04/18/why-cairo/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Layout Engine 的文档</title>
		<link>http://blog.jjgod.org/2006/04/17/layout-engine-document/</link>
		<comments>http://blog.jjgod.org/2006/04/17/layout-engine-document/#comments</comments>
		<pubDate>Sun, 16 Apr 2006 19:57:02 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://jjgod.3322.org/2006/04/17/layout-engine-document/</guid>
		<description><![CDATA[真的是.. a mess，估计就像 pango maillist 上有的人说的，有能力使用 layout engine 的人都能够直接看 reference 写程序，没能力的都去用 GUI Toolkit 提供的 high-level API 了。 最近看的几个 layout engine 包括：Uniscribe, Graphite, Pango 和 ICU。最惨的是它们的定位和功能还不一样，有些相互之间还有牵扯。 就是这样居然还有人能把 Graphite, ICU 和 ATSUI 集成起来给 TeX 用，考虑到 TeX 还是用 WEB (Pascal 的 literate programming 版本) 语言写成的，这真是让人崇拜得五体投地的强者啊。 (看了一下强者的 biography，原来自从我出生开始就在 SIL 工作了.. 那么这样我比较不自卑一点。) 更新：看完这篇 mail，我又很高兴了]]></description>
			<content:encoded><![CDATA[<p>真的是.. a mess，估计就像 pango maillist 上有的人说的，有能力使用 layout engine 的人都能够直接看 reference 写程序，没能力的都去用 GUI Toolkit 提供的 high-level API 了。</p>

<p>最近看的几个 layout engine 包括：<a href="http://www.microsoft.com/typography/developers/uniscribe/">Uniscribe</a>, <a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&amp;cat_id=RenderingGraphite">Graphite</a>, <a href="http://www.pango.org">Pango</a> 和 <a href="http://icu.sourceforge.net/userguide/layoutEngine.html">ICU</a>。最惨的是它们的定位和功能还不一样，有些相互之间还有牵扯。</p>

<p>就是这样居然还有人能把 Graphite, ICU 和 ATSUI 集成起来<a href="http://scripts.sil.org/xetex">给 TeX 用</a>，考虑到 TeX 还是用 WEB (Pascal 的 literate programming 版本) 语言写成的，这真是让人崇拜得五体投地的<a href="http://www.unicode.org/iuc/iuc22/b051.html">强者</a>啊。</p>

<p>(看了一下强者的 biography，原来自从我出生开始就在 SIL 工作了.. 那么这样我比较不自卑一点。)</p>

<p>更新：看完这篇 <a href="http://mail.gnome.org/archives/gtk-i18n-list/2004-December/msg00010.html">mail</a>，我又很高兴了 <img src='http://blog.jjgod.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2006/04/17/layout-engine-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Segoe UI 之争</title>
		<link>http://blog.jjgod.org/2006/04/17/on-segoe-ui/</link>
		<comments>http://blog.jjgod.org/2006/04/17/on-segoe-ui/#comments</comments>
		<pubDate>Sun, 16 Apr 2006 18:26:19 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://jjgod.3322.org/2006/04/17/segoe-ui-oou/</guid>
		<description><![CDATA[Microsoft 在 (或者将在) Windows Media Center Edition, Windows Vista 和 Office 2007 中替代 Tahoma 作为界面和菜单的默认字体的就是现在看到的这个 Segoe UI。毫无疑问，它可以和 Tahoma 区分得很清楚，取代 Tahoma 的尖刻的圆角和 Trebuche MS 有几分相似——wikipedia 上是这么说的。 然而 Linotype 公司声称它与 Linotype 的 FrutigerNext 是一模一样的。看下面的对比，真的是几乎一模一样啊 (黑色的是 60pt 的 FruitigerNext，灰色的是 56pt 的 Segoe UI)： Wikipedia 上还提到，Microsoft 在 2004 年尝试在欧盟将 Segoe 和 Segoe Italic 注册为原创性字体设计，Linotype 提出了抗议，在 2006 年二月，欧盟拒绝了 Microsoft 的注册请求。Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p><img id="image129" src="http://jjgod.3322.org/wp-content/uploads/2006/04/Segoe_UI.png" alt="Segoe UI"/></p>

<p>Microsoft 在 (或者将在) Windows Media Center Edition, Windows Vista 和 Office 2007 中替代 Tahoma 作为界面和菜单的默认字体的就是现在看到的这个 Segoe UI。毫无疑问，它可以和 Tahoma 区分得很清楚，取代 Tahoma 的尖刻的圆角和 Trebuche MS 有几分相似——wikipedia 上是<a href="http://en.wikipedia.org/wiki/Segoe_UI">这么</a>说的。</p>

<p>然而 <a href="http://www.linotype.com">Linotype</a> 公司声称它与 Linotype 的 FrutigerNext 是一模一样的。看下面的对比，真的是几乎一模一样啊 (黑色的是 60pt 的 FruitigerNext，灰色的是 56pt 的 Segoe UI)：</p>

<p><img id="image130" src="http://jjgod.3322.org/wp-content/uploads/2006/04/frutiger.png" alt="FrutigerNext and Segoe UI comparison"/></p>

<p>Wikipedia 上还提到，Microsoft 在 2004 年尝试在欧盟将 Segoe 和 Segoe Italic 注册为原创性字体设计，Linotype 提出了抗议，在 2006 年二月，欧盟拒绝了 Microsoft 的注册请求。Microsoft 承认 Segoe 和 Frutiger 是一样的，但却声称 Linotype 在 2004 年以前没卖过 Frutiger 和 FrutigerNext (这个理由真 faint)，这个说法还是被欧盟拒绝了。</p>

<p>那么现在究竟 Microsoft 会不会撤掉他们<a href="http://blogs.msdn.com/jensenh/archive/2005/11/16/493388.aspx">预先说好</a>要在 Vista 和 Office 2007 中出现的这个字体呢？或者 Microsoft 与 Linotype 达成和解，同意给每份 Vista 的 copy 支付一个美分的授权费用？(先前 Microsoft 是在 Reader 软件中为 Frutiger Linotype 这个字体支付的授权费用。)</p>

<p><img id="image132" src="http://jjgod.3322.org/wp-content/uploads/2006/04/frutiger2.png" alt="Frutiger Linotype and FrutigerNext" /></p>

<p>在网页上的比较可能会比较符合 Microsoft 的心思，不过我的测试是发现 Frutiger Linotype 和 Segoe UI 的效果差不多 (难道 Vista 上 ClearType 的改进又会带来变数？)，但 Frutiger Linotype 的 descenders 明显一点，Segoe UI 的 ascenders 明显一点，相比起来 Segoe UI 不那么“扁”，看起来会更顺眼。</p>

<p><img id="image134" src="http://jjgod.3322.org/wp-content/uploads/2006/04/frutigerlinotype.png" alt="Frutiger Linotype in Firefox" title="Frutiger Linotype"/></p>

<p><img id="image133" src="http://jjgod.3322.org/wp-content/uploads/2006/04/segoeui.png" alt="Segoe UI in Firefox" title="Segoe UI"/></p>

<p>引用一份 FrutigerNext 的小册子上说的：</p>

<blockquote>
1970 年初，当巴黎计划建设 Roissy Charles de Gaulle 机场时，他们发现机场的信号标识需要一个清晰可辨的字体。导航系统的设计落到了 Adrian Frutiger 的头上，结果是……太成功了，不仅导航系统需要这个新的字体，许多常规的书籍印刷同样需要。1977 年，这个字体以 Frutiger 的名字命名，进入了 Linotype Library。它不仅为机场信号，更为所有希望在字号较小时达到清晰可辨的字体设立了一个标准。

……创造出一个既有吸引力又富动感的字体。经过加强的 ascenders 和 descenders 更显可读性，小写字母和数字在一行上排布得很整齐。Linotype Frutiger NEXT 在 Frutiger 的基础上，使笔画与宽度更为协调，各种粗细的版本放在一起显得更为融洽而不突兀。
</blockquote>

<p>从传统的字体设计角度上来说，Segoe UI 当然和 Frutiger/Next 脱不了干系，可是如果从纯技术角度上来说，我们不妨反思这样一个问题：字体的版权应当如何保护，类似 Microsoft 这样，为 ClearType 所优化的 hinting 算不算版权中的一部分呢？</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2006/04/17/on-segoe-ui/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>pt, px, DPI: 关于长度单位的误解</title>
		<link>http://blog.jjgod.org/2006/02/24/misleading-length-unit/</link>
		<comments>http://blog.jjgod.org/2006/02/24/misleading-length-unit/#comments</comments>
		<pubDate>Thu, 23 Feb 2006 23:51:05 +0000</pubDate>
		<dc:creator>jjgod</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://jjgod.3322.org/2006/02/24/misleading-length-unit/</guid>
		<description><![CDATA[在印刷排版中，“point”是一个绝对的单位，它等于 1/72 英寸，可以用尺子丈量的，物理的英寸。但在 CSS 中 pt 的含义却非如此，例如我们指定一个字体是 9pt，我们会以为按照 CSS 规范，它等于： 9 * 1/72 = 1/8 inch 这是一个误解，因为我们的显示器被分割为了一个个的像素，单个像素只能有一种颜色 (为了简化，这里暂不讨论次像素反锯齿技术)，要在屏幕上显示，必须先把以 pt 为单位的长度转换为以像素为单位的长度，这个转换的媒介，就是 DPI (事实上，这里的所谓的 DPI，是操作系统和浏览器中使用的术语，即为 PPI, pixels per inch，和扫描仪、打印机、数码相机中的 DPI 是不同的概念)。 例如，无论在哪个操作系统中，Firefox 浏览器默认的 DPI 都是 96，那么实际上 9pt = 9 * 1/72 * 96 = 12px。 所以，虽然“DPI”中的“I”和“1pt 等于 1/72 inch”中的“inch”，都不代表物理上的英寸，但这两个单位互相之间是相等的，也就在相乘中约掉了。 那么，真实的物理长度怎么计算呢？请拿出一把尺子，丈量你的显示器的可见宽度 (我这里是 11.2992 英寸)，除以横向分辨率 (我这里是 1024 像素)，得到的就是每个像素的物理长度。 现在我们可以回答这样一个问题，网页上 [...]]]></description>
			<content:encoded><![CDATA[<p>在印刷排版中，“point”是一个绝对的单位，它等于 1/72 英寸，可以用尺子丈量的，物理的英寸。但在 CSS 中 pt 的含义却非如此，例如我们指定一个字体是 9pt，我们会以为按照 <a href="http://www.w3.org/TR/CSS21/syndata.html#length-units">CSS 规范</a>，它等于：</p>

<p>9 * 1/72 = 1/8 inch</p>

<p>这是一个误解，因为我们的显示器被分割为了一个个的像素，单个像素只能有一种颜色 (为了简化，这里暂不讨论次像素反锯齿技术)，要在屏幕上显示，必须先把以 pt 为单位的长度转换为以像素为单位的长度，这个转换的媒介，就是 DPI (事实上，这里的所谓的 DPI，是操作系统和浏览器中使用的术语，即为 PPI, pixels per inch，和扫描仪、打印机、数码相机中的 DPI 是不同的概念)。</p>

<p>例如，无论在哪个操作系统中，Firefox 浏览器默认的 DPI 都是 96，那么实际上 9pt = 9 * 1/72 * 96 = 12px。</p>

<p>所以，虽然“DPI”中的“I”和“1pt 等于 1/72 inch”中的“inch”，都不代表物理上的英寸，但这两个单位互相之间是相等的，也就在相乘中约掉了。</p>

<p>那么，真实的物理长度怎么计算呢？请拿出一把尺子，丈量你的显示器的可见宽度 (我这里是 11.2992 英寸)，除以横向分辨率 (我这里是 1024 像素)，得到的就是每个像素的物理长度。</p>

<p>现在我们可以回答这样一个问题，网页上 9pt 的字体究竟占用了多宽的空间？答案是：</p>

<p>9 * 1/72 * 96 * 11.2992 / 1024 = 0.1324 英寸 = 0.3363 厘米。</p>

<p>有兴趣的朋友可以自己查证一下。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jjgod.org/2006/02/24/misleading-length-unit/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
