@formepdf/fonts-standard 0.15.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/AUTHORS +16 -0
- package/OFL.txt +102 -0
- package/README.md +45 -0
- package/dist/generated/font-data.d.ts +2 -0
- package/dist/generated/font-data.js +29 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +73 -0
- package/package.json +45 -0
package/AUTHORS
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
AUTHORS
|
|
2
|
+
|
|
3
|
+
Current Contributors (sorted alphabetically):
|
|
4
|
+
|
|
5
|
+
- Vishal Vijayraghavan <vishalvvr at fedoraproject dot org>
|
|
6
|
+
Project Owner/ Maintainer (Current)
|
|
7
|
+
Red Hat, Inc.
|
|
8
|
+
|
|
9
|
+
Previous Contributors
|
|
10
|
+
- Pravin Satpute <psatpute at redhat dot com>
|
|
11
|
+
Project Owner/ Maintainer
|
|
12
|
+
Red Hat, Inc.
|
|
13
|
+
|
|
14
|
+
- Steve Matteson
|
|
15
|
+
Original Designer
|
|
16
|
+
Ascender, Inc.
|
package/OFL.txt
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
Digitized data copyright (c) 2010 Google Corporation
|
|
2
|
+
with Reserved Font Arimo, Tinos and Cousine.
|
|
3
|
+
Copyright (c) 2012 Red Hat, Inc.
|
|
4
|
+
with Reserved Font Name Liberation.
|
|
5
|
+
|
|
6
|
+
This Font Software is licensed under the SIL Open Font License,
|
|
7
|
+
Version 1.1.
|
|
8
|
+
|
|
9
|
+
This license is copied below, and is also available with a FAQ at:
|
|
10
|
+
http://scripts.sil.org/OFL
|
|
11
|
+
|
|
12
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
13
|
+
|
|
14
|
+
PREAMBLE The goals of the Open Font License (OFL) are to stimulate
|
|
15
|
+
worldwide development of collaborative font projects, to support the font
|
|
16
|
+
creation efforts of academic and linguistic communities, and to provide
|
|
17
|
+
a free and open framework in which fonts may be shared and improved in
|
|
18
|
+
partnership with others.
|
|
19
|
+
|
|
20
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
21
|
+
redistributed freely as long as they are not sold by themselves.
|
|
22
|
+
The fonts, including any derivative works, can be bundled, embedded,
|
|
23
|
+
redistributed and/or sold with any software provided that any reserved
|
|
24
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
25
|
+
however, cannot be released under any other type of license. The
|
|
26
|
+
requirement for fonts to remain under this license does not apply to
|
|
27
|
+
any document created using the fonts or their derivatives.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DEFINITIONS
|
|
32
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
33
|
+
Holder(s) under this license and clearly marked as such.
|
|
34
|
+
This may include source files, build scripts and documentation.
|
|
35
|
+
|
|
36
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
37
|
+
copyright statement(s).
|
|
38
|
+
|
|
39
|
+
"Original Version" refers to the collection of Font Software components
|
|
40
|
+
as distributed by the Copyright Holder(s).
|
|
41
|
+
|
|
42
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
43
|
+
or substituting ? in part or in whole ?
|
|
44
|
+
any of the components of the Original Version, by changing formats or
|
|
45
|
+
by porting the Font Software to a new environment.
|
|
46
|
+
|
|
47
|
+
"Author" refers to any designer, engineer, programmer, technical writer
|
|
48
|
+
or other person who contributed to the Font Software.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
PERMISSION & CONDITIONS
|
|
52
|
+
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
54
|
+
copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
55
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
56
|
+
Software, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
1) Neither the Font Software nor any of its individual components,in
|
|
59
|
+
Original or Modified Versions, may be sold by itself.
|
|
60
|
+
|
|
61
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
62
|
+
redistributed and/or sold with any software, provided that each copy
|
|
63
|
+
contains the above copyright notice and this license. These can be
|
|
64
|
+
included either as stand-alone text files, human-readable headers or
|
|
65
|
+
in the appropriate machine-readable metadata fields within text or
|
|
66
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
67
|
+
|
|
68
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
69
|
+
Name(s) unless explicit written permission is granted by the
|
|
70
|
+
corresponding Copyright Holder. This restriction only applies to the
|
|
71
|
+
primary font name as presented to the users.
|
|
72
|
+
|
|
73
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
74
|
+
Software shall not be used to promote, endorse or advertise any
|
|
75
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
76
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
77
|
+
permission.
|
|
78
|
+
|
|
79
|
+
5) The Font Software, modified or unmodified, in part or in whole, must
|
|
80
|
+
be distributed entirely under this license, and must not be distributed
|
|
81
|
+
under any other license. The requirement for fonts to remain under
|
|
82
|
+
this license does not apply to any document created using the Font
|
|
83
|
+
Software.
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
TERMINATION
|
|
88
|
+
This license becomes null and void if any of the above conditions are not met.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
DISCLAIMER
|
|
93
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
94
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
95
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
96
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
97
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
98
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
99
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
100
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER
|
|
101
|
+
DEALINGS IN THE FONT SOFTWARE.
|
|
102
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @formepdf/fonts-standard
|
|
2
|
+
|
|
3
|
+
Embeddable, metric-compatible replacements for the 14 standard PDF fonts, for producing **accessible (PDF/UA)** and **archival (PDF/A)** documents with [Forme](https://github.com/formepdf/forme).
|
|
4
|
+
|
|
5
|
+
PDF/UA and PDF/A both require every font to be embedded. The 14 standard PDF fonts (Helvetica, Times, Courier, …) are *not* embedded — viewers substitute them — so a document that relies on them cannot conform. This package provides the [Liberation](https://github.com/liberationfonts/liberation-fonts) family (Sans/Serif/Mono), which is **metric-compatible** with Helvetica/Times/Courier by design: substituting it changes nothing about layout. Forme lays out on the standard font metrics and swaps only the embedded glyph program at write time, so `pdfUa` output is geometry-identical to the default.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @formepdf/fonts-standard
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Register the fonts, then enable `pdfUa` — Forme maps the standard base-14 families to the embedded Liberation programs automatically.
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { Font } from '@formepdf/react';
|
|
19
|
+
import { standardFonts } from '@formepdf/fonts-standard';
|
|
20
|
+
|
|
21
|
+
for (const font of standardFonts()) Font.register(font);
|
|
22
|
+
|
|
23
|
+
// Now render with { pdfUa: true } — Helvetica/Times/Courier embed as
|
|
24
|
+
// Liberation Sans/Serif/Mono; layout is unchanged.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If `pdfUa` is set and a standard font is used but this package is **not** registered, Forme emits the document but warns by name with the remedy (install and register `@formepdf/fonts-standard`) — never silently.
|
|
28
|
+
|
|
29
|
+
## Exports
|
|
30
|
+
|
|
31
|
+
- `standardFonts(): FontSpec[]` — the 12 Liberation fonts (Sans/Serif/Mono × Regular/Bold/Italic/BoldItalic) as registrations with `Uint8Array` buffers. No file IO — works in Node, WASM, and the browser.
|
|
32
|
+
- `BASE14_ALIASES` — base-14 family → Liberation family, the same mapping the engine uses. Symbol and ZapfDingbats have no metric-compatible substitute and are omitted.
|
|
33
|
+
|
|
34
|
+
## PDF/A note
|
|
35
|
+
|
|
36
|
+
For **PDF/UA-1**, the Liberation programs are embedded with the standard fonts' AFM widths, which is fully conformant. For **PDF/A-2b**, ISO 19005's font-consistency clause requires declared widths to agree with the embedded program's advances; Liberation matches the AFM widths for the entire common glyph set, with a small enumerated set of rare accent/symbol glyphs (per proportional family) where Forme declares the program's actual advance instead. See the engine's PDF/A width carve-out.
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
|
|
40
|
+
The Liberation fonts are redistributed **unmodified** under the **SIL Open Font License, Version 1.1** — see [`OFL.txt`](./OFL.txt) and [`AUTHORS`](./AUTHORS).
|
|
41
|
+
|
|
42
|
+
> Digitized data copyright © 2010 Google Corporation with Reserved Font Arimo, Tinos and Cousine.
|
|
43
|
+
> Copyright © 2012 Red Hat, Inc. with Reserved Font Name Liberation.
|
|
44
|
+
|
|
45
|
+
The package's own code is MIT-compatible; the distributed font binaries are OFL-1.1.
|