[vim/vim] Color Emoji (DirectX support improvements) (#2375)

140 views
Skip to first unread message

MURAOKA Taro

unread,
Nov 26, 2017, 5:11:43 AM11/26/17
to vim/vim, Subscribed

This patch introduces two big features and one small fix to Vim's
DirectX rendering.

  1. Support colored emoji (emoticon).
  2. Improve drawing speed extremely.
  3. 'taamode' option didn't work.

Emoji was started from Japan and now widely used in the World as you
know. It has became very important parts for the communication. Recent
Windows supports colored emoji with DirectX, but Vim couldn't use it.
This patch implements colored emoji for Vim.

Vim's DirectX support was not enough about drawing speed. It was caused
by wrong use of DirectX. Now Vim's DirectX rendering is equal or faster
than GDI.

The 'taamode' option didn't work entirely because of incorrect use of
DirectX. This patch fixes it.

And last, this patch is written by collaborating mattn, k-takata and me.
Please enjoy colored 🍣 emoji with this patch. 😄😄😄

capture


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/2375

Commit Summary

  • emoji test scirpt
  • Colored Emoji!
  • use Segoe_UI_Mono for sample
  • refine codes
  • backward compatibility
  • doc for renderoptions
  • bulk drawing
  • new `type:directx3` for high speed rendring
  • test code for `type:directx3`
  • manage drawing state in methods
  • more smart drawing state
  • impl. FillRect for DirectX
  • FillRect for DirectX
  • Flush before ScrollWindowEx
  • fix for hidpi (maybe)
  • refactoring codes
  • disable regexp logs temporarily
  • can't see any glyphs
  • new "type:directx4" with adjusted glpyrun
  • no underlines, strikeout, undercurls
  • Fix font size on HiDPI
  • forget "break"
  • Fix cursor behavior, etc.
  • extend "directx4" to display color emoji
  • Merge branch 'color-emoji' of github.com:koron/vim into color-emoji
  • small refactoring
  • unused member: renderingParams
  • update credit
  • refactoring TextRenderer
  • remove unused code!!!
  • remove more unused codes
  • fix copyright with the first year
  • apply rendering params to RT
  • compilable by VC10 and newer SDK
  • add fallback for some environment that deoesn't work IDWriteFactory2
  • fallback to IDWriteFactory instead of IDWriteFactory1
  • ignore error of creating IDWriteFactory2
  • Remove needless flush
  • Work around for bitmap fonts
  • ttamode:3 should be an error when the font is anti-aliased
  • fixed bug
  • optimize FillRect call
  • more refactor FillRect and Flush
  • refactor DrawGlyphRun
  • forget to flush before scroll
  • diff adjustment
  • fix log
  • diff arrangement ph.2
  • Fix cursor drawing
  • prototype
  • font fallback 1st ver.
  • remove unused codes
  • use get_logfont to determine fallback font
  • remove halfway font cache
  • Merge pull request #15 from koron/fallback-font
  • revert "fallback to GDI" feature in dwrite
  • experimental font (text format) cache
  • remove codes for development only
  • revert unnecessary change
  • revert taamode checker
  • document
  • fix doc
  • fix doc rev.2
  • fix typo
  • Fix AppVeyor build (hopefully)
  • fix comments
  • Use C++ style casts
  • Remove unneeded :cSHIFTJIS
  • Fix indentation
  • Use C++ style function declaration
  • Fix typo
  • Fix typo
  • Fold a long line
  • Delete needless code

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Codecov

unread,
Nov 26, 2017, 5:32:07 AM11/26/17
to vim/vim, Subscribed

Codecov Report

Merging #2375 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2375      +/-   ##
==========================================
+ Coverage   74.52%   74.54%   +0.01%     
==========================================
  Files          91       91              
  Lines      132413   132412       -1     
  Branches    29082    29083       +1     
==========================================
+ Hits        98682    98701      +19     
- Misses      33706    33707       +1     
+ Partials       25        4      -21
Impacted Files Coverage Δ
src/if_xcmdsrv.c 84.53% <0%> (-0.18%) ⬇️
src/if_py_both.h 76.45% <0%> (-0.15%) ⬇️
src/gui.c 47.4% <0%> (-0.11%) ⬇️
src/channel.c 82.48% <0%> (-0.05%) ⬇️
src/gui_gtk_x11.c 47.65% <0%> (ø) ⬆️
src/window.c 81.78% <0%> (+0.03%) ⬆️
src/libvterm/src/screen.c 73.3% <0%> (+0.51%) ⬆️
src/gui_beval.c 63.09% <0%> (+0.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb1db0e...b98eab5. Read the comment docs.

Bram Moolenaar

unread,
Nov 26, 2017, 8:30:15 AM11/26/17
to vim/vim, Subscribed

Closed #2375 via d7ccc4d.

Christian Brabandt

unread,
Nov 26, 2017, 9:48:03 AM11/26/17
to vim/vim, Subscribed

From your example it looks like some emojis are cut-off? Does the change in directx rendering fix #1520 perhaps?

mattn

unread,
Nov 26, 2017, 10:00:54 AM11/26/17
to vim/vim, Subscribed

As we wrote in :help renderoptions, if alternative font doesn't have fixed with glyph for the emoji, it will be cut-off.

		  - When this alternative font didn't have fixed width glyph,
		    emoji might be rendered beyond the bounding box of drawing
		    cell.

axbender

unread,
Dec 8, 2017, 3:18:59 PM12/8/17
to vim/vim, Subscribed

Where would I get the current test font (Segoe UI Mono)?

Reply all
Reply to author
Forward
0 new messages