Skip to content

Commit d7edd32

Browse files
author
Yatao Li
committed
braille code plane support
1 parent 2dc1579 commit d7edd32

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Views/Grid.xaml.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ type Grid() as this =
190190
// Therefore, we have to break them into single glyphs
191191
// to prevent overflow into later cells.
192192
let hlidchange = prev_hlid <> current.hlid
193-
if hlidchange || mywc <> wc || bold || sym <> mysym then
193+
if hlidchange || mywc <> wc || bold || sym <> mysym || mywc = CharType.Braille then
194194
// If the span split is caused by symbols, we put [x+1]
195195
// into the current span because nr_symbols has latched one rune.
196196
let prev_span = if mysym && not sym && mywc = wc && not bold && not hlidchange

ui.fs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,19 @@ let DefaultFontEmoji =
142142
elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then "Apple Color Emoji"
143143
else "Noto Color Emoji"
144144

145+
let DefaultFontBraille =
146+
if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then "Segoe UI Symbol"
147+
elif RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then "Monospace" // ?
148+
elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then "Menlo" // ?
149+
else "Monospace"
150+
151+
145152
let private nerd_typeface =
146153
let name = if RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then "Iosevka NF"
147154
else "Iosevka"
148155
Typeface($"resm:fvim.Fonts.nerd.ttf?assembly=FVim#{name}")
149156
let private emoji_typeface = Typeface(DefaultFontEmoji)
157+
let private braille_typeface = Typeface(DefaultFontBraille)
150158
let private fontcache = System.Collections.Generic.Dictionary<string*bool*bool, Typeface>()
151159

152160
let InvalidateFontCache () =
@@ -182,6 +190,7 @@ let GetTypeface(txt, italic, bold, font, wfont) =
182190
| CharType.Powerline
183191
| CharType.Nerd when not states.font_nonerd -> nerd_typeface
184192
| CharType.Emoji -> emoji_typeface
193+
| CharType.Braille -> braille_typeface
185194
| _ -> _get font
186195

187196
let MeasureText (rune: Rune, font: string, wfont: string, fontSize: float, scaling: float) =

0 commit comments

Comments
 (0)