diff --git a/Views/Grid.xaml.fs b/Views/Grid.xaml.fs index c2c07cd..77492d5 100644 --- a/Views/Grid.xaml.fs +++ b/Views/Grid.xaml.fs @@ -190,7 +190,7 @@ type Grid() as this = // Therefore, we have to break them into single glyphs // to prevent overflow into later cells. let hlidchange = prev_hlid <> current.hlid - if hlidchange || mywc <> wc || bold || sym <> mysym then + if hlidchange || mywc <> wc || bold || sym <> mysym || mywc = CharType.Braille then // If the span split is caused by symbols, we put [x+1] // into the current span because nr_symbols has latched one rune. let prev_span = if mysym && not sym && mywc = wc && not bold && not hlidchange diff --git a/ui.fs b/ui.fs index d8f383b..b10bc88 100644 --- a/ui.fs +++ b/ui.fs @@ -142,11 +142,19 @@ let DefaultFontEmoji = elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then "Apple Color Emoji" else "Noto Color Emoji" +let DefaultFontBraille = + if RuntimeInformation.IsOSPlatform(OSPlatform.Windows) then "Segoe UI Symbol" + elif RuntimeInformation.IsOSPlatform(OSPlatform.Linux) then "Monospace" // ? + elif RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then "Menlo" // ? + else "Monospace" + + let private nerd_typeface = let name = if RuntimeInformation.IsOSPlatform(OSPlatform.OSX) then "Iosevka NF" else "Iosevka" Typeface($"resm:fvim.Fonts.nerd.ttf?assembly=FVim#{name}") let private emoji_typeface = Typeface(DefaultFontEmoji) +let private braille_typeface = Typeface(DefaultFontBraille) let private fontcache = System.Collections.Generic.Dictionary() let InvalidateFontCache () = @@ -182,6 +190,7 @@ let GetTypeface(txt, italic, bold, font, wfont) = | CharType.Powerline | CharType.Nerd when not states.font_nonerd -> nerd_typeface | CharType.Emoji -> emoji_typeface + | CharType.Braille -> braille_typeface | _ -> _get font let MeasureText (rune: Rune, font: string, wfont: string, fontSize: float, scaling: float) =