Skip to content

Instantly share code, notes, and snippets.

@littlebtc
littlebtc / gist:ecfbcb69bbde917593e4
Created July 19, 2014 16:50
「我也要用 Noto Sans」 OS X 10.9 篇

警告:小B 不負責造成電腦變成磚塊的可能性(喂

安裝字體

  1. 下載 Noto Sans 繁簡體字體包,全部的 OTF 檔都丟進 /Library/Fonts
  2. 為了避免登入畫面破字,要修改這些檔案的權限。全部改 644,而且 Owner 要改 root(如果你有潔癖,可以順便把 Group 改 wheel :P)。

修改系統字體

  1. 找到 /System/Library/Frameworks/CoreText.framework
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label value="Enter Your Name:" control="name" accesskey="N" />
<textbox id="name" value="" />
<button label="OK" oncommand="alert('Hello, ' + document.getElementById('name').value + '!');" />
</window>
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label value="Horizontal layout"/>
<hbox>
<button label="horizontal1" flex="1"/>
<button label="horizontal2" flex="2"/>
<button label="horizontal3" flex="3"/>
</hbox>
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<groupbox>
<caption label="Login"/>
<grid>
<columns>
<column flex="1"/>
<column flex="2"/>
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<dialog id="mydialog" title="Dialog Example"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept,cancel"
buttonlabelcancel="Cancel"
buttonlabelaccept="Send"
ondialogaccept="alert('Thank you, ' + document.getElementById('name').value + '!');"
ondialogcancel="alert('canceled!');">
Index: script.js
===================================================================
--- script.js (revision 13)
+++ script.js (working copy)
@@ -59,7 +59,7 @@
var writeIntoFile = function(filepath, content, charset) {
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(filepath);
var fostream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
fostream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
/* Get a charset converter-enabled stream */
jetpack.future.import('slideBar');
var html = <>
<html lang="ja">
<head>
<style type="text/css">
<![CDATA[
body {
background: white;
font-size: 12px;
sudo gem install mongrel
// Start
mongrel_rails start -d -p 3838 -P ~/git/mongrel.pid
// Stop
mongrel_rails stop ~/git/mongrel.pid
def doggy
@doggy = Doggy.find_by_id(1)
end