Codex Vazirmatn Font
Codex Vazirmatn Font is a VS Code extension that improves Persian readability inside the OpenAI Codex experience on Windows and restores a practical RTL layout across the Codex UI.
We originally built this extension for our own workflow and internal projects. After using it ourselves, we decided to publish it publicly so other Persian-speaking users can get a cleaner, more comfortable reading experience without dealing with manual patching.
Its goal is simple: make Persian text and the surrounding Codex UI feel more natural, more readable, and more stable across extension updates.
Why this exists
Persian text can feel less readable in some Codex and webview scenarios on Windows, especially when the default UI font is not a good fit for Persian content. This extension helps by applying a Persian-friendly font setup automatically, while still keeping code blocks and terminal-like areas on their normal monospace fonts.
Features
- Automatically copies a bundled
Vazir.woff font into the Codex webview assets folder.
- Patches
webview/index.html with an inline RTL + Persian font fallback so the patch survives more Codex layout changes.
- Patches
webview/assets/codex-rtl.css when that file exists, but no longer depends on it for the core RTL behavior.
- Adds a lightweight bootstrap script that keeps
lang="fa", dir="rtl", and data-codex-rtl="true" in place when the webview updates itself.
- Keeps code blocks, syntax highlighting, and terminal-like areas on their normal LTR monospace behavior.
- Creates backup files before making changes so the original Codex files can be restored.
- Includes VS Code settings for enabling the patch, startup behavior, reload prompts, and preferred font family.
- Includes a built-in compatibility check before patching and a manual compatibility command.
- Re-applies the patch when Codex is installed or updated in the same VS Code session.
- Prompts for
Reload Window only when a change actually requires it.
- Includes clearer output logs and error messages to make troubleshooting easier.
- Includes a standalone
patch-cli.js script for direct patching with Node.js.
- Ships with conservative fallback behavior so future Codex versions are less likely to break the patch completely.
Persian Note / توضیح فارسی
این افزونه را اول برای استفاده روزمره خودمان ساختیم تا تجربه فارسی داخل Codex فقط خواناتر نشود، بلکه خود رابط هم تا جای ممکن راستچین، طبیعی و راحتتر شود.
بعد از استفاده عملی دیدیم این تغییر واقعاً تجربه فارسینویسی و فارسیخوانی را بهتر میکند؛ برای همین آن را عمومی کردیم تا بقیه هم بدون patch دستی، تجربه بهتری داخل Codex داشته باشند.
هدف این افزونه ساده است: متن و رابط فارسی در Codex خوشخوان، راستچین و قابلاستفاده بماند، در حالی که code blockها، syntax highlight و بخشهای فنی همچنان رفتار استاندارد خودشان را حفظ کنند.
Commands
Codex Vazirmatn Font: Apply Persian RTL Patch
Codex Vazirmatn Font: Check Codex Compatibility
Codex Vazirmatn Font: Restore Original Codex Files
Settings
codexVazirmatnFont.enabled
codexVazirmatnFont.patchOnStartup
codexVazirmatnFont.showReloadPrompt
codexVazirmatnFont.preferredFontFamily
How to use
- Install the extension in VS Code.
- Make sure the OpenAI ChatGPT/Codex extension is installed.
- Let the patch run automatically on startup, or run
Codex Vazirmatn Font: Apply Persian RTL Patch manually.
- Reload the VS Code window when prompted.
Direct CLI usage
From the extension folder, run:
node patch-cli.js
Optional override for custom VS Code extension folders:
node patch-cli.js --extensions-dir "C:\\path\\to\\extensions"
You can also use the VSCODE_EXTENSIONS environment variable.
Notes and limitations
- The OpenAI ChatGPT/Codex extension must be installed. This extension declares it as a dependency.
- This extension modifies files inside the installed Codex extension directory.
- The patch is now more version-tolerant because it can work through
index.html even if codex-rtl.css is missing or renamed, but no internal patch can guarantee perfect compatibility with every future Codex release.
- The patch runs automatically on
onStartupFinished.
- If the OpenAI Codex extension updates itself later, this extension can re-apply the patch on the next startup.
- Reloading the VS Code window is required after a fresh patch or restore.
- If you uninstall this extension, it attempts to restore the original Codex files from the generated backups.
Third-party asset
- The bundled
assets/Vazir.woff font remains under its upstream font license. See THIRD_PARTY_NOTICES.md and OFL.txt.