Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Notable fixes

- **PDF export without LibreOffice keeps the pad's font (#8245).** The built-in PDF renderer, which is what runs on every install that has no `soffice` configured, only ever drew with pdfkit's Helvetica and Courier, so a `font-family` applied in the pad (`ep_font_family`, or anything else styling text) was dropped — while HTML, ODT and DOCX carried it correctly. Font families in the export HTML are now mapped onto the PDF standard fonts by category, so serif, sans-serif and monospace text stay distinct, with bold and italic variants honoured. Operators who need an exact face can register font files through the new `exportPdfFonts` setting; a missing or unreadable file degrades to a built-in font instead of failing the export, and pads with no font styling produce byte-identical output to before.

- **Plugins — `settings.ep_<plugin>` config blocks are reachable again from `require()` (#8109, #8110).** Plugins read their own configuration out of a top-level `ep_*` block in `settings.json` via `require('ep_etherpad-lite/node/utils/Settings')`. The CJS-compatibility shim in `Settings.ts` installed accessor properties on `module.exports` for the keys present on the settings object *while that module was still evaluating* — but `ep_*` blocks are only merged in later, by the `reloadSettings()` call at the bottom of the same module. Every plugin config block was therefore invisible to the `require()` path (the value was reachable only under `.default`), so plugins silently fell back to their built-in defaults. For `ep_hash_auth` that meant `hash_dir` reverted to `/var/etherpad/users`, every hash lookup failed, and admin login returned 401 with no usable diagnostic — the symptom that surfaced this. The shim is now re-run after each settings load. Reported by @mathewcsims and @tris-ots; an equivalent fix was also proposed by @AkprasadoP in #8113.

# 3.3.5
Expand Down
37 changes: 37 additions & 0 deletions doc/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,43 @@ Supported export types:
to point at a LibreOffice executable. See the office-format notes in the
[Docker chapter](./docker.md).

### Fonts in native PDF export

Without LibreOffice, PDF export is rendered in-process and only the PDF
standard fonts are guaranteed to be present. A `font-family` applied in the
pad (for example by `ep_font_family`) is mapped onto the closest built-in
family — Helvetica for sans-serif faces, Times for serif faces, Courier for
monospace ones — so serif, sans and monospace text stay visually distinct
even though the exact face is not embedded. Families that are not recognised
inherit the surrounding font instead of changing it.

To embed a real face, list the font files under `exportPdfFonts` in
`settings.json`:

```json
"exportPdfFonts": {
"Garamond": {
"regular": "/usr/share/fonts/truetype/EBGaramond-Regular.ttf",
"bold": "/usr/share/fonts/truetype/EBGaramond-Bold.ttf",
"italic": "/usr/share/fonts/truetype/EBGaramond-Italic.ttf",
"boldItalic": "/usr/share/fonts/truetype/EBGaramond-BoldItalic.ttf",
"fallback": "times"
},
"Inter": "/usr/share/fonts/truetype/Inter-Regular.ttf"
}
```

Keys are CSS family names; matching ignores case and treats `-`, `_` and
spaces alike, so `Times New Roman` and `times-new-roman` are the same key. A
bare string value is used for every variant. Relative paths resolve against
the Etherpad root, and `fallback` chooses the built-in family (`helvetica`,
`times` or `courier`) to use if a file is missing or unreadable — a bad font
path degrades the export, it never fails it. Etherpad ships no fonts for this
setting; point it at fonts you are licensed to embed.

Configuring `soffice` bypasses all of this: LibreOffice renders PDFs with the
fonts installed on the server.

## How do I list all pads?

The recommended way is the HTTP API method `listAllPads`, combined with `jq`:
Expand Down
32 changes: 32 additions & 0 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,38 @@
*/
"docxExport": true,

/*
* Extra fonts the built-in PDF exporter may embed.
*
* When LibreOffice ("soffice") is not configured, PDF export is rendered
* in-process. That renderer only has the PDF standard fonts available, so
* it maps every CSS font-family onto Helvetica (sans-serif), Times (serif)
* or Courier (monospace). Use this setting to give it real font files for
* families that need their exact face.
*
* Keys are CSS font-family names as they appear in the pad (matching is
* case-insensitive and treats "-", "_" and spaces alike, so "Times New
* Roman" and "times-new-roman" are the same key). Values are either a path
* to a single TTF/OTF, or an object with per-variant paths. Relative paths
* resolve against the Etherpad root. "fallback" picks the built-in family
* ("helvetica", "times" or "courier") used if a file is missing.
*
* Etherpad ships no fonts for this; point it at fonts you are licensed to
* embed.
*
* "exportPdfFonts": {
* "Garamond": {
* "regular": "/usr/share/fonts/truetype/EBGaramond-Regular.ttf",
* "bold": "/usr/share/fonts/truetype/EBGaramond-Bold.ttf",
* "italic": "/usr/share/fonts/truetype/EBGaramond-Italic.ttf",
* "boldItalic": "/usr/share/fonts/truetype/EBGaramond-BoldItalic.ttf",
* "fallback": "times"
* },
* "Inter": "/usr/share/fonts/truetype/Inter-Regular.ttf"
* }
*/
"exportPdfFonts": {},

/*
* txt, doc, docx, rtf, odt, html & htm
*/
Expand Down
Loading
Loading