├── .gitignore
├── README.md
├── dist
└── demo.html
├── docs
├── demo.html
├── faux-bold2.png
├── faux-italic.png
└── normal.png
├── faux-pas.init.js
├── faux-pas.js
├── gulpfile.js
├── package.json
└── test
├── fonts.css
├── fonts
└── OpenSans
│ ├── OpenSans-Bold.woff
│ ├── OpenSans-BoldItalic.woff
│ ├── OpenSans-Italic.woff
│ └── OpenSans-Regular.woff
└── index.html
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | :warning: This project is archived and the repository is no longer maintained.
2 |
3 | # faux pas, a faux web font detector
4 |
5 | A script to highlight elements that are mismatched incorrectly to @font-face blocks, which may result in shoddy faux bold or faux italic rendering. Works standalone—no dependencies.
6 |
7 | Want this on the command line? Check out [`node-faux-pas`](https://github.com/filamentgroup/node-faux-pas).
8 |
9 | ## [Demo](https://filamentgroup.github.io/faux-pas/dist/demo.html)
10 |
11 | A more [comprehensive test page](https://filamentgroup.github.io/faux-pas/test/index.html) is also available.
12 |
13 | ## What is this?
14 |
15 | When you include a CSS `@font-face` block on your page, you specify a `font-family`, `font-weight`, and `font-style` inside that block. When you use a web font, you specify those same properties on elements on your page. While you need to match the value of `font-family` exactly to use the web font, `font-weight` and `font-style` do not require exact matching. This can lead to unexpected behavior as the browser uses what is available, even if it’s not a good match.
16 |
17 | Further, if your element wants a `font-weight` less than or equal to `500` but your `@font-face` block has only variants of your typeface that are bold, the browser will attempt to synthesize a bold web font for you. This synthesized rendering is often sub-par. The same synthesis happens when you want italic, but no italic web font is available. This behavior could be controlled with the [`font-synthesis`](http://stateofwebtype.com/#font-synthesis) property if browsers supported it.
18 |
19 | `faux-pas` helps you by logging and reporting these mismatches and faux renderings so that you can fix the offending code.
20 |
21 | ### Standard rendering of Open Sans
22 |
23 | 
24 |
25 | ### Faux Bold Open Sans
26 |
27 | 
28 |
29 | ### Faux Italic Open Sans
30 |
31 | 
32 |
33 | ## Installation
34 |
35 | Available on npm as `fg-faux-pas`:
36 |
37 | ```
38 | npm install --save-dev fg-faux-pas
39 | ```
40 |
41 | ## Usage
42 |
43 | * Bookmarklet: Get the bookmarklet at the [demo page](https://filamentgroup.github.io/faux-pas/dist/demo.html). Drag it to your bookmarklets and use where needed. By default it highlights elements on your page but check the console for more output.
44 | * Recommended: Include in your pattern library build. Include both `faux-pas.js` and `faux-pas.init.js` (tip: use your own init file to change configuration options).
45 | * Also on the command line: [`node-faux-pas`](https://github.com/filamentgroup/node-faux-pas)
46 |
47 | ## Options
48 |
49 | * `console: true`: uses `console` to output full logging information (warnings for mismatched elements and errors for faux rendering).
50 | * `highlights: true`: adds a specific style to mismatched/faux elements on the page for visual inspection.
51 | * `mismatches: true`: a mismatch may not be a faux rendering even though it’s a misconfiguration—this option allows you to disable these warnings.
52 |
53 | ## Browser Support
54 |
55 | Anything that supports the [CSS Font Loading API](http://caniuse.com/#feat=font-loading):
56 |
57 | * Google Chrome 35+
58 | * Opera 22+
59 | * Firefox 41+
60 | * Safari 10+
61 | * Mobile Safari 10+
62 | * Android Chromium WebView
63 | * Chrome for Android
64 | * _and others_
65 |
66 | ## Build
67 |
68 | Use `gulp` to generate a new docs HTML file (automatically updates the bookmarklet with the latest code).
69 |
--------------------------------------------------------------------------------
/dist/demo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
faux-pas does not run automatically here. You must use the bookmarklet above. Click the bookmarklet link or Drag the link to your bookmarks to try it out. Check your console!
34 |
35 |
36 |
37 |
sans-serif (no web fonts)
38 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
39 |
40 |
Open Sans: Faux Everything
41 |
42 |
Roman
43 |
Bold (700)
44 |
Italic
45 |
Bold (700) & Italic
46 |
47 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
48 |
49 |
50 |
Open Sans: Faux Bold, Bold Italic
51 |
52 |
Roman
53 |
Bold (700)
54 |
Italic
55 |
Bold (700) & Italic
56 |
57 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
58 |
59 |
Open Sans: Faux Italic, Bold Italic
60 |
61 |
Roman
62 |
Bold (700)
63 |
Italic
64 |
Bold (700) & Italic
65 |
66 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
67 |
68 |
Open Sans: No Faux
69 |
70 |
Roman
71 |
Bold (700)
72 |
Italic
73 |
Bold (700) & Italic
74 |
75 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
76 |
77 |
Open Sans: Perfect Match
78 |
79 |
Roman
80 |
Bold (700)
81 |
Italic
82 |
Bold (700) & Italic
83 |
84 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
85 |
86 |
Open Sans: Mismatched Request, No Faux
87 |
88 |
font-weight: 300, default is 400
89 |
90 |
91 |
Roman
92 |
Bold (700)
93 |
Italic
94 |
Bold (700) & Italic
95 |
96 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
faux-pas does not run automatically here. You must use the bookmarklet above. Click the bookmarklet link or Drag the link to your bookmarks to try it out. Check your console!
34 |
35 |
36 |
37 |
sans-serif (no web fonts)
38 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
39 |
40 |
Open Sans: Faux Everything
41 |
42 |
Roman
43 |
Bold (700)
44 |
Italic
45 |
Bold (700) & Italic
46 |
47 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
48 |
49 |
50 |
Open Sans: Faux Bold, Bold Italic
51 |
52 |
Roman
53 |
Bold (700)
54 |
Italic
55 |
Bold (700) & Italic
56 |
57 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
58 |
59 |
Open Sans: Faux Italic, Bold Italic
60 |
61 |
Roman
62 |
Bold (700)
63 |
Italic
64 |
Bold (700) & Italic
65 |
66 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
67 |
68 |
Open Sans: No Faux
69 |
70 |
Roman
71 |
Bold (700)
72 |
Italic
73 |
Bold (700) & Italic
74 |
75 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
76 |
77 |
Open Sans: Perfect Match
78 |
79 |
Roman
80 |
Bold (700)
81 |
Italic
82 |
Bold (700) & Italic
83 |
84 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
85 |
86 |
Open Sans: Mismatched Request, No Faux
87 |
88 |
font-weight: 300, default is 400
89 |
90 |
91 |
Roman
92 |
Bold (700)
93 |
Italic
94 |
Bold (700) & Italic
95 |
96 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
Faux bold and faux italic expected behavior has a green outline demo-only style. If you see a green outline without a red background color, this is an error! If an element has picked a matching @font-face block, but the match isn’t exact (wanted Italic, but only Bold Italic was available—not technically font synthesis/faux), this will show a pink background color. If you see a blue outline without a pink background color, this is an error!
54 |
55 |
0000 sans-serif (no web fonts)
56 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
57 |
58 |
0001 Open Sans: No Faux
59 |
60 |
Roman
61 |
Bold (700)
62 |
Italic
63 |
Bold (700) & Italic
64 |
65 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
66 |
67 |
This is roman text.
68 |
This is roman text (control).
69 |
70 |
71 |
This is bold text.
72 |
This is bold text (control).
73 |
74 |
75 |
This is italic text.
76 |
This is italic text (control).
77 |
78 |
79 |
This is bold and italic text.
80 |
This is bold and italic text (control).
81 |
82 |
83 |
0010 Open Sans: Faux Bold, Bold Italic
84 |
85 |
Roman
86 |
Bold (700)
87 |
Italic
88 |
Bold (700) & Italic
89 |
90 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
91 |
92 |
This is roman text.
93 |
This is roman text (control).
94 |
95 |
96 |
This is bold text.
97 |
This is bold text (control).
98 |
99 |
100 |
This is italic text.
101 |
This is italic text (control).
102 |
103 |
104 |
This is bold and italic text.
105 |
This is bold and italic text (control).
106 |
107 |
108 |
0011 Open Sans: No Faux
109 |
110 |
Roman
111 |
Bold (700)
112 |
Italic
113 |
Bold (700) & Italic
114 |
115 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
116 |
117 |
This is roman text.
118 |
This is roman text (control).
119 |
120 |
121 |
This is bold text.
122 |
This is bold text (control).
123 |
124 |
125 |
This is italic text.
126 |
This is italic text (control).
127 |
128 |
129 |
This is bold and italic text.
130 |
This is bold and italic text (control).
131 |
132 |
133 |
0110 Open Sans, Faux Bold Italic
134 |
135 |
Roman
136 |
Bold (700)
137 |
Italic
138 |
Bold (700) & Italic
139 |
140 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
141 |
142 |
This is roman text.
143 |
This is roman text (control).
144 |
145 |
146 |
This is bold text.
147 |
This is bold text (control).
148 |
149 |
150 |
This is italic text.
151 |
This is italic text (control).
152 |
153 |
154 |
This is bold and italic text.
155 |
This is bold and italic text (control).
156 |
157 |
158 |
0111 Open Sans: No Faux
159 |
160 |
Roman
161 |
Bold (700)
162 |
Italic
163 |
Bold (700) & Italic
164 |
165 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
166 |
167 |
This is roman text.
168 |
This is roman text (control).
169 |
170 |
171 |
This is bold text.
172 |
This is bold text (control).
173 |
174 |
175 |
This is italic text.
176 |
This is italic text (control).
177 |
178 |
179 |
This is bold and italic text.
180 |
This is bold and italic text (control).
181 |
182 |
183 |
1000 Open Sans: Faux Everything
184 |
185 |
Roman
186 |
Bold (700)
187 |
Italic
188 |
Bold (700) & Italic
189 |
190 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
191 |
192 |
This is roman text.
193 |
This is roman text (control).
194 |
195 |
196 |
This is bold text.
197 |
This is bold text (control).
198 |
199 |
200 |
This is italic text.
201 |
This is italic text (control).
202 |
203 |
204 |
This is bold and italic text.
205 |
This is bold and italic text (control).
206 |
207 |
208 |
1001 Open Sans: Faux Bold, Mismatch Italic
209 |
210 |
Roman
211 |
Bold (700)
212 |
Italic
213 |
Bold (700) & Italic
214 |
215 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
216 |
217 |
This is roman text.
218 |
This is roman text (control).
219 |
220 |
221 |
This is bold text.
222 |
This is bold text (control).
223 |
224 |
225 |
This is italic text.
226 |
This is italic text (control).
227 |
228 |
229 |
This is bold and italic text.
230 |
This is bold and italic text (control).
231 |
232 |
233 |
1010 Open Sans: Faux Bold, Bold Italic
234 |
235 |
Roman
236 |
Bold (700)
237 |
Italic
238 |
Bold (700) & Italic
239 |
240 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
241 |
242 |
This is roman text.
243 |
This is roman text (control).
244 |
245 |
246 |
This is bold text.
247 |
This is bold text (control).
248 |
249 |
250 |
This is italic text.
251 |
This is italic text (control).
252 |
253 |
254 |
This is bold and italic text.
255 |
This is bold and italic text (control).
256 |
257 |
258 |
1011 Open Sans: Faux Bold
259 |
260 |
Roman
261 |
Bold (700)
262 |
Italic
263 |
Bold (700) & Italic
264 |
265 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
266 |
267 |
This is roman text.
268 |
This is roman text (control).
269 |
270 |
271 |
This is bold text.
272 |
This is bold text (control).
273 |
274 |
275 |
This is italic text.
276 |
This is italic text (control).
277 |
278 |
279 |
This is bold and italic text.
280 |
This is bold and italic text (control).
281 |
282 |
283 |
1100 Open Sans: Faux Italic, Bold Italic
284 |
285 |
Roman
286 |
Bold (700)
287 |
Italic
288 |
Bold (700) & Italic
289 |
290 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
291 |
292 |
This is roman text.
293 |
This is roman text (control).
294 |
295 |
296 |
This is bold text.
297 |
This is bold text (control).
298 |
299 |
300 |
This is italic text.
301 |
This is italic text (control).
302 |
303 |
304 |
This is bold and italic text.
305 |
This is bold and italic text (control).
306 |
307 |
308 |
1101 Open Sans: No Faux
309 |
310 |
Roman
311 |
Bold (700)
312 |
Italic
313 |
Bold (700) & Italic
314 |
315 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
316 |
317 |
This is roman text.
318 |
This is roman text (control).
319 |
320 |
321 |
This is bold text.
322 |
This is bold text (control).
323 |
324 |
325 |
This is italic text.
326 |
This is italic text (control).
327 |
328 |
329 |
This is bold and italic text.
330 |
This is bold and italic text (control).
331 |
332 |
333 |
1110 Open Sans: Faux Bold-Italic
334 |
335 |
Roman
336 |
Bold (700)
337 |
Italic
338 |
Bold (700) & Italic
339 |
340 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
341 |
342 |
This is roman text.
343 |
This is roman text (control).
344 |
345 |
346 |
This is bold text.
347 |
This is bold text (control).
348 |
349 |
350 |
This is italic text.
351 |
This is italic text (control).
352 |
353 |
354 |
This is bold and italic text.
355 |
This is bold and italic text (control).
356 |
357 |
358 |
1111 Open Sans: Perfect Match
359 |
360 |
Roman
361 |
Bold (700)
362 |
Italic
363 |
Bold (700) & Italic
364 |
365 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
366 |
367 |
1111 Open Sans: Mismatched Request, No Faux
368 |
369 |
font-style: normal
370 |
font-weight: 300, default is 400
371 |
372 |
373 |
Roman
374 |
Bold (700)
375 |
Italic
376 |
Bold (700) & Italic
377 |
378 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.
379 |
380 |
1111 Open Sans: Mismatched Request, No Faux
381 |
382 |
font-style: normal
383 |
font-weight: 600, default is 400
384 |
385 |
386 |
Roman
387 |
Bold (700)
388 |
Italic
389 |
Bold (700) & Italic
390 |
391 |
This is roman text. This is bold text.This is italic text.This is bold and italic text. This is roman text. This is bold text.This is italic text.This is bold and italic text.