Skip to content

Commit

Permalink
fix #116
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Feb 5, 2020
1 parent e9ba293 commit b6a3318
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ FVimDrawFPS v:true
" Font tweaks
FVimFontAntialias v:true
FVimFontAutohint v:true
FVimFontSubpixel v:true
FVimFontLcdRender v:true
FVimFontHintLevel 'full'
FVimFontLcdRender v:true
FVimFontLigature v:true
FVimFontLineHeight '+1.0' " can be 'default', '14.0', '-1.0' etc.
FVimFontSubpixel v:true
" Try to snap the fonts to the pixels, reduces blur
" in some situations (e.g. 100% DPI).
Expand Down
2 changes: 1 addition & 1 deletion Views/Editor.xaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ type Editor() as this =

let txt = String.Concat str
let shaping =
if txt.Length > 1 && txt.Length < 5 && issym then
if txt.Length > 1 && txt.Length < 5 && issym && States.font_ligature then
ValueSome shaper
else ValueNone

Expand Down
2 changes: 2 additions & 0 deletions model.fs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ let Start opts =
States.Register.Bool "font.autohint"
States.Register.Bool "font.subpixel"
States.Register.Bool "font.lcdrender"
States.Register.Bool "font.ligature"
States.Register.Prop<SKPaintHinting> States.parseHintLevel "font.hintLevel"
States.Register.Prop<SKFontStyleWeight> States.parseFontWeight "font.weight.normal"
States.Register.Prop<SKFontStyleWeight> States.parseFontWeight "font.weight.bold"
Expand Down Expand Up @@ -616,6 +617,7 @@ let Start opts =
let! _ = Async.AwaitTask(nvim.``command!`` "-complete=expression FVimFontLineHeight" 1 (sprintf "call rpcnotify(%d, 'font.lineheight', <args>)" myChannel))
let! _ = Async.AwaitTask(nvim.``command!`` "-complete=expression FVimFontAutoSnap" 1 (sprintf "call rpcnotify(%d, 'font.autosnap', <args>)" myChannel))
let! _ = Async.AwaitTask(nvim.``command!`` "-complete=expression FVimFontAntialias" 1 (sprintf "call rpcnotify(%d, 'font.antialias', <args>)" myChannel))
let! _ = Async.AwaitTask(nvim.``command!`` "-complete=expression FVimFontLigature" 1 (sprintf "call rpcnotify(%d, 'font.ligature', <args>)" myChannel))
let! _ = Async.AwaitTask(nvim.``command!`` "-complete=expression FVimFontDrawBounds" 1 (sprintf "call rpcnotify(%d, 'font.drawBounds', <args>)" myChannel))
let! _ = Async.AwaitTask(nvim.``command!`` "-complete=expression FVimFontAutohint" 1 (sprintf "call rpcnotify(%d, 'font.autohint', <args>)" myChannel))
let! _ = Async.AwaitTask(nvim.``command!`` "-complete=expression FVimFontSubpixel" 1 (sprintf "call rpcnotify(%d, 'font.subpixel', <args>)" myChannel))
Expand Down
1 change: 1 addition & 0 deletions states.fs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ let mutable font_autohint = false
let mutable font_subpixel = true
let mutable font_lcdrender = true
let mutable font_autosnap = true
let mutable font_ligature = true
let mutable font_hintLevel = SKPaintHinting.NoHinting
let mutable font_weight_normal = SKFontStyleWeight.Normal
let mutable font_weight_bold = SKFontStyleWeight.Bold
Expand Down

0 comments on commit b6a3318

Please sign in to comment.