codeapp icon indicating copy to clipboard operation
codeapp copied to clipboard

Support for Nerd Fonts

Open thekeith opened this issue 2 years ago • 6 comments

I’m proposing adding some Nerd Fonts to the mix like Fira Code Nerd Font, Jetbrains Mono Nerd Font and Sauce Code Pro Nerd Font.

  • I connect to a terminal with tmux and Starship. The Starship prompt does not render correctly as it uses a Nerd Font.
  • Currently in iPadOS 17 custom fonts do not work via apps like Anyfont, and they’re a suboptimal experience anyway as they require adding an unsigned custom profile
  • Having a few nerd fonts built in will be better for more advanced users and broaden the overall appeal of the product

Questions:

  1. How are fonts currently loaded in the app today?
  2. Is there any plan to add a Nerd Font already?
  3. Are there any considerations/complications to adding a new font specifically to this app?

thekeith avatar Aug 22 '23 14:08 thekeith

  1. Fonts currently only work in the text editor. Custom fonts are loaded by adding entries to the Copy Bundle Resources step in the Xcode project. Then they can be manually referenced in the CSS for the editor and Monaco Editor's api can be called to load the font. image

https://github.com/thebaselab/codeapp/blob/9d95220f775f79bd71c0e856cd5868f7535b32d2/Dependencies/monaco-textmate.bundle/index.html#L12-L16 https://github.com/thebaselab/codeapp/blob/9d95220f775f79bd71c0e856cd5868f7535b32d2/CodeApp/Managers/MonacoEditor.swift#L92-L93 2. Not at the moment 3. The licenses must be compatible to ours.

bummoblizard avatar Aug 23 '23 02:08 bummoblizard

I think it would great if we can find a way to dynamically load fonts in the editor / terminal without bundling it in Xcode. That way we can allow custom fonts to be installed dynamically by users. (without worrying about licenses)

bummoblizard avatar Aug 23 '23 03:08 bummoblizard

https://developer.mozilla.org/en-US/docs/Web/API/FontFace/FontFace

bummoblizard avatar Aug 23 '23 03:08 bummoblizard

@bummoblizard we could use something similar to blink shell, which uses a CSS font stylesheet. I’ll also try building with a nerd font loaded in via XCode.

thekeith avatar Aug 23 '23 03:08 thekeith

@bummoblizard also, thanks for being really responsive and making a great product. I’ve gone through a lot of them on iPad Pro and am glad to have found this app.

thekeith avatar Aug 23 '23 03:08 thekeith

There also some other apps that can load font globally, like Fontinator

pickaxe828 avatar Nov 07 '23 00:11 pickaxe828

There also some other apps that can load font globally, like Fontinator

That's right. Use a font installer app to install additional fonts and it should show up in Code's settings menu. Reference: https://github.com/thebaselab/codeapp/issues/1004. For custom font in terminal, I opened this: https://github.com/thebaselab/codeapp/issues/1037.

bummoblizard avatar Mar 15 '24 04:03 bummoblizard