Saudi Riyal Symbol in Frappe / ERPNext

Author
Jul 28, 2026
Saudi Riyal Symbol in Frappe / ERPNext

The official Saudi Riyal Sign is U+20C1, assigned in Unicode 17.0. This guide covers a fresh Frappe/ERPNext server with a single site.

The work splits cleanly in two: the server administrator installs the font and sets the currency symbol, then print format designers use it in templates.


Part A — For the server administrator

Set your site name once:

SITE=your-site-name
cd /path/to/frappe-bench

1. Install the font

The Saudi Central Bank publishes the symbol as SVG/EPS/PNG artwork, not as a font. Use the community font, licensed SIL OFL 1.1. Install the regular weight:

sudo mkdir -p /usr/share/fonts/truetype/saudi-riyal
cd /usr/share/fonts/truetype/saudi-riyal
sudo curl -sLO https://raw.githubusercontent.com/emran-alhaddad/Saudi-Riyal-Font/main/fonts/regular/saudi_riyal.ttf
sudo fc-cache -f

Confirm fontconfig can serve the codepoint:

fc-list ':charset=20c1' family file

saudi_riyal should appear in the output.

The font is now available system-wide as a fallback. Leave your CSS and print formats alone at this stage — fontconfig will supply this font for U+20C1 only, and take every other character from your normal fonts.

2. Set the currency symbol

E2 83 81 is UTF-8 for U+20C1, so this writes the exact bytes with nothing to mistype:

cd /path/to/frappe-bench

bench --site "$SITE" mariadb -e \
  "UPDATE tabCurrency SET symbol=CHAR(0xE28381 USING utf8mb4) WHERE name='SAR';"

bench --site "$SITE" clear-cache

clear-cache is required — get_currency_symbol() is cached and direct SQL bypasses the ORM.

Alternatively, do it through the UI: copy this character — — then go to Awesome bar → Currency → SAR → Symbol, paste and Save. The field will look almost blank afterwards because the glyph is thin and narrow; that is normal.

3. Verify

Check the stored value by its bytes rather than by eye:

bench --site "$SITE" mariadb -e \
  "SELECT HEX(symbol) FROM tabCurrency WHERE name='SAR';"

E28381 confirms U+20C1 is stored correctly.

Then confirm a real PDF embeds the glyph:

sudo apt install -y poppler-utils
bench --site "$SITE" console
pdf = frappe.get_print("Quotation", "<your-quotation-name>", as_pdf=True)
open('/tmp/t.pdf','wb').write(pdf)
pdffonts /tmp/t.pdf

saudi_riyalregular in that list means the symbol rendered — wkhtmltopdf only embeds fonts it actually used during layout.

This works on both the wkhtmltopdf and Chrome PDF generators with no further configuration.

Part B — For print format designers

Standard formats need no changes

Anything that formats currency through Frappe’s own helpers picks up the new symbol automatically once Part A is done:

{{ doc.get_formatted("grand_total") }}
{{ frappe.utils.fmt_money(row.rate, currency=doc.currency) }}

Prefer these over hardcoding a symbol, so the format stays correct for customers in other currencies.


Browser print preview

Part A fixes generated PDFs. The browser print preview renders using fonts on the viewer’s own machine, so it is unaffected.

macOS 15.4+ and Windows 11 25H2 include the glyph. On older machines the preview shows a blank box while the downloaded PDF is perfectly correct — that needs no fixing.

To make the preview work everywhere, copy saudi_riyal.woff2 from the font repo into your app’s public folder and add this to Print Settings → Custom CSS:

@font-face {
  font-family: 'saudi_riyal';
  src: url('/assets/your_app/fonts/saudi_riyal.woff2') format('woff2');
  unicode-range: U+20C1;
}
body, .print-format {
  font-family: 'saudi_riyal', 'Noto Sans Arabic', sans-serif;
}

Keep the unicode-range: U+20C1; line exactly as written. This font contains only the riyal glyph, and the range confines it to that one character so every letter and digit continues to come from your normal fonts.

Vertical alignment

The symbol sits slightly high against digits at large sizes. If it looks off in your layout, nudge it down in Custom CSS:

.print-format { --riyal-shift: -0.08em; }

then apply vertical-align: var(--riyal-shift) to the element wrapping the amount. At normal document sizes this is usually unnecessary — check the preview first.

Summary

Administrator: install saudi_riyal.ttf, run fc-cache -f, set the SAR symbol to U+20C1, run clear-cache, confirm HEX(symbol) returns E28381.

Designers: nothing required. Add the @font-face block with unicode-range: U+20C1 only if the browser preview needs to work on older client machines.

Author
Written by ERPGulf Team