Loading ...
Sorry, an error occurred while loading the content.

Text Shadows

Expand Messages
  • Jason Moiron
    Hey All, I ve recently written a hacky little patch for vim gtk+x11 which will draw faux shadows under text. I quite like the look of this, and wanted to get
    Message 1 of 6 , Sep 9, 2011
    • 0 Attachment
      Hey All,

      I've recently written a hacky little patch for vim gtk+x11 which will
      draw faux shadows under text. I quite like the look of this, and
      wanted to get this going on my OSX laptop as well. Unfortunately, I
      have experience with C and Gtk but not much with Cocoa/ObjC; I cannot
      make a ton of sense of MMTextView.m, and I'm not sure if Cocoa will
      natively support text shadows in some nicer way or if I could use the
      same double-render technique that I used in gtk.

      Gvim's text view uses drawing primatives to paint text with the
      appropriate fg & bg color; my patch simply painted the text twice,
      once using a slightly darkened bg color as the fg color, transposed 1y
      & 1x pixel, and then again using the standard fg color.

      I don't mind if this type of feature isn't desirable or not really in
      contention for inclusion in the main line; I'd gladly maintain my own
      patch and builds. Any pointers on how to start on this?

      -- Jason

      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Janusz Bossy
      ... Hi Jason, unfortunately I can t help you with your problem but I just wanted to see how the effect looks on your linux machine. Can you point me to the
      Message 2 of 6 , Sep 9, 2011
      • 0 Attachment
        On Fri, Sep 9, 2011 at 10:48 PM, Jason Moiron <jlmoiron@...> wrote:
        > I've recently written a hacky little patch for vim gtk+x11 which will
        > draw faux shadows under text.  I quite like the look of this, and
        > wanted to get this going on my OSX laptop as well.

        Hi Jason,

        unfortunately I can't help you with your problem but I just wanted to
        see how the effect looks on your linux machine. Can you point me to
        the patch or just upload a couple of screenshots?

        Thanks,
        Janusz

        --
        You received this message from the "vim_mac" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Jason Moiron
        Sure. The patch is here: (I should really set up an hg mirror, I m thinking more and more I want to make this a bit less ugly than some compile- time
        Message 3 of 6 , Sep 10, 2011
        • 0 Attachment
          Sure.

          The patch is here: (I should really set up an hg mirror, I'm thinking
          more and more I want to make this a bit less ugly than some compile-
          time always-on hack)

          http://dev.jmoiron.net/vim-shadow.patch

          Here are some assorted screenshots:

          http://jmoiron.net/~jmoiron/ss/vim-shadow.png
          http://jmoiron.net/~jmoiron/ss/vim-shadow2.png
          http://jmoiron.net/~jmoiron/ss/vim-shad-dark.png
          http://jmoiron.net/~jmoiron/ss/vim-shad-light.png

          It doesn't look all that hot on light backgrounds; I think either my
          darkening algorithm is a little too severe. I worked in a catch for
          fairly bright colors, but it's got all sorts of caveats (anything very
          red will be considered "bright"). Still, once rendering the effect is
          possible, determining the right shadow color is probably a less
          difficult issue.

          -- Jason


          On Sep 9, 5:22 pm, Janusz Bossy <janusz.bo...@...> wrote:
          > On Fri, Sep 9, 2011 at 10:48 PM, Jason Moiron <jlmoi...@...> wrote:
          > > I've recently written a hacky little patch for vim gtk+x11 which will
          > > draw faux shadows under text.  I quite like the look of this, and
          > > wanted to get this going on my OSX laptop as well.
          >
          > Hi Jason,
          >
          > unfortunately I can't help you with your problem but I just wanted to
          > see how the effect looks on your linux machine. Can you point me to
          > the patch or just upload a couple of screenshots?
          >
          > Thanks,
          > Janusz

          --
          You received this message from the "vim_mac" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Jason Moiron
          I ve updated the patch to have a better darkening algorithm based on hsv color coordinates. I d still appreciate if anyone has any pointers on how to achieve
          Message 4 of 6 , Sep 11, 2011
          • 0 Attachment
            I've updated the patch to have a better darkening algorithm based on
            hsv color coordinates. I'd still appreciate if anyone has any
            pointers on how to achieve this effect in MacVim.

            Thanks!

            -- Jason

            On Sep 10, 3:31 am, Jason Moiron <jlmoi...@...> wrote:
            > Sure.
            >
            > The patch is here:  (I should really set up an hg mirror, I'm thinking
            > more and more I want to make this a bit less ugly than some compile-
            > time always-on hack)
            >
            > http://dev.jmoiron.net/vim-shadow.patch
            >
            > Here are some assorted screenshots:
            >
            > http://jmoiron.net/~jmoiron/ss/vim-shadow.pnghttp://jmoiron.net/~jmoiron/ss/vim-shadow2.pnghttp://jmoiron.net/~jmoiron/ss/vim-shad-dark.pnghttp://jmoiron.net/~jmoiron/ss/vim-shad-light.png
            >
            > It doesn't look all that hot on light backgrounds;  I think either my
            > darkening algorithm is a little too severe.  I worked in a catch for
            > fairly bright colors, but it's got all sorts of caveats (anything very
            > red will be considered "bright").  Still, once rendering the effect is
            > possible, determining the right shadow color is probably a less
            > difficult issue.
            >
            > -- Jason
            >
            > On Sep 9, 5:22 pm, Janusz Bossy <janusz.bo...@...> wrote:
            >
            >
            >
            >
            >
            >
            >
            > > On Fri, Sep 9, 2011 at 10:48 PM, Jason Moiron <jlmoi...@...> wrote:
            > > > I've recently written a hacky little patch for vim gtk+x11 which will
            > > > draw faux shadows under text.  I quite like the look of this, and
            > > > wanted to get this going on my OSX laptop as well.
            >
            > > Hi Jason,
            >
            > > unfortunately I can't help you with your problem but I just wanted to
            > > see how the effect looks on your linux machine. Can you point me to
            > > the patch or just upload a couple of screenshots?
            >
            > > Thanks,
            > > Janusz

            --
            You received this message from the "vim_mac" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • björn
            ... I think what you are trying to achieve will be much easier if you enable the experimental renderer (in the advanced preferences) and then patch
            Message 5 of 6 , Sep 12, 2011
            • 0 Attachment
              On 11 September 2011 22:23, Jason Moiron wrote:
              > I've updated the patch to have a better darkening algorithm based on
              > hsv color coordinates.  I'd still appreciate if anyone has any
              > pointers on how to achieve this effect in MacVim.

              I think what you are trying to achieve will be much easier if you
              enable the experimental renderer (in the advanced preferences) and
              then patch MMCoreTextView instead of trying to patch MMTextView.

              Note that I am not really interested in adding text shadow support so
              even if you do get around to writing this patch it is very unlikely
              that I will ever merge it with mainline. Sorry.

              Björn

              --
              You received this message from the "vim_mac" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Jason Moiron
              ... Thank s very much Björn! Without your pointers, I was lost! Since this is for my own personal use, the patch is extremely rough and simply enables the
              Message 6 of 6 , Sep 12, 2011
              • 0 Attachment
                On Sep 12, 1:45 pm, björn <bjorn.winck...@...> wrote:
                > On 11 September 2011 22:23, Jason Moiron wrote:
                >
                > > I've updated the patch to have a better darkening algorithm based on
                > > hsv color coordinates.  I'd still appreciate if anyone has any
                > > pointers on how to achieve this effect in MacVim.
                >
                > I think what you are trying to achieve will be much easier if you
                > enable the experimental renderer (in the advanced preferences) and
                > then patch MMCoreTextView instead of trying to patch MMTextView.
                >
                > Note that I am not really interested in adding text shadow support so
                > even if you do get around to writing this patch it is very unlikely
                > that I will ever merge it with mainline.  Sorry.
                >
                > Björn

                Thank's very much Björn! Without your pointers, I was lost!

                Since this is for my own personal use, the patch is extremely rough
                and simply enables the drawing of these faux text shadows everywhere
                in exactly the same manner of the linux patch I've linked above. If
                anyone else is interested, it can be viewed here:

                https://github.com/jmoiron/macvim/commit/3f609d05ff517d3988f1a0774c6afefd8ba9521b

                -- Jason

                --
                You received this message from the "vim_mac" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              Your message has been successfully submitted and would be delivered to recipients shortly.