annotate Applications/StoneWebViewer/Resources/Fonts.txt @ 2006:862c572021de

back to mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Nov 2022 17:10:04 +0100
parents 05b55b89a134
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1660
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 Tools for handling TTF and WOFF2
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 ================================
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 https://fr.wikipedia.org/wiki/Web_Open_Font_Format_2
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 Print info about a TTF
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 ----------------------
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 $ sudo apt-get install fontconfig
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 $ fc-query ./2017-11-13-OpenSans-Regular.ttf
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 => The "lang" and the "capability" are interesting to know the
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 supported language. "en" and "otlayout:latn" are a must.
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 Get version of a TTF
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 --------------------
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 $ fc-query -f '%{fontversion}\n' ./OpenSans/2017-11-13-OpenSans-Regular.ttf | \
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 grep -v 'id' | perl -E 'printf "%.3f\n", <>/65536.0'
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 => "1.100" indicates version "1.1"
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 Source: https://stackoverflow.com/a/43614521/881731
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 Conversion from TTF to WOFF2
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 ----------------------------
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 $ sudo apt install woff2
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 $ woff2_compress 2017-11-13-OpenSans-Regular.ttf
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 Source: https://dev.to/benjaminblack/converting-ttf-fonts-to-woff2-and-woff-3f5b
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 OpenSans
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 ========
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 General information
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 -------------------
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 Official repository:
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 https://github.com/googlefonts/opensans/tree/master/
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 License:
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 Apache License 2.0
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 Google Fonts:
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 https://fonts.google.com/specimen/Open+Sans#license
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 Google CDN:
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 https://fonts.googleapis.com/css?family=Open+Sans
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 Debian package:
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 $ sudo apt-get install fonts-open-sans
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 $ ls -l /usr/share/fonts/truetype/open-sans/
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 Playing with the CDN
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 --------------------
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 To fetch the WOFF2 from CDN (selecting WOFF2 instead of TTF is done by
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 setting the HTTP Header User-Agent):
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 $ cd /tmp
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 $ curl -H 'User-Agent: AppleWebKit/537 Chrome/85' 'https://fonts.googleapis.com/css?family=Open+Sans'
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 => The "latin" section is what we're looking for
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 $ wget https://fonts.gstatic.com/s/opensans/v18/mem8YaGs126MiZpBA-UFVZ0b.woff2
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 To fetch the TTF from CDN:
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 $ curl 'https://fonts.googleapis.com/css?family=Open+Sans'
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 $ wget https://fonts.gstatic.com/s/opensans/v18/mem8YaGs126MiZpBA-UFVZ0e.ttf
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 $ woff2_compress mem8YaGs126MiZpBA-UFVZ0e.ttf
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 $ diff -s ./mem8YaGs126MiZpBA-UFVZ0e.woff2 ./mem8YaGs126MiZpBA-UFVZ0b.woff2
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 => The files are identical
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 As of 2020-11-19, the version of the TTF is "1.101":
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 $ fc-query -f '%{fontversion}\n' ./mem8YaGs126MiZpBA-UFVZ0e.ttf | \
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 grep -v 'id' | perl -E 'printf "%.3f\n", <>/65536.0'
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 Generation of the "./OpenSans" folder
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 -------------------------------------
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 $ mkdir ./OpenSans
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 $ cd ./OpenSans
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 $ REVISION=c0d8ce7dd46291a5d429ac537ddcd3617f4dc229
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 $ wget https://github.com/googlefonts/opensans/raw/master/LICENSE.txt
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 $ curl https://raw.githubusercontent.com/googlefonts/opensans/${REVISION}/ttfs/OpenSans-Regular.ttf > 2017-11-13-OpenSans-Regular.ttf
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 $ woff2_compress 2017-11-13-OpenSans-Regular.ttf
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 => Note that the version of the TTF font is "2.010" (so more recent
05b55b89a134 use local copy of open-sans, remove ua-parser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 than the font on Google Fonts CDN)