New text drawing model, better unicode support, 'gfw' support, etc.
commitd27361935423da529585b0499ba2198c1ae325fc
authorBjorn Winckler <bjorn.winckler@gmail.com>
Sun, 11 Nov 2007 14:09:22 +0000 (11 15:09 +0100)
committerBjorn Winckler <bjorn.winckler@gmail.com>
Sun, 11 Nov 2007 14:09:22 +0000 (11 15:09 +0100)
tree7ab97f6ec3cd5124454c95b2fbada026aa509424
parentd456b900af553d7cb4c348f58c247accc132d5c1
New text drawing model, better unicode support, 'gfw' support, etc.

Characters and columns are no longer assumed to be in one-to-one
correspondence.  Thus when modifying the text storage a (row,column) pair must
be searched for.  This is managed using
    [NSString rangeOfComposedCharacterSequenceAtIndex:]
and by marking wide characters with an attribute (called "MMWideChar").  We
also provide an optimized code path for when characters and columns are in
one-to-one correspondence (no wide chars, only chars that can be represented by
one utf16 character).

A new typesetter is also used.  Instead of overriding
layoutGlyphsInLayoutManager:::: we override willSetLineFragmentRect::::.  This
typesetter can handle composing characters, whereas the old typesetter couldn't
(it can still be used by setting the user default "MMTypesetter" to
"MMTypesetter2".)

Note that text rendering still has flaws, the Cocoa Text System and Vim has
different opinions on how much space certain characters take up and this
results in display bugs.  (E.g. nonspacing marks such as U+064C are
problematic.)  Also, sometimes the layout manager hides glyphs but Vim assumes
that each character is displayed (resulting in yet more display bugs).

Added support for 'guifontwide'.  This can be set to anything (different font
size); it is quite possible to set it so that the display becomes completely
messed up.
18 files changed:
src/MacVim/MMAppController.m
src/MacVim/MMApplication.m
src/MacVim/MMBackend.h
src/MacVim/MMBackend.m
src/MacVim/MMFullscreenWindow.m
src/MacVim/MMTextStorage.h
src/MacVim/MMTextStorage.m
src/MacVim/MMTextView.m
src/MacVim/MMTypesetter.h
src/MacVim/MMTypesetter.m
src/MacVim/MMVimController.h
src/MacVim/MMVimController.m
src/MacVim/MMVimView.m
src/MacVim/MMWindowController.h
src/MacVim/MMWindowController.m
src/MacVim/MacVim.h
src/MacVim/MacVim.m
src/MacVim/gui_macvim.m