museoa / bqn-mode

Emacs mode for BQN programming language
GNU General Public License v3.0
34 stars 20 forks source link

required font? #15

Closed dankeyy closed 1 year ago

dankeyy commented 1 year ago

Hey guys, looks cool but some symbols don't seem to be recognized on my machine:

image Those are my current fonts:

(font-spec :family "Fira Code"   :size 16) ;;regular
(font-spec :family "Victor Mono" :size 12) ;; unicode

Should I use some other font?

dankeyy commented 1 year ago

Oh I see now bqn has ttf-bqn386 that i think is shipped in git-cbqn on aur. Would still like to hear what's your font config I probably wouldn't want that font globally. Maybe hook a set font to bqn-mode? not sure

AndersonTorres commented 1 year ago

Well, I am a complete negation around this issue of fonts, and even in my NixOS home system, I almost do not touch the issue of fonts.

However I believe this fontset from Dzaima is very clean:

https://github.com/dzaima/BQN386

There are other fonts recommended by APL Wiki too:

https://aplwiki.com/wiki/Fonts

There is even a citation of a Victor Mono:

https://github.com/Tortus-exe/FiraCode

(Also, can you copy-paste the code you tried in this printscreen?)

dankeyy commented 1 year ago

Well, I am a complete negation around this issue of fonts, and even in my NixOS home system, I almost do not touch the issue of fonts.

However I believe this fontset from Dzaima is very clean:

https://github.com/dzaima/BQN386

There are other fonts recommended by APL Wiki too:

https://aplwiki.com/wiki/Fonts

There is even a citation of a Victor Mono:

https://github.com/Tortus-exe/FiraCode

(Also, can you copy-paste the code you tried in this printscreen?)

Hey thanks, Dzaima's font worked beautifully. This is the code you asked for:

#! /usr/bin/env bqn

# Case conversion utilities
case ← {
  diff ← -´ "Aa"
  Lower ⇐ -⟜diff
  Upper ⇐ Lower⁼
}

hw ← <˘ 2‿∘ ⥊ "helloworld"
hw case.Upper⌾(⊑¨)↩
•Out hw ↩ ∾ ⥊⍉ [hw, ", "‿"!"]  # Hello, World!

# Split at spaces and repeated characters
Split ← {
  !1==𝕩 ⋄ (!2=•Type)¨𝕩
  Proc ← {
    · 𝕊 ' ': spl⇐1 ;             # Space: break and delete it
    prev Fn cur: ⟨spl,str⟩⇐
      spl←0 ⋄ str←⟨cur⟩          # Include and don't break...
      { prev=cur ? spl+↩1 ; @ }  # except at equal characters
  }
  GV‿GS ← {𝕏¨}¨ ⟨ {⟨s⇐str⟩:s;""}
                  {𝕩.spl} ⟩
  r ← Proc{»𝔽¨⊢} 𝕩
  (∾¨ GV ⊔˜ ·+`GS) r
}
•Show Split hw  # ⟨ "Hel" "lo," "World!" ⟩

Also if i may ask an unrelated question, the keys you binded are all using the super key. Which on my machine are already configured for some wm actions. Is there a way to make this work like in vs code? Where you press backslash and the next thing you type would be completed to the character? In any case thanks for the package it's great

AndersonTorres commented 1 year ago

Also if i may ask an unrelated question, the keys you binded are all using the super key. Which on my machine are already configured for some wm actions.

This is mostly "legacy" from the older repo, because other programs use Super as special key.

Is there a way to make this work like in vs code?

As far as I remember, Emacs allows reconfigure the keys. Nonetheless I will include this in a backlog.

Where you press backslash and the next thing you type would be completed to the character?

There is exactly bqn-key-prefix.el that defines an optional input method. You can M-x set-input-method BQN-Z.