-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
76 lines (61 loc) · 3.73 KB
/
index.html
File metadata and controls
76 lines (61 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Griffpatch Font To Scratch Costumes</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:r,b,semibold" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
</head>
<body>
<div id="main">
<script type="text/javascript" src="opentype.min.js"></script>
<script type="text/javascript" src="jszip.min.js"></script>
<script type="text/javascript" src="crypto-js.min.js"></script>
<script type="text/javascript" src="main.js"></script>
<h1>Griffpatch Scratch Font Converter</h1>
<p><i>Adapted directly from RexScratch's Stamp Font Engine Font Injector</i></p>
<h6><b>Step 1</b> - Download Font Files (ttf,otf,zip) to your device</h6>
<!-- <div class="input-holder">
<label>Google font: <select id="selectFamily" class="input"></select></label>
</div> -->
<p><a href="https://fonts.google.com/" target="_blank">https://fonts.google.com/</a> - A wonderful resource for free fonts!</p>
<br>
<h6><b>Step 2</b> - Import the font into this page here:</h6>
<p><input type="file" accept=".ttf,.otf,.zip" onchange="openFont(event)"></p>
<br>
<!-- <h6>Name of Font to be used in Project</h6> -->
<select id="fontName" style="display: none;"></select>
<fieldset id="fontSelect" style="display: none;">
</fieldset>
<br>
<div id="fontSelected" style="display: none;">
<!-- <h6>Character Set to Inject</h6> -->
<input type="hidden" id="charset" value=" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$¢€£¥%^&*()-–—=≠≈[]\;'‘’,./_+{}|:"“”<≤≥>?`~×÷±°′″">
<!-- <p style="font-weight:600;">Note: All characters of a pre-existing font will be removed before adding the characters above</p> -->
<h6><b>Step 3</b> - Do you want to create a new Sprite File, or modify an existing sprite?</h6>
<p>
<p><i>Creates a New Sprite file for importing into Scratch</i></p>
<p><button type="submit" onclick="createNewSprite()">Create a New Sprite</button></p>
<p><i>or, Import an existing sprite (exported from Scratch), which is then updated with these new font costumes.</i></p>
<p><label><button onclick="document.getElementById('sb3File').click();">Modify Existing Sprite</button><input type="file" id="sb3File" accept=".sprite3" onchange="openSb3(event)" style="display:none;"></label></p>
<!-- <p style="font-weight:600;">Note: The project must contain a Stamp Font Engine sprite. Using a new project won't work.</p> -->
<!-- <h6>Name of Stamp Font Engine Sprite in Project</h6>
<input type="text" value="Stamp Font" id="spriteName"> -->
</p>
</div>
<!-- <p>The resulting sprite3 file can be imported into any Scratch project as a new sprite</p>
<h2>Libraries Used</h2>
<p>For anyone curious:</p>
<ul>
<li>RexScratch on GitHub <a href="https://github.com/RexScratch/RexScratch.github.io/">(Link)</a></li>
<li>opentype.js <a href="https://github.com/opentypejs/opentype.js">(Link)</a></li>
<li>JSZip <a href="https://github.com/Stuk/jszip">(Link)</a></li>
<li>crypto-js <a href="https://github.com/brix/crypto-js">(Link)</a></li>
</ul>
-->
</div>
</body>
</html>