Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.
Swift apple-siliconcustom-formathomebrewiosipaipadipadosiphonemetalnative-portnintendo-switchnxnativeromfsswitch-games
#!/usr/bin/env python3
# Embed the interface font (Manrope; SIL OFL 1.1, its license beside it) into the app's binary:
# Sources/NXLauncher/EmbeddedFonts.swift holds each as base64, which Typography.swift loads at launch. Embedding,
# not a SwiftPM resource bundle, because the app is packed by copying the one executable into NS Port Builder.app.
# Usage: python3 frontend/fonts/embed_fonts.py
import base64
from pathlib import Path
HERE = Path(__file__).resolve().parent
OUT = HERE.parent / 'Sources/NXLauncher/EmbeddedFonts.swift'
FONTS = (('manrope', 'Manrope.ttf'),)
lines = ['// Generated by frontend/fonts/embed_fonts.py from frontend/fonts/*.ttf (SIL OFL 1.1, see the licenses there). Do not edit.',
'package enum EmbeddedFonts {']
for name, file in FONTS:
lines.append(f' package static let {name} = "{base64.b64encode((HERE / file).read_bytes()).decode()}"')
lines.append('}')
OUT.write_text('\n'.join(lines) + '\n', encoding='ascii')
print(OUT)