-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
188 lines (168 loc) · 5.95 KB
/
index.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Glyph Table</title>
<script src="../../../lib/bower_components/requirejs/require.js"></script>
<script>
fontFiles = [
'../../assets/fonts/Jura-Medium.ttf'
, '../../assets/fonts/MontserratAlternates-Bold.ttf'
, '../../assets/fonts/MontserratAlternates-ExtraBold.ttf'
, '../../assets/fonts/MontserratAlternates-ExtraLight.ttf'
, '../../assets/fonts/Montserrat-Thin.ttf'
, '../../assets/fonts/Quicksand-Bold.ttf'
, '../../assets/fonts/Quicksand-Light.ttf'
, '../../assets/fonts/Quicksand-Medium.ttf'
, '../../assets/fonts/Quicksand-Regular.ttf'
, '../../assets/fonts/Pacifico-Regular.ttf'
, '../../assets/fonts/VT323-Regular.ttf'
, '../../assets/fonts/JosefinSans-ThinItalic.ttf'
, '../../assets/fonts/JosefinSans-Thin.ttf'
, '../../assets/fonts/JosefinSans-SemiBoldItalic.ttf'
, '../../assets/fonts/JosefinSans-Regular.ttf'
, '../../assets/fonts/JosefinSans-LightItalic.ttf'
, '../../assets/fonts/JosefinSans-Light.ttf'
, '../../assets/fonts/JosefinSans-Italic.ttf'
, '../../assets/fonts/JosefinSans-BoldItalic.ttf'
, '../../assets/fonts/JosefinSans-Bold.ttf'
];
require.config({baseUrl: '../../lib'});
require(['bootstrap'], function(require) {
require(['../examples/simple/main'], function(main) {
main(window, fontFiles);
});
});
</script>
<style>
.glyph {
box-sizing: border-box;
display: inline-block;
}
.glyph:nth-child(2n) svg {
background: lightpink;
}
.glyph:nth-child(2n) svg path{
fill:red
}
.glyph svg {
width: 100%;
display: block;
overflow: visible;
}
/* default-widest 20 items */
.glyph {
width: calc(100% / 20);
}
@media (max-width: 1000px) {
.glyph {
width: calc(100% / 16);
}
}
@media (max-width: 700px) {
.glyph {
width: calc(100% / 12);
}
}
@media (max-width: 600px) {
.glyph {
width: calc(100% / 10);
}
}
@media (max-width: 500px) {
.glyph {
width: calc(100% / 8);
}
}
@media (max-width: 400px) {
.glyph {
width: calc(100% / 6);
}
}
@media (max-width: 300px) {
.glyph {
width: calc(100% / 4);
}
}
button.active {
background: lightgreen;
}
button.checked {
background: lightgreen;
}
button.italic-switch.checked:after{
content: ' ☑'
}
button.italic-switch:after {
content: ' ☐'
}
</style>
</head>
<body>
<h1>Font SpecimenTools Example</h1>
<p><em>We only show the very basics here, go to
<a href="https://github.com/graphicore/mdlFontSpecimen">mdlFontSpecimen</a>
to see how these SpecimenTools should be used.</em></p>
<h4>Size of Glyph-Set
<span class="font-data"
data-getter="NumberGlyphs"></span>
</h4>
<h4>Supported Languages
<span class="font-data"
data-getter="NumberSupportedLanguages"></span>
</h4>
<div>
<h4>All Supported Languages</h4>
<p class="font-data"
data-getter="SupportedLanguages"></p>
</h4>
<div>
<h2>Choose a Font</h2>
<div class="family-chooser"></div>
</div>
<div class="type-tester"
data-unit-font-size="px"
data-min-font-size="5"
data-max-font-size="128"
data-step-font-size="1"
data-value-font-size="18"
data-unit-letter-spacing="px"
data-min-letter-spacing="-5"
data-max-letter-spacing="5"
data-value-letter-spacing="0"
data-step-letter-spacing="0.1"
data-unit-line-height="%"
data-min-line-height="50"
data-max-line-height="300"
data-step-line-height="5"
data-value-line-height="100"
data-class-line-height="custom-class special-slider">
<h2 class="mdl-card__title-text">Test the Font</h2>
<h5>Default Features</h5>
<div class="type-tester__features--default"></div>
<h5>Optional Features</h5>
<div class="type-tester__features--optional"></div>
<h5>Font size: <span class="type-tester__label" data-target-property="font-size"></span></h5>
<div class="type-tester__slider" data-target-property="font-size"></div>
<h5>Letter spacing: <span class="type-tester__label" data-target-property="letter-spacing"></span></h5>
<div class="type-tester__slider" data-target-property="letter-spacing"></div>
<h5>Line height: <span class="type-tester__label" data-target-property="line-height"></span></h5>
<div class="type-tester__slider" data-target-property="line-height"></div>
<p class="current-font type-tester__content" contenteditable="true">
TYPE HERE …<br />
Web typography refers to the use of fonts on the World Wide Web. When
HTML was first created, font faces and styles were controlled exclusively
by the settings of each Web browser. There was no mechanism for individual
Web pages to control font display until Netscape introduced the <font>
tag in 1995, which was then standardized in the HTML 3.2 specification.
However, the font specified by the tag had to be installed on the user's
computer or a fallback font, such as a browser's default sans-serif or
monospace font, would be used. The first Cascading Style Sheets specification
was published in 1996 and provided the same capabilities.
</p>
<small><a href="https://en.wikipedia.org/wiki/Web_typography">Source: Wikipedia</a></small>
</div>
<div class="glyph-table"></div>
</div>
</body>
</html>