# mingo-ime-spacing-patch Fix IME (Korean input) spacing and rendering inconsistencies in the Mingo Electron app. This repository provides a persistent patch for Mingo's overlay-based editor to resolve: - Caret misalignment caused by incorrect monospace fallback - Spacing inconsistencies during IME composition - Unintended font fallback to GulimChe - Visual flicker caused by syntax highlight updates during Korean input --- ## ๐Ÿง  Background Mingo uses an overlay editor structure: - `textarea.editor` โ†’ actual input layer (transparent text) - `div.displayer` โ†’ syntax-highlighted rendered layer This design enables syntax highlighting (keywords, collection names, MongoDB methods), but it introduces issues when: 1. The expected monospace font (e.g., Roboto Mono) is not installed. 2. Windows falls back to `GulimChe`. 3. IME composition events cause highlight re-rendering. 4. Overlay rendering and text metrics diverge. The result is: - Character spacing distortion - Caret misalignment - Highlight flicker during Korean input This patch corrects the font configuration to ensure consistent rendering. --- ## โœ… What This Patch Does - Replaces `--font-family-mono` with: ``` "D2Coding", Consolas, monospace ``` - Replaces the default UI font with: ``` "Asta Sans", "Microsoft GothicNeo", "Segoe UI", "Malgun Gothic", sans-serif ```` - Preserves Mingoโ€™s original overlay structure - Keeps syntax highlighting intact - Avoids contenteditable refactor - Minimizes IME rendering artifacts --- ## โš™๏ธ Requirements - Windows - Node.js - `asar` CLI tool Install asar globally if needed: ```bash npm install -g asar ```` --- ## ๐Ÿš€ Usage Run the provided PowerShell script: ```powershell .\patch-mingo-fonts.ps1 ``` The script will: 1. Backup `app.asar` 2. Extract contents 3. Locate the largest `index-*.css` 4. Replace: * `--font-family-mono` * `body { font-family }` 5. Repack `app.asar` --- ## ๐Ÿ”„ Restore Original Version If something breaks: ```powershell Copy-Item "app.asar.bak-" "app.asar" -Force ``` * ๋” ๊ธฐ์ˆ ์ ์œผ๋กœ ๊นŠ๊ฒŒ (DOM ๊ตฌ์กฐ ๋‹ค์ด์–ด๊ทธ๋žจ ํฌํ•จ) * ํ•œ๊ธ€/์˜๋ฌธ ๋ณ‘๊ธฐ ๋ฒ„์ „ * ๋‚ด๋ถ€ ๋™์ž‘ ๋ถ„์„ ์„น์…˜ ์ถ”๊ฐ€ * ์ž๋™ ์žฌํŒจ์น˜ ์„ค๊ณ„ ํฌํ•จ ๊ฐ™์€ ๋ฐฉํ–ฅ์œผ๋กœ ํ™•์žฅํ•ด์ค„๊นŒ?