<?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>chengis.me &#187; Mac Life</title>
	<atom:link href="http://chengis.me/category/mac/feed" rel="self" type="application/rss+xml" />
	<link>http://chengis.me</link>
	<description>Cheng's Personal Portfolio and Homepage. Photos, Illustrations, CSS and Jquery things included.</description>
	<lastBuildDate>Mon, 03 May 2010 14:58:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPad 破解后的中文调教</title>
		<link>http://chengis.me/2010/05/ipad-jailbreaking-for-chinese</link>
		<comments>http://chengis.me/2010/05/ipad-jailbreaking-for-chinese#comments</comments>
		<pubDate>Mon, 03 May 2010 12:59:49 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Mac Life]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=644260</guid>
		<description><![CDATA[iBooks (曾经)最大的问题是它的中文字体支持。虽然它界面上面可以有五种字体可选，但它们都是英文。如果看中文书，不论怎么选，都是逃不掉的黑体。破解之后，因为可以随意修改文件，给iBooks增加更多的中文化特性也不再困难。]]></description>
			<content:encoded><![CDATA[<p><img src="http://chengis.me/fruity/wp-content/uploads/2010/05/IMG_0008.jpg" alt="" title="IMG_0008" width="500" height="122" class="alignnone size-full wp-image-644266" /></p>
<p>iPad 自从还叫 Apple&#8217;s secret tablet 的时候，就被当成了出版业的救星。毫无疑问，很多人买它是为了看电子书。苹果自家的 iBooks 虽然功能还不那么强大，但直观的界面和书籍一样的操作体验感，还是会成为很多人看电子书的首选。对我而言，iBooks (曾经)最大的问题是它的中文字体支持。虽然它界面上面可以有五种字体可选，但它们都是英文。如果看中文书，不论怎么选，都是逃不掉的黑体。</p>
<p>在iPhone/iPod touch上面，我破解之后做的第一件事或许就是安装中文字体。之前我也写过几篇文章关于如何安装。简要的说就是破解到能够用 root 权限宰割上面的文件之后，在 <code>/System/Library/Fonts/Cache</code> 里面添加需要安装的中文字体，并且修改 <code>/System/Library/Fonts/CGFontCache.plist</code>把字体添加到系统列表当中。对于iPad来说，上面的操作依然适用，只不过无论你装了多少五花八门的字体，你不调教一下 iBooks 他也是不知道的。</p>
<p>让 iBooks 可以选择中文字体，实际上并不难，因为那个字体选择的列表是在程序包里面一个单独的plist文件，也就是 <code>/var/mobile/Applications/[???]/iBooks.app/FontPresets.plist</code> 里。如果修改了之前的CGFontCache.plist，打开这个字体选项马上就可以猜到应该修改什么。没错，把字体名称相应替换(或者添加)进来就可以了。需要指出的是，iBooks只会认前面的5个字体，所以只有替换法好用。</p>
<p>我当然最看不上眼的就是Verdana，假如你安装的宋体名称是STSong，那么直接把名字写对就可以了。但是由于中文字体比较大的原因，换字体还有改字体大小时，还是能够感觉速度有点卡，但是看到清晰锐利的字体，总比看黑体要爽上好多倍。</p>
<p><img src="http://chengis.me/fruity/wp-content/uploads/2010/05/fontselection.png" alt="" title="fontselection" width="451" height="413" class="alignnone size-full wp-image-644263" /></p>
<p>解决了一个疑难问题，另外一个问题就是英汉词典。虽然说看英英词典有利于提高英文水平，但是对于阅读而言，在一个词上卡太久也就失去了阅读的流畅体验。我之所以动这个脑筋，也是因为看到 iBooks 程序里面有 DefaultDictionaries.plist。</p>
<p>iPad上面自带的一些词典，其实都在 <code>/Library/Dictionaries</code>里面。不要被那个iBooks的plist给骗了，经我检验，那个文件完全一点用也没有。不管你怎么修改，iBooks总是只会打开 New Oxford American Dictionary 这一本词典。</p>
<p>既然用正常的办法行不通，那只好用另外的办法了。也就是把需要的字典改成New Oxford American Dictionary这个名字，把原来的词典换个名。iPad自带的其实有几个英日词典，和Mac OSX 10.6上自带的一致。jjgod 发布了一个用stardict转Dictionary格式的软件 <a href="http://code.google.com/p/mac-dictionary-kit">Mac Dictionary Kit</a>，于是问题就可以简化为：1, 把词典转为OSX 10.6格式，2，把文件替换为New Oxford American Dictionary这个名字。<br />
<img src="http://chengis.me/fruity/wp-content/uploads/2010/05/dictionary.png" alt="" title="dictionary" width="465" height="290" class="alignnone size-full wp-image-644264" /></p>
<p>事实上还有一个问题，因为转换的字典里面只有单词的原始形式，没有复数、过去式之类的变化。而对于这些形式，iPad会自动替换到另一本词典Oxford American Writer&#8217;s Thesaurus。这是用于英文写作的同义词典，词很少，所以你还可以把原来的New Oxford American Dictionary词典替换成上面的名字成为英汉词典的备选，也是一个能够接受的结果。</p>
<p><img src="http://chengis.me/fruity/wp-content/uploads/2010/05/Falloff.png" alt="" title="Falloff" width="437" height="296" class="alignnone size-full wp-image-644265" /></p>
<p>最后不要忘记，iPad和iPhone一样，系统分区是比较小的，而用户分区很大，词典和字体都是很占空间的东西，所以如果系统自带的日文词典对你没有那么大的用处，可以先备份再删掉的。之所以出此下策，还因为似乎词典不支持符号链接。我把New Oxford American Dictionary链接到了用户分区上面的词典，不能用只好拷过去。</p>
<p>如你所见，其实中文字体在Pages里面也是能用的，只不过再拷回去会怎样我不敢保证。<br />
<img src="http://chengis.me/fruity/wp-content/uploads/2010/05/pages.jpg" alt="" title="pages" width="500" height="273" class="alignnone size-full wp-image-644269" /></p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2010/05/ipad-jailbreaking-for-chinese/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Chinese fonts for iPhone OS 3.0</title>
		<link>http://chengis.me/2009/07/chinese-fonts-for-iphone-os-3-0</link>
		<comments>http://chengis.me/2009/07/chinese-fonts-for-iphone-os-3-0#comments</comments>
		<pubDate>Wed, 22 Jul 2009 11:01:31 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Mac Life]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=644159</guid>
		<description><![CDATA[I made some instructions about adding Chinese fonts to iPhone OS 2.x. Since OS 3.0 came out, some changes should be made. And I made a better font for download too. 3.0 系统出来之后原来修改字体文件不能直接用了，我把我修改过的文件传一下，另外这次的对GBK的支持也好一些(文件大了好几倍)[linkmore]]]></description>
			<content:encoded><![CDATA[<p><a href="http://chengis.me/fruity/wp-content/uploads/2009/07/font.jpg"><img src="http://chengis.me/fruity/wp-content/uploads/2009/07/font.jpg" alt="font" title="font" width="320" height="162" class="alignnone size-full wp-image-644164" /></a></p>
<p>I made <a href="http://chengis.me/2009/03/chinese-font-on-iphone-ipod">some instructions</a> about adding Chinese fonts to iPhone OS 2.x. But iPhone OS 3.0 has come out for a month, something has changed for 3.0 and the hack files are no longer bullet-proof. (Actually I suffered from restoring the firmware after I directly substituted the files.)</p>
<p>The whole process of the last article still works and the locations are the same. However, 3.0 OS weighs a bit more, so a better idea is to move the font folder out of the system partition.  You should know that your home partition (for apps, videos, and music) is at least 6GB for 8GB models so it&#8217;s basically big enough. But the system partition is only 500MB with no more than 100MB left available which is not so sufficient for Chinese fonts which normally takes more than 10MBs. I&#8217;ll show some terminal stuffs for this step. You better know what these are if you really do this. I assume you have jail-broken your device and logged on with proper privilege.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Fonts<span style="color: #000000; font-weight: bold;">/</span>Cache <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mobile<span style="color: #000000; font-weight: bold;">/</span>Documents
<span style="color: #666666; font-style: italic;">#Copy fonts out</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Fonts<span style="color: #000000; font-weight: bold;">/</span>Cache <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Fonts<span style="color: #000000; font-weight: bold;">/</span>Cache.bak
<span style="color: #666666; font-style: italic;">#No hurry</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mobile<span style="color: #000000; font-weight: bold;">/</span>Documents<span style="color: #000000; font-weight: bold;">/</span>Cache <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Fonts<span style="color: #000000; font-weight: bold;">/</span>Cache
<span style="color: #666666; font-style: italic;">#Link to the outer space</span>
<span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Fonts<span style="color: #000000; font-weight: bold;">/</span>Cache 
<span style="color: #666666; font-style: italic;">#If fonts are still there, it's OK to move on</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>Fonts<span style="color: #000000; font-weight: bold;">/</span>Cache.bak
<span style="color: #666666; font-style: italic;">#Clean up</span></pre></div></div>

<p>And you just copy the fonts to the <code>Cache</code> folder and modify the <code>CGFontCache.plist</code>. If you have problems just refer to the <a href="http://chengis.me/2009/03/chinese-font-on-iphone-ipod">original article</a>.</p>
<p>And some people asked for a better font with GBK support, and I found STZhongSong is a nice font. (It&#8217;s bigger of course).</p>
<p>我原来有一篇文章介绍如何在iPhone OS 2.x上增加中文字体的。3.0的修改方法大概相同，只不过你不能直接用原来2.x的文件直接替换了(我就是替换了之后系统出问题重刷了一次)。另外就是由于3.0占用的空间更大了，原来的系统分区有点不够用。加上中文字体如果要字比较全就要10M以上了，还是不要挤占那点空间了，我在上面介绍了一下如何把字体文件夹移出系统分区。你如果能看懂原理就去试试，如果不行的话就不要试了，还是有风险的。另外常有人希望有一个支持GBK的字体，我找了华文中宋的字体，似乎还比较全，至少我看的书里面还没发现有漏字的。如果你信任我的话就直接下载下面好了。</p>
<p><a href="http://chengis.me/fruity/wp-content/uploads/song4iphone3.zip">Download | 下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/07/chinese-fonts-for-iphone-os-3-0/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A Refused Icon of Task Management</title>
		<link>http://chengis.me/2009/07/a-refused-icon-of-task-management</link>
		<comments>http://chengis.me/2009/07/a-refused-icon-of-task-management#comments</comments>
		<pubDate>Tue, 14 Jul 2009 01:20:09 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Illustration]]></category>
		<category><![CDATA[Mac Life]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=644142</guid>
		<description><![CDATA[Someone asked me to design a icon for both iPhone and Mac for their task management icon. Although they finally chose a more time-specific icon, but I like this very much.
And another lesson for me is I know how much to charge, and some necessary things for being a freelancer designer.
]]></description>
			<content:encoded><![CDATA[<p><img src="http://chengis.me/fruity/wp-content/uploads/2009/07/task1.png" alt="task" title="task" width="320" height="210" class="alignnone size-full wp-image-644143" /></p>
<p>Someone asked me to design a icon for both iPhone and Mac for their task management icon. Although they finally chose a more time-specific icon, but I like this very much.</p>
<p>And another lesson for me is I know how much to charge, and some necessary things for being a freelancer designer.</p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/07/a-refused-icon-of-task-management/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Icon Design: Cocoa Cup</title>
		<link>http://chengis.me/2009/05/icon-design-cocoa-cup</link>
		<comments>http://chengis.me/2009/05/icon-design-cocoa-cup#comments</comments>
		<pubDate>Sun, 31 May 2009 11:32:06 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Illustration]]></category>
		<category><![CDATA[Mac Life]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[cup]]></category>
		<category><![CDATA[icon]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=644052</guid>
		<description><![CDATA[A commercial icon design for a Cocoa (which means applications for Mac) coding company. I made it totally in vector format. ]]></description>
			<content:encoded><![CDATA[<p><img src="http://chengis.me/fruity/wp-content/uploads/2009/05/cocoacup2.jpg" alt="cocoacup2" title="cocoacup2" width="500" height="542" class="alignnone size-full wp-image-644054" /></p>
<p><img src="http://chengis.me/fruity/wp-content/uploads/2009/05/cocoa.gif" alt="cocoa" title="cocoa" width="500" height="548" class="alignnone size-full wp-image-644053" /></p>
<p>It&#8217;s a commercial icon design for a Cocoa (which means applications for Mac) coding company.</p>
<p>I made it totally in vector format, including the texture of the cup, the smoke, and the cocoa foams. I would like to re-evaluate if this is necessary. The .ai file weighs 8M and it takes long times to re-render when I add something unto it. (I used blending tool, transparent mask, gradient and feather filter intensively.) </p>
<p>Stripes are just for copyright concerns, hope they didn&#8217;t bother you.</p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/05/icon-design-cocoa-cup/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CocoaHeads Beijing</title>
		<link>http://chengis.me/2009/04/cocoaheads-beijing</link>
		<comments>http://chengis.me/2009/04/cocoaheads-beijing#comments</comments>
		<pubDate>Mon, 20 Apr 2009 16:49:40 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Mac Life]]></category>
		<category><![CDATA[beijing]]></category>
		<category><![CDATA[cocoaheads]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=644043</guid>
		<description><![CDATA[上周六是CocoaHeads Beijing的第一次会议。CocoaHeads 简言之就是苹果上面软件开发者的碰头会，在很多城市都有分舵，这次在北京由FileMaker的几个开发者发起，后来辗转找到我帮忙借教室。于是在CocoaHeads Beijing就有清华的信息了。[linkmore]]]></description>
			<content:encoded><![CDATA[<p>上周六是CocoaHeads Beijing的第一次会议。<a href="http://cocoaheads.org/">CocoaHeads</a> 简言之就是苹果上面软件开发者的碰头会，在很多城市都有分舵，这次在北京由FileMaker的几个开发者发起，后来辗转找到我帮忙借教室。于是在CocoaHeads Beijing就有清华的信息了。这里还有专门的网站: <a href="http://cocoaheadsbj.org/">CocoaHeads Beijing</a>.</p>
<p>地点在清华同学非常熟悉的C楼，C楼是个深入人心的象形叫法，其实并没有A楼和B楼。但是恐怕按时到场的40多人并没注意到这一点也能找到地方，我很欣慰。借教室的过程还要感谢rephix, jie5几位同学，总的来说还算顺利。</p>
<p>另外还有一点花絮，我从学生清华的办公室借用的白板上面被用光盘笔写上字了，擦不掉…经验告诉我要用酒精，但是C楼下面的超市连二锅头也没，最后用湿巾和洗涤灵外加指甲好歹擦了下去。计划永远有意料不到的事情。</p>
<p>会议一开始的身份曝光很搞笑，大家果然是来自五湖四海(有天津来的)，怀着同一个目的走到一起来了。有做视频的，有做音乐的，有做设计的，还有打酱油的(我)，有媒体的(apple4us)，当然开发者也不少(包括一名老外)。会议主要的内容还是讲编程，虽说我已经是比较geek的一个人了，但是过来的同学们都比我还要geek，主要的标志就是讲的东西和问的问题我都不太懂-_-。顺便拿了一本《Cocoa入门 &#8211; 使用Objective-C(第二版)》，这也算是一个收获吧，我原来还想买来着。</p>
<p>会上感觉大家对Mac和iPhone还是非常有爱的，很多的iPhone，电脑当然都是Mac啦..<br />
下次会议会是下个月吧，如果在清华我当然还会去的。以后可能还会采取茶话会的形式，期待ing.</p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/04/cocoaheads-beijing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chocolate iCosta Icon</title>
		<link>http://chengis.me/2009/04/chocolate-icosta-icon</link>
		<comments>http://chengis.me/2009/04/chocolate-icosta-icon#comments</comments>
		<pubDate>Sun, 19 Apr 2009 18:34:07 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Illustration]]></category>
		<category><![CDATA[Mac Life]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[icosta]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=644036</guid>
		<description><![CDATA[iCosta is a Chinese input method on (jailbroken) iPhone. The developer asked me to make an icon for this. The icon will not be necessarily shown, but I believe the app deserves. [linkmore]]]></description>
			<content:encoded><![CDATA[<p><a href="http://iphone.freecoder.org/iCosta.html">iCosta</a> is a Chinese input method on (jailbroken) iPhone. The developer asked me to make an icon for this. The icon will not be necessarily shown, but I believe the app deserves it <img src='http://chengis.me/fruity/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . </p>
<p>I am inspired by a chocolate keyboard. Maybe there is no connection between iCosta and chocolate, but why so serious?</p>
<p><a href="http://chengis.me/fruity/wp-content/uploads/icons/icosta-icon.zip"><img src="http://chengis.me/fruity/wp-content/uploads/2009/04/icosta.png" alt="icosta" title="icosta" width="320" height="210" class="alignnone size-full wp-image-644037" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/04/chocolate-icosta-icon/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Chinese Fonts on iPhone/iPod Touch 2.x</title>
		<link>http://chengis.me/2009/03/chinese-font-on-iphone-ipod</link>
		<comments>http://chengis.me/2009/03/chinese-font-on-iphone-ipod#comments</comments>
		<pubDate>Sun, 22 Mar 2009 16:22:07 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Mac Life]]></category>
		<category><![CDATA[chinese]]></category>
		<category><![CDATA[fontforge]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod touch]]></category>
		<category><![CDATA[song]]></category>
		<category><![CDATA[stanza]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=643983</guid>
		<description><![CDATA[E-book reading is quite a good deal for iPod Touch/iPhone. But there is only one Chinese font on iPhone OS, the sans-serif STHeiti without book-friendly serif fonts.  [linkmore]]]></description>
			<content:encoded><![CDATA[<p> <strong>This post is outdated, please refer to: <a href="http://chengis.me/2009/07/chinese-fonts-for-iphone-os-3-0">Chinese fonts for iPhone 3.0</a></strong></p>
<p><img src="http://chengis.me/fruity/wp-content/uploads/2009/03/font.jpg" alt="font" title="font" width="505" height="300" class="alignnone size-full wp-image-643988" /></p>
<h3>New Toy at Home</h3>
<p>I finally got a 2nd generation iPod touch 8GB after Apple previewed the iPhone OS 3.0. Though I&#8217;m not quite interested in testing the early beta of 3.0 OS bugs despite of the &#8220;copy, cut, paste&#8221; tempting, the OS 2.x is enough fun to play with (even more fun when jailbreakable!).</p>
<p>I jailbroke it using VMWare Fusion because the tutorial on OSX 10.5.6 looks not so friendly. And after installed OpenSSH with Cydia, changing the file system can be easily done with any SFTP apps (meet the possibilities!).</p>
<h3>Chinese Fonts Headache</h3>
<p>Besides games and internet browsing, e-book reading is quite a good deal for iPod Touch/iPhone. I use Stanza and there is many choices of books. Although iPhone OS is multi-lingual by design, but there is only one Chinese font on iPhone OS, the sans-serif STHeiti. But a book needs a SERIF font to read!</p>
<p>It&#8217;s not hard to figure out that the font settings on iPhone OS are actually stored at <code>/System/Library/Fonts/</code>. The <code>CGFontCache.plist</code> is for the font list, and TTF format fonts are at <code>/System/Library/Fonts/Cache</code>. So I tried to just copy into the folder and modify the plist file. Maybe for English fonts it will just work, but it did not always work for my Chinese serif fonts except the one with Mac OS, the STSong.</p>
<p>But STSong is not good enough for reading because it is too light on screen, I need a bolder font. Any font that looked better wouldn&#8217;t work and it drove me crazy! I can not find out what&#8217;s special, so I just try to &#8220;substitute the shapes&#8221; with FontForge.</p>
<h3>Perpetrate a Fraud</h3>
<p>This is my steps:</p>
<ul>
<li>Open STSong with Fontforge, select all, clear. (There is no shapes in it now)</li>
<li>Open another (better looking) font with Fontforge, change the resolution setting (Element>Font Info>General. STSong has a Em Size of 1000, so match this and click OK.) Fontforge will take a few seconds for transforming. If you don&#8217;t change this, it won&#8217;t look right after &#8220;pasting&#8221; into STSong.</li>
<li>Then you navigate to the STSong window and choose Element>Merge Font. There you go, then don&#8217;t forget to generate the TTF Font (you can&#8217;t use File>Save, you need to File>Generate) </li>
<li>Then copy to iPhone/iPod Touch and enjoy.</li>
</ul>
<p><br/></p>
<h3>不折腾不舒服斯基</h3>
<p>上周实在抗拒不了iPhone OS 3演示的诱惑，买了一个iPod Touch二代，现在8G的只要1500块，想当年我买了个红色的iPod nano 4G还花了1600来块啊，都是港货，时代真的不同了。然后折腾了半天破解，装游戏，最后卡在是想往上面安装中文字体上面。</p>
<p>iPhone(以下提到都同时包含iPod Touch) 的屏幕看电子书虽然比不上kindle, 但是在手机和MP4圈里也算是相当不错了。但是最大的麻烦莫过于我想用宋体看书，iPhone上面只有一个中文字体就是华文黑体，这个虽然将就看，但是看小说不是看杂志，不用宋体眼睛就是不舒服。</p>
<p>然后就折腾呗……iPhone的字体设置想改也容易，随便一找就找着了，<code>/System/Library/Fonts/</code>，一个plist是字体列表，和一个子文件夹放字体，可能英文字体直接扔进去改改plist也就可以了，但是中文字体就是这么不靠谱，随便扔个字体进去，Stanza根本不认，甚至一进入字体设置界面都能崩溃。</p>
<h3>知其然不知其所以然──掉包计</h3>
<p>我试了无数组合方式，发现只有华文宋体这一个字体能用，但是装在里面字体显示也太虚了。华文中宋也是华文公司的，也比华文宋体好看，但是扔进去就是不好使。怎么办？我先试了试简单的办法，比如改文件信息之类的，结果依然不好使，最后只好用最土的办法，复制粘贴……</p>
<p>步骤：</p>
<ul>
<li>用Fontforge打开华文宋体，全选，清除</li>
<li>用Fontforge打开别的字体，我换了方正宋三。注意也不能直接粘过去，因为字体的分辨率不一样。华文宋体是1000，宋三是256，这就必须对应一致才行。我一开始没注意这个事情，结果字体粘过去都小两三号。在Element>Font Info>General找Em Size改好就可以。</li>
<li>然后我们也没必要去粘贴，直接在华文宋体的窗口里面选Element>Merge Font. 然后把字体的形状粘过来就行了，我们只需要华文宋体这个容器而已。最后保存字体，要用File>Generate) </li>
<li>最后直接拷过去就好了。可以看效果图</li>
</ul>
<p>如果有人刚好感兴趣而且不想再重复折腾一次，可以在这里下载我的小成果，用任意支持SFTP的软件复制到相应的地方即可。</p>
<p><a href="http://chengis.me/fruity/wp-content/uploads/stsong4iphone.zip" class="aligncenter">下载打包</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/03/chinese-font-on-iphone-ipod/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Sun Pinyin Icon</title>
		<link>http://chengis.me/2009/03/sun-pinyin-icon</link>
		<comments>http://chengis.me/2009/03/sun-pinyin-icon#comments</comments>
		<pubDate>Mon, 16 Mar 2009 03:44:37 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Illustration]]></category>
		<category><![CDATA[Mac Life]]></category>
		<category><![CDATA[sunpinyin icon]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=643970</guid>
		<description><![CDATA[An icon for SunPinyin, a Chinese Input Method developed by Sun microsystems. The style is inspired by OpenOffice.org from Sun. For Mac OSX usage, a 512&#215;512 resolution has been made. And a 16&#215;16 version is optimized for menubar display.
Click the image to download.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://chengis.me/fruity/wp-content/uploads/icons/sunpinyin-icon.zip"><img src="http://chengis.me/fruity/wp-content/uploads/2009/03/sunpinyin.png" alt="sunpinyin" title="sunpinyin" width="320" height="210" class="alignnone size-full wp-image-643965" /></a></p>
<p>An icon for <a href="http://opensolaris.org/os/project/input-method/">SunPinyin</a>, a Chinese Input Method developed by Sun microsystems. The style is inspired by OpenOffice.org from Sun. For Mac OSX usage, a 512&#215;512 resolution has been made. And a 16&#215;16 version is optimized for menubar display.</p>
<p>Click the image to download.</p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/03/sun-pinyin-icon/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Parallel SIESTA &amp; VASP on Mac Pro</title>
		<link>http://chengis.me/2009/03/parallel-siesta-vasp-on-mac-pro</link>
		<comments>http://chengis.me/2009/03/parallel-siesta-vasp-on-mac-pro#comments</comments>
		<pubDate>Fri, 13 Mar 2009 09:38:22 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Mac Life]]></category>
		<category><![CDATA[Webdev]]></category>
		<category><![CDATA[gfortran]]></category>
		<category><![CDATA[ifort]]></category>
		<category><![CDATA[mac pro]]></category>
		<category><![CDATA[openmpi]]></category>
		<category><![CDATA[scalapack]]></category>
		<category><![CDATA[siesta]]></category>
		<category><![CDATA[vasp]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=643934</guid>
		<description><![CDATA[SIESTA (Spanish Initiative for Electronic Simulations with Thousands of Atoms) and VASP are two commonly-used ab initio packages, for mad physicists to calculate the interesting stuffs of the atoms. But compiling the codes is a very tricky job, especially you want to compile it flawless. [linkmore]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.icmab.es/siesta/">SIESTA</a> (Spanish Initiative for Electronic Simulations with Thousands of Atoms) and <a href="http://cms.mpi.univie.ac.at/vasp/">VASP</a> are two commonly-used ab initio packages, for mad physicists to calculate the interesting stuffs of the atoms. But compiling the codes is a very tricky job, especially you want to compile it flawless. Both the packages supports parallel, which means you can use all your available CPU to speed up your work. Our lab got a 8-core Mac Pro, it looks awesome. I compiled one-CPU versions of both packages, and they already runs faster than I used 2-3 cpus on the university&#8217;s cluster. But I still want the challenge for a true parallel version on this sexy workstation.</p>
<p>So what&#8217;s the problems took me so long to complete?</p>
<ul>
<li>A Case-sensitive Volume! The default and trouble-free format is case-insensitive on Mac. But if you wanna build these things, at least make a .dmg and mount it. (of course you can make another partition on disk)</li>
<li>The Fortran/C Compiler.</li>
<li>Compile MPI support: The packages need this framework to communicate among CPUs, like network support or something.</li>
<li>Compile Math Libraries: i.e. BLAS, LAPACK, BLACS, SCALAPACK. Looks geeky? Think them to be your math symbols like cos, sin, lg, etc; the packages simply use them instead of code them one by one. Of course the libraries are in fact for matrix operations instead of simple math functions, but you get it. </li>
<li>Linking them. We may got many specialists as a team, but you still need to make sure they could talk to each other.</li>
</ul>
<h3>The Fortran/C Compiler</h3>
<p>On a mac (it should be intel now) the best available compiler would be the <code><a href="http://www.intel.com/cd/software/products/asmo-na/eng/267426.htm">ifort</a>, <a href="http://www.intel.com/cd/software/products/asmo-na/eng/266992.htm">icc</a></code> provided by intel themselves. Believe me, they are fast. But they need tricker configurations when you compile. Also, they need to pay for licenses. Of course you can apply a trial license and compile your codes. If you really care about that, you may think about the open source <code>gfortran</code>/<code>gcc</code>. And some kind guys(<a href="http://hpc.sf.net/">http://hpc.sf.net</a>) provides usable version for Mac OSX. All you need is just un-archive and use. The intel compilers are easy to install also, they use the standard .dmg and .pkg install routines.</p>
<p>Mission 1 Checked.</p>
<h3>The MPI Support</h3>
<p>In Leopard (OSX 10.5), apple have included OpenMPI framework. But very sadly, it comes with no fortran support. So we need to re-compile <a href="http://www.open-mpi.org/">OpenMPI</a>, or you can choose <a href="http://www.lam-mpi.org/">LAMMPI</a>, <a href="http://www.mcs.anl.gov/research/projects/mpich2/">MPICH 2</a> etc. They work basically the same, but you can still choose your favorite. I&#8217;d say I used OpenMPI because they had a <a href="http://www.open-mpi.org/faq/?category=osx">FAQ for OSX</a>. If you use gcc/gfortran, just follow the steps, except you need to make it 64bit! This is a lesson, so beware it: the default setting of gcc/gfortran compile 32bit files.</p>
<p>My options for gcc/gfortran:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>openmpi.gcc \
             <span style="color: #660033;">--with-wrapper-ldflags</span>=<span style="color: #ff0000;">&quot;-Wl,-search_paths_first&quot;</span> \
             <span style="color: #007800;">CFLAGS</span>=-m64 <span style="color: #007800;">CXXFLAGS</span>=-m64</pre></div></div>

<p>The intel compilers seems to compile 64bit files by default, but you can&#8217;t be too careful. My options:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>openmpi.intel\
             <span style="color: #660033;">--with-wrapper-ldflags</span>=<span style="color: #ff0000;">&quot;-Wl,-search_paths_first&quot;</span> \
             <span style="color: #007800;">CFLAGS</span>=-m64 <span style="color: #007800;">CXXFLAGS</span>=-m64 \
             <span style="color: #007800;">CC</span>=icc <span style="color: #007800;">CXX</span>=icpc <span style="color: #007800;">F77</span>=ifort <span style="color: #007800;">FC</span>=ifort</pre></div></div>

<p>And then enjoy the sexy scrolling matrix Terminal window, and then <code>make; sudo make install</code> to enjoy for another chance. This step is easy enough too.</p>
<p>Checked Mission 2!</p>
<h3>The Math Libraries</h3>
<p>Also I would like to mention the built-in LAPACK and ATLAS packages in Leopard, but they don&#8217;t quite seem to work neither. SIESTA needs BLAS, LAPACK, BLACS and SCALAPACK (yes, all of them) to build a parallel version. VASP seems a little more merciful, you just need BLAS and LAPACK.</p>
<p>As always, there is a simple way and a tricky way to do this. The simple way: you can use the <a href="http://www.netlib.org/scalapack/scalapack_installer.tgz">SCALAPACK installer</a>. And ask it to download and compile the libs (the coolest thing is, it builds all of them) for you. Remind you, the <code>-m64</code> flag for gcc/gfortran!</p>
<p>The tricky way, you can use Intel&#8217;s <a href="http://www.intel.com/cd/software/products/asmo-na/eng/307757.htm">Math Kernel Library</a> (MKL). Don&#8217;t worry, you should already installed them with your compilers on Mac. But the worst thing is, it provides BLAS, LAPACK support except SCALAPACK. They have it on Linux/Win, but not Mac. So you should use the installer mentioned above, just download and compile. But you don&#8217;t need to use all the libs, only the SCALAPACK and BLACS.</p>
<p>OK, Mission 3 done.</p>
<h3>Linking and Compiling</h3>
<p>We finally get to the final part. But before SIESTA/VASP really work, your efforts still mean nothing. Generally speaking, you need to take care of the configuration files in the following ways:</p>
<ul>
<li>Compiler: <code>mpif77/mpif90</code> depends on the specific package. But you should make sure it if you have several versions and do not use gfortran/ifort because they won&#8217;t compile parallel apps.</li>
<li>Flags: What did I say time after time? 64bit for gfortran! And for intel compilers, you surely want a best option to work well and fast. I&#8217;m not sure about everything, but this works for me:<code>-O3 -m64 -axSSE4.1,SSSE3 -xSSSE3 -mp1 -prec-div -pc80 -pad -ip</code></li>
<li>Linking Libraries: for gcc/gfortran, I simply use the libraries installed by the scalapack installer. and for intel, I use the following settings: (again, it works for me and don&#8217;t make me to explain <img src='http://chengis.me/fruity/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )<br/><br/>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">MKLPATH</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>Compiler<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11.0</span><span style="color: #000000; font-weight: bold;">/</span>059<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>mkl<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>em64t<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #007800;">INTEL_MKL</span>=-L$<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span>\
      -I<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>Compiler<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11.0</span><span style="color: #000000; font-weight: bold;">/</span>059<span style="color: #000000; font-weight: bold;">/</span>Frameworks<span style="color: #000000; font-weight: bold;">/</span>mkl<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>  \
      -lmkl_lapack\
      $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>libmkl_intel_lp64.a\
      $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>libmkl_intel_thread.a \
      $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>libmkl_core.a\
      $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>libmkl_intel_thread.a \
      $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>libmkl_core.a\
      $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>libmkl_intel_thread.a \
      $<span style="color: #7a0874; font-weight: bold;">&#40;</span>MKLPATH<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #000000; font-weight: bold;">/</span>libmkl_core.a\
      <span style="color: #660033;">-liomp5</span> <span style="color: #660033;">-lpthread</span>
<span style="color: #007800;">LIBS</span>=  $<span style="color: #7a0874; font-weight: bold;">&#40;</span>SCALAPACK_LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>BLACS_LIBS<span style="color: #7a0874; font-weight: bold;">&#41;</span>  \
       $<span style="color: #7a0874; font-weight: bold;">&#40;</span>INTEL_MKL<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

</li>
</ul>
<p>You should know the linking LIBS are just making everything together, so it doesn&#8217;t matter what intermediate variables in the makefile(or arch.make for SIESTA). Just make sure the compiler link the libraries in this way.</p>
<p>Mission Complete!</p>
<h3>Ta-da</h3>
<p>The apps should be working for now. If not, let me provide these tricky <a href="http://chengis.me/fruity/wp-content/uploads/osx_makefiles.zip">makefiles</a> for ya. They may not work for you immediately, but I think they could be a better start than those in the package.</p>
<h3 style="color:red">Updates</h3>
<p><a href="http://titus.phy.qub.ac.uk/group/Peter/">Peter Klaver</a> suggested the heavy optimization <code>-O3</code> could be problematic for some of the libs in VASP. If the executable is not working, please check the optimization options. Thanks Peter!</p>
<blockquote><p>I did have to reduce the optimization level on one file, fftmpi.F90. With -O3 I get an executable that gives me errors &#8216;Input and output electron density differ&#8217;. But reducing optimization for fftmpi.F90 to -O1 fixes it. I had emailed someone who was using linux/ifort earlier. He too found that the mpi version produces those errors unless optimization was reduced.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/03/parallel-siesta-vasp-on-mac-pro/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ice Pop Icon Download</title>
		<link>http://chengis.me/2009/03/ice-pop-icon-download</link>
		<comments>http://chengis.me/2009/03/ice-pop-icon-download#comments</comments>
		<pubDate>Sun, 01 Mar 2009 10:40:49 +0000</pubDate>
		<dc:creator>Cheng</dc:creator>
				<category><![CDATA[Illustration]]></category>
		<category><![CDATA[Mac Life]]></category>

		<guid isPermaLink="false">http://chengis.me/?p=643868</guid>
		<description><![CDATA[A icon of the ice pop in my front page is now made available for downloading.


Both Mac and PC format is in the zip file. Supported Format: Leopard 512&#215;512, Windows Vista 256&#215;256 and a normal Windows 128&#215;128. Feel free to use personally, and if you want a commercial use please tell me.
]]></description>
			<content:encoded><![CDATA[<p>A icon of the ice pop in my front page is now made available for downloading.</p>
<p><a href="http://chengis.me/portfolio"><img src="http://chengis.me/fruity/wp-content/uploads/2009/03/ice-icon-preview.png" alt="ice-icon-preview" title="ice-icon-preview" width="320" height="210" class="alignnone size-full wp-image-643865" /></a></p>
<p>
Both Mac and PC format is in the zip file. Supported Format: Leopard 512&#215;512, Windows Vista 256&#215;256 and a normal Windows 128&#215;128. Feel free to use personally, and if you want a commercial use please tell me.</p>
]]></content:encoded>
			<wfw:commentRss>http://chengis.me/2009/03/ice-pop-icon-download/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
