LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can one change VIM's hardcopy font? (https://www.linuxquestions.org/questions/linux-general-1/can-one-change-vims-hardcopy-font-883590/)

kaiserkarl13 05-30-2011 04:28 PM

Can one change VIM's hardcopy font?
 
When printing from VIM, is it possible to choose a font other than Courier 10 for the hard copy output? For example, the following commands produce the same postscript file:

:set printfont=Courier\ 10
:hardcopy > myfile.ps
OR
:set printfont=Courier\ 8
:hardcopy > myfile.ps
OR
:set printfont=Luxi\ Mono\ 8
:hardcopy > myfile.ps

It says in the help for printfont that the font NAME (i.e., the typeface) is ignored (which seems stupid, but at least they tell you that) but the SIZE is not. The part about the size not being ignored seems to be a lie. What am I doing wrong?

More importantly, is there a way to change the output typeface to something else? Not that I hate Courier, but I might want my code printouts to be a different typeface.

SkyEye 05-31-2011 09:58 AM

This plugin might help you. http://www.vim.org/scripts/script.php?script_id=512

JZL240I-U 06-07-2011 06:39 AM

@OP: Thread solved?

kaiserkarl13 06-27-2011 09:40 AM

Not solved
 
Sorry for not replying for so long, which I guess only hurts me in the long run.

The utility SkyEye provided (which I already found before posting the first time) only lets you tab between choices of Courier font sizes. In essence, that setting changes the value of "printfont." Also, when I actually print, it tries to re-load the color scheme, and somehow failed to do so if I used one from my own home directory instead of the system wide location. Oh, and changing the dialog from <Courier_h8> to <Courier_h10> doesn't ACTUALLY change the font the printer uses---go figure. Nor does changing the value of "printfont" manually or in ~/.gvimrc. There also isn't a choice for a non-Courier typeface.

The answer seems to be, "no, you're not doing anything wrong," and, "no, you can't change the typeface VIM uses to make hard copies."

If anyone who has gotten VIM 7.x for GNU/Linux to change its output typeface (or font size), please let us know what you did (precisely) so I can attempt to repeat it.

doru 05-21-2014 07:08 AM

This says
Code:

:set printfont=courier:h10
as a possible syntax. It works for me.
To use a font you need to install it or something. In text mode, I believe the choice is smaller then in gui.

clrtexas 09-15-2018 12:05 PM

Thank You
 
Thank you for the :set printerfong-Courier:h10. That works. -- Carol

onebuck 09-18-2018 02:45 PM

Moderator response
 
Please do not resurrect necro threads, this thread is over 4 years dormant. You can give thanks by clicking <Did you find this post helpful?> Yes thus giving credit or even pressing the scale under the user name on the left you can leave a comment along with rep.


All times are GMT -5. The time now is 10:21 PM.