-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01-math.sh
More file actions
30 lines (25 loc) · 986 Bytes
/
Copy path01-math.sh
File metadata and controls
30 lines (25 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# render/math/01-math.sh — mathematical & technical symbols (pdfnative 1.5.0)
#
# Registers the bundled math font alongside Latin so that operators, Greek
# letters, set relations and blackboard-bold code points render as real glyphs
# instead of .notdef tofu. pdfnative auto-routes each code point to the font
# whose cmap covers it, so just registering `--font math` is enough.
#
# Prerequisites:
# - pdfnative-cli installed globally: npm install -g pdfnative-cli
#
# Usage:
# bash samples/render/math/01-math.sh
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/../../.." && pwd)"
OUTPUT_DIR="$ROOT_DIR/samples/output/math"
mkdir -p "$OUTPUT_DIR"
echo "→ Rendering with the math font registered…"
pdfnative render \
--input "$ROOT_DIR/samples/render/math/01-math.json" \
--output "$OUTPUT_DIR/01-math.pdf" \
--font latin \
--font math
echo " ✓ Output: $OUTPUT_DIR/01-math.pdf"