@math-blocks/fonts 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md CHANGED
@@ -10,7 +10,7 @@ The JavaScript in `dist/` is released under the MIT License, like the rest of
10
10
  ## Fonts
11
11
 
12
12
  The files in `subsets/` are subsets of the fonts below, renamed to
13
- "MathBlocks Math A" to "MathBlocks Math F". The fonts' licences require or ask
13
+ "MathBlocks Math A" to "MathBlocks Math G". The fonts' licences require or ask
14
14
  for modified versions to be renamed. Each subset keeps its original font's
15
15
  copyright, trademark and licence entries in its `name` table.
16
16
 
@@ -22,6 +22,7 @@ copyright, trademark and licence entries in its `name` table.
22
22
  | `tex-gyre-pagella-math` | MathBlocks Math D | TeX Gyre Pagella Math 1.632 | [GUST Font License](licenses/GUST-FONT-LICENSE.txt) |
23
23
  | `tex-gyre-schola-math` | MathBlocks Math E | TeX Gyre Schola Math 1.533 | [GUST Font License](licenses/GUST-FONT-LICENSE.txt) |
24
24
  | `tex-gyre-termes-math` | MathBlocks Math F | TeX Gyre Termes Math 1.543 | [GUST Font License](licenses/GUST-FONT-LICENSE.txt) |
25
+ | `pennstander-math` | MathBlocks Math G | Pennstander Math 0.001 (variable: `wght`, `MWGT`, `MLNT`) | [SIL Open Font License 1.1](licenses/OFL-1.1.txt) |
25
26
 
26
27
  The GUST Font License is the [LaTeX Project Public License 1.3c](licenses/LPPL-1.3c.txt)
27
28
  plus a request to rename modified versions.
@@ -48,3 +49,9 @@ plus a request to rename modified versions.
48
49
  - **TeX Gyre Termes Math:** Copyright 2012--2014 for Tex Gyre Termes Math OTF
49
50
  by B. Jackowski, P. Strzelczyk and P. Pianowski (on behalf of TeX users
50
51
  groups).
52
+ - **Pennstander Math:** Copyright 2020 The Grandstander Project Authors
53
+ (https://github.com/Etcetera-Type-Co/Grandstander). Copyright 2024 Julius
54
+ Ross. Pennstander Math is by Julius Ross
55
+ (https://github.com/juliusross1/Pennstander), based on Grandstander by
56
+ Etcetera Type Co. (https://etceteratype.co/grandstander). It has no Reserved
57
+ Font Name.
package/README.md CHANGED
@@ -53,10 +53,19 @@ subsets/
53
53
  tex-gyre-pagella-math/
54
54
  tex-gyre-schola-math/
55
55
  tex-gyre-termes-math/
56
+ pennstander-math/
56
57
  licenses/
57
58
  OFL-1.1.txt GUST-FONT-LICENSE.txt LPPL-1.3c.txt
58
59
  ```
59
60
 
61
+ ### Variable fonts
62
+
63
+ `pennstander-math` is a variable font, with weight (`wght`), math weight
64
+ (`MWGT`) and math slant (`MLNT`) axes. Its subsets keep the variation data, so
65
+ they're about twice the size of a static font's. `@math-blocks/opentype`
66
+ draws it at its Regular instance by default, and `font.atLocation(...)` gives
67
+ any other weight or slant.
68
+
60
69
  ## Exports
61
70
 
62
71
  - `fonts`: every font in the package. Each has its display `name`, its
@@ -74,8 +83,8 @@ licenses/
74
83
  ## Licences
75
84
 
76
85
  The JavaScript is MIT-licensed. The fonts keep their original licences:
77
- STIX Two Math is under the SIL Open Font License 1.1, and Latin Modern Math
78
- and the TeX Gyre fonts are under the GUST Font License. See
86
+ STIX Two Math and Pennstander Math are under the SIL Open Font License 1.1,
87
+ and Latin Modern Math and the TeX Gyre fonts are under the GUST Font License. See
79
88
  [LICENSE.md](LICENSE.md) for details and copyright notices.
80
89
 
81
90
  ## Updating the subsets
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** The folder in `subsets/` of each font in fonts.json, in order. */
2
- export declare const FONT_FOLDERS: readonly ['stix-two-math', 'latin-modern-math', 'tex-gyre-bonum-math', 'tex-gyre-pagella-math', 'tex-gyre-schola-math', 'tex-gyre-termes-math'];
2
+ export declare const FONT_FOLDERS: readonly ['stix-two-math', 'latin-modern-math', 'tex-gyre-bonum-math', 'tex-gyre-pagella-math', 'tex-gyre-schola-math', 'tex-gyre-termes-math', 'pennstander-math'];
3
3
  /**
4
4
  * The folder in `subsets/` of a font this package ships, such as
5
5
  * "stix-two-math". It comes from fonts.generated.ts, which
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
1
  // src/fonts.json
3
2
  var fonts$1 = [
4
3
  {
@@ -42,6 +41,13 @@ var fonts$1 = [
42
41
  "source": "texgyretermes-math.otf",
43
42
  "letter": "F",
44
43
  "license": "GUST-Font-License"
44
+ },
45
+ {
46
+ "name": "Pennstander Math",
47
+ "folder": "pennstander-math",
48
+ "source": "PennstanderMathVF.ttf",
49
+ "letter": "G",
50
+ "license": "OFL-1.1"
45
51
  }
46
52
  ];
47
53
  // src/fonts.generated.ts
@@ -52,7 +58,8 @@ const FONT_FOLDERS = [
52
58
  "tex-gyre-bonum-math",
53
59
  "tex-gyre-pagella-math",
54
60
  "tex-gyre-schola-math",
55
- "tex-gyre-termes-math"
61
+ "tex-gyre-termes-math",
62
+ "pennstander-math"
56
63
  ];
57
64
  // src/font-list.ts
58
65
  /** Returns true if `folder` is the folder of a font this package ships. */
@@ -104,8 +111,4 @@ const subsetPath = (folder, group) => {
104
111
  if (!isFontFolder(folder)) throw new Error(`Unknown font folder: "${String(folder)}"`);
105
112
  return `subsets/${folder}/${group}.woff`;
106
113
  };
107
- exports.FONT_FOLDERS = FONT_FOLDERS;
108
- exports.fonts = fonts;
109
- exports.getFont = getFont;
110
- exports.isFontFolder = isFontFolder;
111
- exports.subsetPath = subsetPath;
114
+ export { FONT_FOLDERS, fonts, getFont, isFontFolder, subsetPath };
@@ -1,3 +1,5 @@
1
+ STIX Two Math:
2
+
1
3
  Copyright (c) 2001-2016 by the STI Pub Companies, consisting of the American
2
4
  Chemical Society, the American Institute of Physics, the American Mathematical
3
5
  Society, the American Physical Society, Elsevier, Inc., and The Institute of
@@ -9,6 +11,11 @@ Incorporated.
9
11
  STIX Fonts(TM) is a trademark of The Institute of Electrical and Electronics
10
12
  Engineers, Inc.
11
13
 
14
+ Pennstander Math:
15
+
16
+ Copyright 2020 The Grandstander Project Authors (https://github.com/Etcetera-Type-Co/Grandstander)
17
+ Copyright 2024 Julius Ross
18
+
12
19
  This Font Software is licensed under the SIL Open Font License, Version 1.1.
13
20
  This license is copied below, and is also available with a FAQ at:
14
21
  http://scripts.sil.org/OFL
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@math-blocks/fonts",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Math font subsets (WOFF) for rendering math with math-blocks",
5
5
  "license": "MIT AND OFL-1.1 AND LPPL-1.3c",
6
6
  "repository": {
@@ -10,19 +10,13 @@
10
10
  },
11
11
  "bugs": "https://github.com/math-blocks/math-blocks/issues",
12
12
  "homepage": "https://github.com/math-blocks/math-blocks/tree/main/packages/fonts#readme",
13
+ "type": "module",
13
14
  "main": "./dist/index.js",
14
- "module": "./dist/index.mjs",
15
15
  "types": "./dist/index.d.ts",
16
16
  "exports": {
17
17
  ".": {
18
- "import": {
19
- "types": "./dist/index.d.mts",
20
- "default": "./dist/index.mjs"
21
- },
22
- "require": {
23
- "types": "./dist/index.d.ts",
24
- "default": "./dist/index.js"
25
- }
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
26
20
  },
27
21
  "./subsets/*": "./subsets/*",
28
22
  "./licenses/*": "./licenses/*",
package/dist/index.d.mts DELETED
@@ -1,70 +0,0 @@
1
- /** The folder in `subsets/` of each font in fonts.json, in order. */
2
- export declare const FONT_FOLDERS: readonly ['stix-two-math', 'latin-modern-math', 'tex-gyre-bonum-math', 'tex-gyre-pagella-math', 'tex-gyre-schola-math', 'tex-gyre-termes-math'];
3
- /**
4
- * The folder in `subsets/` of a font this package ships, such as
5
- * "stix-two-math". It comes from fonts.generated.ts, which
6
- * scripts/subset-fonts.py writes from fonts.json: TypeScript widens strings
7
- * imported from JSON to `string`, so fonts.json alone can't give this type.
8
- */
9
- type FontFolder = (typeof FONT_FOLDERS)[number];
10
- /** Returns true if `folder` is the folder of a font this package ships. */
11
- export declare const isFontFolder: (folder: string) => folder is FontFolder;
12
- /**
13
- * The licence a font is distributed under. Each one's text is in this
14
- * package's `licenses/` folder:
15
- *
16
- * - `'OFL-1.1'`: the SIL Open Font License 1.1 (`licenses/OFL-1.1.txt`).
17
- * - `'GUST-Font-License'`: the GUST Font License
18
- * (`licenses/GUST-FONT-LICENSE.txt`), which is the LaTeX Project Public
19
- * License 1.3c (`licenses/LPPL-1.3c.txt`) plus a request to rename modified
20
- * versions.
21
- */
22
- type FontLicense = 'OFL-1.1' | 'GUST-Font-License';
23
- /** A math font whose subsets this package ships. */
24
- type MathFont = {
25
- /** The name of the font the subsets were made from, e.g. "STIX Two Math". */
26
- readonly name: string;
27
- /**
28
- * The folder in `subsets/` that holds this font's subset files, e.g.
29
- * "stix-two-math".
30
- */
31
- readonly folder: FontFolder;
32
- /**
33
- * The family name inside the subset files, e.g. "MathBlocks Math A". The
34
- * subsets are modified versions of the original font, so they're renamed,
35
- * as the fonts' licences require or ask.
36
- */
37
- readonly family: string;
38
- /**
39
- * The file name of the original font the subsets were made from, e.g.
40
- * "STIX2Math.otf". The original isn't included in this package.
41
- */
42
- readonly source: string;
43
- /** The licence the font, and so its subsets, are distributed under. */
44
- readonly license: FontLicense;
45
- /** The path of the licence's text inside this package. */
46
- readonly licenseFile: string;
47
- };
48
- /**
49
- * Every font whose subsets this package ships. src/fonts.json is the one list
50
- * of fonts: scripts/subset-fonts.py builds the subsets from it, and the tests
51
- * and demo read it too.
52
- */
53
- export declare const fonts: readonly MathFont[];
54
- /** Returns the font whose subsets are in `subsets/<folder>/`, if any. */
55
- export declare const getFont: (folder: string) => MathFont | undefined;
56
- /**
57
- * Returns the path of a subset file inside this package, such as
58
- * `subsets/stix-two-math/base.woff`. `group` is a glyph group's name from
59
- * `glyphGroups` in `@math-blocks/opentype`.
60
- *
61
- * The subsets are WOFF 1.0 files, which `@math-blocks/opentype` reads
62
- * wherever `DecompressionStream` is available (current browsers and Node 18+).
63
- *
64
- * Resolve the path against the installed package, e.g. with
65
- * `require.resolve(`@math-blocks/fonts/${subsetPath(...)}`)` in Node, or copy
66
- * the package's `subsets/` folder to a static host and load it with
67
- * `fromBaseUrl`.
68
- */
69
- export declare const subsetPath: (folder: FontFolder, group: string) => string;
70
- export type { FontFolder, FontLicense, MathFont };
package/dist/index.mjs DELETED
@@ -1,106 +0,0 @@
1
- // src/fonts.json
2
- var fonts$1 = [
3
- {
4
- "name": "STIX Two Math",
5
- "folder": "stix-two-math",
6
- "source": "STIX2Math.otf",
7
- "letter": "A",
8
- "license": "OFL-1.1"
9
- },
10
- {
11
- "name": "Latin Modern Math",
12
- "folder": "latin-modern-math",
13
- "source": "latinmodern-math.otf",
14
- "letter": "B",
15
- "license": "GUST-Font-License"
16
- },
17
- {
18
- "name": "TeX Gyre Bonum Math",
19
- "folder": "tex-gyre-bonum-math",
20
- "source": "texgyrebonum-math.otf",
21
- "letter": "C",
22
- "license": "GUST-Font-License"
23
- },
24
- {
25
- "name": "TeX Gyre Pagella Math",
26
- "folder": "tex-gyre-pagella-math",
27
- "source": "texgyrepagella-math.otf",
28
- "letter": "D",
29
- "license": "GUST-Font-License"
30
- },
31
- {
32
- "name": "TeX Gyre Schola Math",
33
- "folder": "tex-gyre-schola-math",
34
- "source": "texgyreschola-math.otf",
35
- "letter": "E",
36
- "license": "GUST-Font-License"
37
- },
38
- {
39
- "name": "TeX Gyre Termes Math",
40
- "folder": "tex-gyre-termes-math",
41
- "source": "texgyretermes-math.otf",
42
- "letter": "F",
43
- "license": "GUST-Font-License"
44
- }
45
- ];
46
- // src/fonts.generated.ts
47
- /** The folder in `subsets/` of each font in fonts.json, in order. */
48
- const FONT_FOLDERS = [
49
- "stix-two-math",
50
- "latin-modern-math",
51
- "tex-gyre-bonum-math",
52
- "tex-gyre-pagella-math",
53
- "tex-gyre-schola-math",
54
- "tex-gyre-termes-math"
55
- ];
56
- // src/font-list.ts
57
- /** Returns true if `folder` is the folder of a font this package ships. */
58
- const isFontFolder = (folder) => FONT_FOLDERS.includes(folder);
59
- const LICENSE_FILES = {
60
- "OFL-1.1": "licenses/OFL-1.1.txt",
61
- "GUST-Font-License": "licenses/GUST-FONT-LICENSE.txt"
62
- };
63
- const isLicense = (license) => Object.prototype.hasOwnProperty.call(LICENSE_FILES, license);
64
- /**
65
- * Turns an entry in fonts.json into a MathFont, checking its licence and
66
- * folder, since TypeScript reads both from the JSON as plain strings.
67
- */
68
- const toMathFont = (font) => {
69
- if (!isLicense(font.license)) throw new Error(`Unknown licence for ${font.name}: ${font.license}`);
70
- if (!isFontFolder(font.folder)) throw new Error(`${font.folder} isn't in fonts.generated.ts; run scripts/subset-fonts.py`);
71
- return {
72
- name: font.name,
73
- folder: font.folder,
74
- family: `MathBlocks Math ${font.letter}`,
75
- source: font.source,
76
- license: font.license,
77
- licenseFile: LICENSE_FILES[font.license]
78
- };
79
- };
80
- // src/index.ts
81
- /**
82
- * Every font whose subsets this package ships. src/fonts.json is the one list
83
- * of fonts: scripts/subset-fonts.py builds the subsets from it, and the tests
84
- * and demo read it too.
85
- */
86
- const fonts = fonts$1.map(toMathFont);
87
- /** Returns the font whose subsets are in `subsets/<folder>/`, if any. */
88
- const getFont = (folder) => fonts.find((font) => font.folder === folder);
89
- /**
90
- * Returns the path of a subset file inside this package, such as
91
- * `subsets/stix-two-math/base.woff`. `group` is a glyph group's name from
92
- * `glyphGroups` in `@math-blocks/opentype`.
93
- *
94
- * The subsets are WOFF 1.0 files, which `@math-blocks/opentype` reads
95
- * wherever `DecompressionStream` is available (current browsers and Node 18+).
96
- *
97
- * Resolve the path against the installed package, e.g. with
98
- * `require.resolve(`@math-blocks/fonts/${subsetPath(...)}`)` in Node, or copy
99
- * the package's `subsets/` folder to a static host and load it with
100
- * `fromBaseUrl`.
101
- */
102
- const subsetPath = (folder, group) => {
103
- if (!isFontFolder(folder)) throw new Error(`Unknown font folder: "${String(folder)}"`);
104
- return `subsets/${folder}/${group}.woff`;
105
- };
106
- export { FONT_FOLDERS, fonts, getFont, isFontFolder, subsetPath };