摩茲工寮 Mozilla Community Space Taipei | MozTW, Mozilla Taiwan Community
摩茲工寮是為社群所設計、也由社群共同管理的空間。我們有桌椅、電力與網路、激發創意的小物,當然還有許多的 Mozillians,聚集在此討論、研究 Mozilla 與開放文化等領域,為自己熱愛的 Open Web 加柴添火。摩茲工寮歡迎社群成員免費使用,歡迎加入、一同塑造屬於我們的 Web。
GitHub
<http://summit.g0v.tw|summit.g0v.tw> - g0v summit 2014 website
GitHub
hexo - A fast, simple & powerful blog framework, powered by Node.js.
創用CC - Creative Commons Taiwan x OCF 開放文化基金會 x <http://g0v.tw|g0v.tw> 台灣零時政府 第二次設計松 <http://beta.hackfoldr.org/designer2>
透過 Typeform 創建,這個免費的線上調查工具能讓你輕鬆建立美觀的跨平台線上表單和問卷。立即註冊嘗試一下!
g0v hackath17n | 台灣零時政府第拾柒次立委改選黑客松
從 2012 年底開始,g0v 社群持續舉辦每兩個月一次百人黑客松,提供推動資訊透明、開放參與的公民協作平台,大家一起吃了很多披薩炸雞,同時催生多項專案。開放政府、太陽花運動、社會議題都有 g0v 貢
devsign
Tracking & Character Spacing in iOS
In tools like Photoshop and InDesign, tracking is the term that describes the relative amount of spacing between characters in a string of text. A wonderful bit about tracking: pick a value, and your text will have that same visual style, regardless of the font size. It scales: See how the spacing in between characters scales with the type size? Unfortunately, tracking doesn't exist in iOS. What we *do* have available is character spacing: See how the smaller type sizes are more spread out than their larger counterparts? See how character spacing doesn't look the same when you change type size? Sketch is a great help with this - when you change a label's text size, the character spacing scales automatically - but this isn't helpful to your iOS dev: if there are 8 different type sizes in your app, then they've got 8 character spacing values to worry about, rather than just a single tracking value. So: we need a way to represent tracking in code, and when we came up against this problem, I couldn't find a single implementation of this on the web - which meant we had to make one. I created lots of PSDs and Sketch files, comping up different tracking values and character spacing values, and doing pixel comparisons to figure out what lined up. Once I found a match between tracking, character spacing, and font size, I put it in a spreadsheet and worked out some theories as to how the two were related - and after a bit of algebra, I found that it was actually a *very* simple relationship: characterSpacing = fontSize * tracking / 1000 At first, I thought, "1000? Really? That's the magic number?" - but then this hypothesis totally worked on other yet-untested scenarios, so that's where we landed. Here's how you can put it to use: If you want an easy way to convert between character spacing and tracking, I have a handy Soulver document here. If you're a dev, and you want a category method that'll return a properly-tracked attributed string, you can find one over on GitHub here. + (instancetype) dvs_attributedStringWithString:(NSString *)string tracking:(CGFloat)tracking font:(UIFont *)font { CGFloat fontSize = font.pointSize; CGFloat characterSpacing = tracking * fontSize / 1000; NSDictionary *attributes = @{NSFontAttributeName: font, NSKernAttributeName: [NSNumber numberWithFloat:characterSpacing]}; return [[NSAttributedString alloc] initWithString:string attributes:attributes]; } Here's how you'd use it in practice: self.label.attributedText = [NSAttributedString dvs_attributedStringWithString:@"DEVSIGN" tracking:200 font:[UIFont systemFontOfSize:17.f]];
InVision Share Link
Click here to view the prototype `g0v`
Political Donation Income -Desktop