Tag Archives: Google

思源/Noto pan-CJK 字體 & Ubuntu

以開源協議授權釋出的字體大多數以拉丁字母等歐洲語言爲主,但最近 Adobe 和 Google 共同推出的思源/Noto pan-CJK 開源字體不只涵蓋了大部份中日韓所需要的字型,而且繁中、簡中、日文和韓文都用了不同的 OTF 檔案,因此對同一個漢字在不同地區的不同寫法就能個別處理,算是解決了 Unicode 一直爲人詬病的 Han unification 問題。

香港人最關心的應該是該字體是否覆蓋 HKSCS,我檢查過部份 hkscs-2008-big5-iso.txt 的 unicode 碼,在 NotoSansHant 裏都能找到,而且目測在 CJK BCD 區裏都有覆蓋,所以應該夠用(在下面的圖找找吧)。

用 Fontforge 查看 NotoSansHant-Regular.otf
用 Fontforge 查看 NotoSansHant-Regular.otf

從下面幾張 screenshot 可以看到香港字顯示效果理想:


想將 Ubuntu 的桌面 UI 和程式的預設字體改成思源/Noto,可以參考 Ingram Chen 的 blog。小弟改良了一下 Ingram 的 fontconfig 設定檔,使系統在不同 locale 下能優先選擇適當的字體,比如 zh_TW 下繁體的 Noto Sans T Chinese 是第一選擇,在 zh_CN 下則爲簡體的 Noto Sans S Chinese,之後其他的 CJK 字體作爲 fallback。

設定檔已放在 20-noto-cjk.conf,下載後執行:

mkdir ~/.config/fontconfig/conf.d
mv 20-noto-cjk.conf ~/.config/fontconfig/conf.d

另外如果要配置英文字體,可以下載 10-latin.conf,修改一下檔案中的字體部份,同樣放進 ~/.config/fontconfig/conf.d 即可。

Google Chrome is the winner, Javascript speed-wise

Did some benchmark testing on the Javascript engines of several Mac OS X web browsers by using SunSpider and Google’s V8 benchmark suite. Although Google Chrome is still a development release on OS X, it’s already the winner in this test. Safari 4 comes second, it shows similar results in the SunSpider test but loses more in the V8 test. Sadly Firefox 3.5 loses to both of them by quite a significant margin, despite the fact that Firefox 3.5 introduces the new TraceMonkey JavaScript engine. Opera 10.00 beta 2 is just not a viable competitor to all of the others, I hope this is just because of the beta thing.

Here are some charts that show the results:

sunspider javascript benchmark of firefox, safari, opera and chrome

OS X web browser Javascript speed comparison among firefox, safari, opera and google chrome

V8 benchmark total score of Firefox, Safari, Opera and Google Chrome

Google Calendar SMS Alert Comes to China

google-calendar-sms.png

Now Google Calendar users in China can finally enjoy the same SMS alert service as in other countries. Although they mentions China Unicom as the only mobile provider to be supported, I have no problem in registering the service and receiving alerts even I’m a China Mobile subscriber. This alert service is very handy to everyone, as Google Calendar will send you SMS to your mobile phone whenever an event is going to begin.

An interesting tidbit is, they sent the verification code to my mobile phone via HUTCHISON_HK, where HUTCHISON is one of the mobile service providers in Hong Kong. It seems that Google choose neither China Mobile nor China Unicom, the two major mobile providers in China, as their partners.

Combining Google Maps and Google Ditu

Ditu (地圖, 地图) means map in Chinese. China has long been missing from the global Google Maps. Zooming into the China border, only patches of grey blocks are shown, occasionally with blue lines here and there indicating rivers and lakes, and worst of all, maps are just unavailable after you have drilled down deep enough.

Usually this doesn’t pose any problems as Google China serves China maps (and only China maps) at Google 地图, which provides all the functionalities of the global Google Maps website, sans satellite images. This is annoying nevertheless, it’d be the best if users can see maps of China seamlessly when they’re viewing maps.google.com, without jumping out from maps.google.com and then type in another URL just to view some data that’s still backwardly regarded by the Chinese authority as confidential and sensitive.

“Hybrid” mode for China maps is another feature that would be handy to Chinese users. Satellites images are already available but just not being shown on ditu.google.com. Since hybrid mode requires a special layer of map tiles, specially they have a transparent background so that the satellite images can show through underneath the maps, without post-processing map data provided by Mapabc this is not achievable. By Google’s terms of usage of the map data, processing the maps and then re-distribute is not legal. We can only use some freely redistributable map data such as from www.openstreetmap.org.

Hooking up maps.google.com with maps from Google China is not difficult, actually that’s much easier than I thought because Google Maps API already have the mechanism to add a new map type for showing custom map data. My proof-of-concept is shown below, press the “Ditu” button at the top right hand corner and you’ll see maps delivered from ditu.google.com.



Ideally, this “mashup” should best be implemented using the new Google Mapplets, this will give users the best user experience as they only need to add a mapplet and then Google China maps will be embedded to the map window automatically, users are not required to go to this page. But since Google Mapplets doesn’t support adding new map types due to security concerns, this currently is not an option. Frankly, I don’t see there’s any security concerns by supporting new map types.

Don’t be surprised if you notice that the satellite images do not align with the Google China maps, because Google China intentionally shifted the latter to please the Chinese authority. Did it say that the maps are regarded as national security?