Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Signature Tool
Search
Ji Guang
November 09, 2012
Technology
1
82
Signature Tool
no
Ji Guang
November 09, 2012
Tweet
Share
More Decks by Ji Guang
See All by Ji Guang
Adobe Edge Preview
jiguang
0
76
Blogging Like A Hacker
jiguang
5
280
Basic JavaScript Coding Patterns
jiguang
4
650
Javascript正则表达式
jiguang
3
690
虚拟机调试
jiguang
1
110
DNS缓存清除
jiguang
0
120
哈工大90周年校庆吉祥物评比
jiguang
0
170
Other Decks in Technology
See All in Technology
品質のための共通認識
kakehashi
PRO
3
250
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
180
生成AIでテスト設計はどこまでできる? 「テスト粒度」を操るテーラリング術
shota_kusaba
0
710
寫了幾年 Code,然後呢?軟體工程師必須重新認識的 DevOps
cheng_wei_chen
1
1.4k
年間40件以上の登壇を続けて見えた「本当の発信力」/ 20251213 Masaki Okuda
shift_evolve
PRO
1
120
[デモです] NotebookLM で作ったスライドの例
kongmingstrap
0
140
eBPFとwaruiBPF
sat
PRO
4
2.6k
文字列の並び順 / Unicode Collation
tmtms
3
570
.NET 10の概要
tomokusaba
0
100
MapKitとオープンデータで実現する地図情報の拡張と可視化
zozotech
PRO
1
140
mairuでつくるクレデンシャルレス開発環境 / Credential-less development environment using Mailru
mirakui
1
170
新 Security HubがついにGA!仕組みや料金を深堀り #AWSreInvent #regrowth / AWS Security Hub Advanced GA
masahirokawahara
1
1.9k
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Practical Orchestrator
shlominoach
190
11k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Transcript
Signature Tool Improvement Howelin & Laserji 20120919
Implementation HTML5 Canvas PHP GD (SUSE) SUPPORTED ? Canvas :
PHP
Piece of code Canvas Basics Load Image Text Metrics @font-face
(Drag &) Drop Compositing
Canvas Basics <canvas>Sorry!</canvas> try{ document.createElement(‘canvas’).getContext( ‘2d’); }catch(e){ } var canvas
= document.getElementById(‘canvas’); var context = canvas.getContext(‘2d’); context.fillText(‘Hello’,200,60);
Load Image var img_pop = new Image(); img_pop.src = ‘img/pop.png’;
img_pop.onload = function(){ // do sth. }
Text Metrics context.measureText(text).width; The measureText() method returns an object that
contains the width of the specified text, in pixels.
@font-face @font-face { font-family: 'GothamRoundedBook'; src: url("GothamRnd-Book.otf"); } .canvas{font-family: ‘GothamRoundedBook’;}
/*must be used somewhere*/
@font-face @font-face { font-family: MyHelvetica; src: local("Helvetica Neue Bold"), local("HelveticaNeue-Bold"),
url(MgOpenModernaBold.ttf); font-weight: bold; }
@font-face IE:Embedded OpenType(.eot) Firefox:TrueType,OpenType(.ttf, .otf) & WOFF Chrome:TrueType,OpenType(.ttf, .otf) &
SVG Font(.svg) Safari:TrueType,OpenType(.ttf, .otf) & SVG Font(.svg) Opera:TrueType,OpenType(.ttf, .otf) & SVG Font(.svg)
@font-face WHY NOT? COPYRIGHT & FOUT(Flash of unstyled Text) http://www.google.com/webfonts
(FREE) http://www.fontsquirrel.com/fontface/genera tor (HAS A BLACKLIST)
(Drag &) Drop <span id="custom" ondragenter="return false" ondragover="return false"> Drop
Yours</span> $('#custom')[0].ondrop = function(e){ // do sth. };
(Drag &) Drop DataTransfer e.dataTransfer.files // FileList same as <input
id=“fileItem” type=“file”> var file = document.getElementById('fileItem').files[0 ];
• Compositing globalCompositeOperation = type
Compositing Image must loaded first Image z-Index
Welcome Howe !!!