Notes on Cocoa
Monday, August 9th
8:00pm

1 note

tags: webkit. osx. mac.
WebKit plug-ins

蘋果定義給 Safari 用的 Webkit Plug-in API 基本上就是一個 NSView,也就是,你自己弄一個 NSView 的 sub-class,然後丟進一個 Bundle 裡頭,然後告訴 Safari 在什麼狀況下應該要使用你的 Plugin,在用到的時候,Safari 就會在 WebView 上面透過 addSubview: 把你的 plug-in 裡頭的 view 弄上去。

因為是透過 addSubview: 加上去的,而 WebView 原本的內容呢,都是直接透過繪圖指令,繪製在 WebView 的 context 裡頭,所以,你的 plug-in 的畫面一定會疊在 WebView 所有的 web 內容的上面,而且不可能用什麼 css 把 HTML 裡頭的東西疊在 plug-in 上,因為 HTML 內容與 plug-in 裡頭的東西根本就不在同一個 view、同一個 context 裡。

Thursday, June 18th
5:07pm

4 notes

tags: OSX. font. mac. snow leopard.
Apple, I request you not to use Heiti TC as the system font for Traditional Chinese

The lastest beta of Mac OS X 10.6 Snow Leopard uses Heiti TC (黑體-繁) system font for Traditional Chinese. Heiti TC is available on Leopard although the system font of Leopard is Lihei Pro. This font looks really bad, and the bad font could ruin Mac OS X’s user experience no matter how advance Snow Leopard is!

Comparing to the previous system fonts such as Lihei Pro and so on, the glyph of each character of Heiti TC is smaller and placed on a lower baseline.

It results, if you switch the locale of your Mac to Traditional Chinese, you may see the Chinese text is placed too low on the menu bar, the text is too close to the bottom of the menu bar and the space on the top is too large. It makes users feel bad since it lacks the aesthetic of balance.

Another problem is the Chinese comma (, Unicode U+FF0C). Unlike the Simplified Chinese, the Traditional Chinese punctuation marks should be placed on the vertical center but not on the baseline, but Heiti TC places it on the baseline. Therefore, when using such a font to create a document, people will find the document not well formatted and not professional.

Furthermore, the positions of Heiti TC’s punctuation marks are all not consistent. The Chinese Comma is placed on the baseline, and the Chinese Stop is placed on the vertical center. I do not know anyone who use this font although it is available on Leopard, the reason might be that any native Chinese speaker would consider this font is useful.

Apple, as a Mac user, I request you. If you cannot alter the ugly part of the font before the release of Snow Leopard, please keep using Lihei Pro. I can bear that Mac OS X has bugs, but I cannot bear a terrible font!

If you are a Chinese Mac user, and you know some guys working at Apple, please write to them to let them know this issue. Or, you can tell Apple by filing tickets on Open Radar or Apple Bug Reporter website.

Chinese version of the text:

4:08pm

8 notes

tags: OSX. font. snow leopard.
請一人一信抵制蘋果使用 Heiti TC 做為 Mac OS X 10.6 Snow Leopard 預設字體
在最新一版的 Mac OS X 10.6 Snow Leopard Developer preview 版本中,可以看到蘋果將系統預設的中文字體,從 Li Hei Pro 換成 Heiti TC-這套字體在 10.5 Leopard 中也可以找到。如果你是 Mac OS X 的中文使用者,您應該想辦法阻止蘋果做出這樣的設計。原因很簡單,Heiti TC 實在是太醜了。
Heiti TC 的第一個大問題,就在於每個標點符號都放在奇怪的位置上。例如,句號是放在垂直中央的部份,但是逗號卻放在對齊基線的位置-就中文排版而言,目前簡體中文是將標點符號統一放在基線位置,而繁體中文則是放在垂直中心位置,但是 Heiti TC 的設計,卻完全不符合其中任何一種排版的要求。換言之,如果這套字體變成系統預設字體,那麼當你瀏覽網頁的時候,等於是看到一整頁完全無法忍受的編排,而如果你使用 Pages 編輯中文文件,也預設 fallback 到這套字體,也等於是容易製作出編排非常不專業而且閱讀體驗極差無比的文件。
如果你希望你在幾個月之後使用的 Mac OS X 的中文系統不是這個樣子,你可以-

使用 Apple 的 Bug Report 系統回報這是非常嚴重的用戶體驗問題
使用 Open Radar 回報

如果他們不能夠改善 Heiti TC 這套字體的品質,至少維持使用目前的系統字體。

請一人一信抵制蘋果使用 Heiti TC 做為 Mac OS X 10.6 Snow Leopard 預設字體

在最新一版的 Mac OS X 10.6 Snow Leopard Developer preview 版本中,可以看到蘋果將系統預設的中文字體,從 Li Hei Pro 換成 Heiti TC-這套字體在 10.5 Leopard 中也可以找到。如果你是 Mac OS X 的中文使用者,您應該想辦法阻止蘋果做出這樣的設計。原因很簡單,Heiti TC 實在是太醜了。

Heiti TC 的第一個大問題,就在於每個標點符號都放在奇怪的位置上。例如,句號是放在垂直中央的部份,但是逗號卻放在對齊基線的位置-就中文排版而言,目前簡體中文是將標點符號統一放在基線位置,而繁體中文則是放在垂直中心位置,但是 Heiti TC 的設計,卻完全不符合其中任何一種排版的要求。換言之,如果這套字體變成系統預設字體,那麼當你瀏覽網頁的時候,等於是看到一整頁完全無法忍受的編排,而如果你使用 Pages 編輯中文文件,也預設 fallback 到這套字體,也等於是容易製作出編排非常不專業而且閱讀體驗極差無比的文件。

如果你希望你在幾個月之後使用的 Mac OS X 的中文系統不是這個樣子,你可以-

如果他們不能夠改善 Heiti TC 這套字體的品質,至少維持使用目前的系統字體。