Assets: images, fonts, raw files

The server keeps every raw file exactly as uploaded (camera raw, TIFF, PSD, HEIC, huge JPEGs, SVG, PDF, fonts), addressed by sha256. They are never altered; you can always download the original (list_assets gives each one's raw link).

Upload with upload_asset:

assets.edn is the map from ids to raws: {:img/cover {:blob "<sha>" :file "cover.tif" :it {:blob ...}}}.

Delivery renditions (doc.edn :editions)

What goes into a PDF is made from the raw by the edition's rule, and cached:

:editions {:print {:images {:mode :original :max-edge 20000}}      ; raw pixels (converted only if the PDF cannot hold them)
           :email {:images {:mode :fit :scale 1.5 :quality 82}}}    ; each photo sized to its frame x 1.5

:original passes JPEG/PNG/WebP/GIF/SVG/PDF through untouched when they fit max-edge (default 6000); other formats (TIFF, PSD, HEIC, raw) are converted to sRGB JPEG (PNG when there is transparency). :fit covers the frame at :scale x the page's pixels, never upscaling; PNG and GIF graphics are kept as they are. An edition may also set :file {:en "Name.pdf"}.

Fonts

fonts.edn:

{:sans  {:upright :font/jost :italic :font/jost-italic :axes {}}               ; a variable font (wght)
 :serif {:upright :font/bodoni :italic :font/bodoni-italic
         :axes {"opsz" :size} :axis-range {"opsz" [6 96]}}                     ; optical size follows the text size
 :mono  {:upright {400 :font/mono-regular 700 :font/mono-bold}}               ; static fonts by weight
 :cjk   {:upright {:font :font/noto-cjk :face 2}}                              ; one face of a collection (TTC)
 :aliases {"Jost w400" {:family :sans :weight 400}}}                           ; names SVG files use

add_font {family: "display", url: ...} adds a font in one version (the asset and its fonts.edn entry; style italic, weight for static files, face for collections; replace to change a slot). font_info {asset: "font/display"} says what is inside a font: faces, weights, axes, named instances, which scripts it covers, its license, and a fonts.edn line for it.

Font files are assets like any other, in any format: TTF, OTF (CFF too), collections (TTC/OTC: pick :face, 0 by default) and web fonts (WOFF, WOFF2). A file that is not a usable font, or a face a collection does not have, is an error that says so. Each weight/size is pinned to its own instance, so what you see in render_page is exactly what the PDF embeds.