How to use all windows fonts in gvim

Source: Internet
Author: User

To be honest, gvim is always used, but it cannot find a nice font that can be used in gvim. It is not because there is no font, but cannot be used in gvim,
Gvim is executed by default: Set guifont = * only the same width font is supported when the font is selected (it seems that not all the same width fonts can be selected), which leads to many fonts.
I can't use it, but the font that can be used shows very poor results and looks bad. I think it works very well under Ubuntu...

Therefore, if you want to modify gvim to select all fonts, you can easily modify the parameters and pass them to comdlg32.choosefonta.
Function parameters (you can use depends or OD to view the called function). I get this result:

The 0x00004000 bit is cf_fixedpitchonly, indicating that only the same width font can be used ,............

So you can manually change it to 0x00000041 in OD. You can select the vast majority of fonts (no number) for the test )....

Before and after modification, you can see the length of the scroll bar:

After tests, gvim can work normally without an equal-width font, but for so long, why has the author not modified it? Obviously, not all use the same width font.

Now, go back to OD and find the statement assigned to flags:

 004c3126 |. 8b35 f4e75e00 MoV ESI, DWORD PTR DS:  [5ee7f4] 004c312c |. 8b0d f8ea5e00 MoV ECX, DWORD PTR DS: [5eeaf8] ;  Gvim.00400548  004c3132 |. 83c4 0c                 Add ESP, 0c  004c3135 |. C74424 14 3c000000 MoV DWORD PTR SS: [Esp +14  ], 3C  004c313d |. 894c24 18               MoV DWORD PTR SS: [Esp + 18  ], ECx  004c3141|. C74424 28 41400000MoV   Dword ptr ss:  [Esp + 28  ], 4041  004c3149 |. 85f6 Test  ESI, ESI  004c314b |. 74   0c                   Je Short gvim. 004c3159  004c314d |. B9 0f000000             MoV ECX, 0f  004c3152 |. 8bfb MoV  EDI, EBX 004c3154 |. F3: A5 Rep Movs DWORD PTR ES: [EDI], DWORD PTR DS:  [Esi]  004c3156 |. 8b7d 08                 MoV EDI, DWORD PTR SS: [EBP + 8  ]  004c3159 |> 8d4424 14              Lea Eax, DWORD PTR SS: [Esp + 14  ]  004c315d |. 33d2 XOR  EdX, EDX  004c315f |. 50                      Push Eax ;  /Pchoosefont  004c3160 |. 895c24 24              MoV DWORD PTR SS: [Esp + 24 ], EBX ;  |  004c00004 |. 66 : 895424   48            MoV Word PTR SS: [Esp + 48 ], DX ;  | 004c00009 |. Ff15 54805900           Call DWORD PTR DS: [<& Comdlg32.choosefonta>] ;  \ Choosefonta 

Search for c744242841 in the hexadecimal Editor400000 to find the statement and modify it to c744242841000000 is enough!

The gvim font looks better than before ~~~

Gvim is a little big and inconvenient to upload. If you need to modify the version, please contact me.

Girl don't cry @ 05:33:08 @ http://www.cnblogs.com/nbsofer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.