How to darken postscript text produced by emacs - emacs

I'm using emacs command ps-spool-buffer-with-faces command to make some postscript files of code I'm working on. The problem is that the font color seems to be light gray instead of black. I've poked around the postscript file & googled a bit, but have not found any solution. Does anyone know how to turn my gray font black?

Assuming you just want to print in black and white, try:
(setq ps-print-color-p nil)
Otherwise, you might take a look at other values for ps-print-color-p:
ps-print-color-p is a variable defined in `ps-print.el'.
Its value is t
Documentation:
Specify how buffer's text color is printed.
Valid values are:
nil Do not print colors.
t Print colors.
black-white Print colors on black/white printer.
See also `ps-black-white-faces'.
Any other value is treated as t.
You can customize this variable.
You can customize using M-xcustomize-variableRETps-print-color-pRET

Related

How can I write colored text to an IRC channel with Irssi?

I'm searching for a method to write a text with different colors like I always saw on other IRC channels. I want to achieve this with Irssi which is CLI based. I have found multiple methods which didn't work as expected. How can I for example write
WHAT
with green color for example?
I would like to achieve the same effect from a simple Bash script too.
First, make sure to enable text colors with
/set hide_colors OFF
Within Irssi, to answer your concrete question, type
Ctrl+C 3 WHAT
and then Enter. The text will show up in green. This convention is known as mIRC colour codes. To make it more comfortable, download the colour_popup script, place it in your ~/.irssi/scripts/autorun folder and run this command:
/statusbar prompt add -after input -alignment right colours
Then it will show you the available colours once you type Ctrl + C.
On the other hand with Bash, you need to use ANSI colour codes. To output green text, try this command:
printf "\e[%dm%s\e[m\n" 32 hallo
\e[ is a CSI (terminal control sequence start) and m is the command; it means character graphics attributes like colour, bold, ...
3 refers to the dull foreground colour table, 2 is green; valid colours go from 0-7. Bright colours are 90-97; background colours are 40-47 and 100-107. There are even more colours possible with other encodings, such as 256 colour table "38;5;<idx>" where <idx> is from 0-255, or 24 bit RGB colours "38;2;12;34;56" (12/255 red, 34/255 green, 56/255 blue); this is not supported by all terminals.

Emacs lisp: get RGB components of face?

I've recently made a switch to Emacs trunk and the region face
color was changed.
And I can't change it back without knowing what it was before.
So I've launched emacs24.3 and see that it was "gtk_selection_bg_color".
This color name isn't valid any more in the trunk.
I've found the color to be "f9b593" with screenshot->gimp->eyedrop method,
but I'd like to know how to do this in Elisp, e.g. something like
(get-face-background-rgb 'region)
;; "f9b593"
Any suggestions?
You can use color-value:
color-values is a compiled Lisp function in `faces.el'. (color-values
COLOR &optional FRAME)
Return a description of the color named COLOR on frame FRAME. The
value is a list of integer RGB values--(RED GREEN BLUE). These values
appear to range from 0 to 65280 or 65535, depending on the system;
white is (65280 65280 65280) or (65535 65535 65535). If FRAME is
omitted or nil, use the selected frame. If FRAME cannot display COLOR,
the value is nil. If COLOR is the symbol `unspecified' or one of the
strings "unspecified-fg" or "unspecified-bg", the value is nil.
To get the color of a face, you can use face-foreground and face-background. In your case, you can use:
(color-values (face-background 'region))
You can use library eyedropper.el or library palette.el --- see Color Palette --- to get the color of a face at point. And you can use library palette to explore colors, to come up with a similar but slightly different color etc. You can use library hexrgb.el to examine and modify RGB components of colors.

Trying to figure out how to force Aquamacs (or any windowed Emacs) to use the xterm 256-colors

This question is in regards to forcing emacs to use a 256 color xterm color scheme.
When you open emacs in a terminal that supports xterm-256, it defaults to the xterm-256 color scheme, where default emacs font face colors like 'Firebrick' turns into something the xterm color scheme can display, which in this case is 'Red', so on and so forth. I really like this. I do not like the default emacs colors in a non-terminal setting; I think they are too faded and washed out-- I much prefer the brightness of the terminal colors.
(In fact I find myself programming in the terminal most often simply because I vastly prefer the typeface and the colors-- but I'd like to start using Aquamacs more for various reasons.)
For the life of me, I cannot figure out how to force Emacs (or in my case, Aquamacs) to force itself to downgrade the default color scheme to the xterm 256 color scheme like it does in my terminal. There has to be an easier way than making a new, ridiculously detailed color theme, but beyond the "TERM= " command you can set in your bashrc file (which obviously Aquamacs doesn't care about or use) I can't find anything equivalent in Emacs/Aquamacs that tells it to adopt a 256 color range so that it does things like turns Firebrick into the closest 'available' color, in this case, red.
I've attached screenshots. The first is how I want it to look like. (jpeg ruins the cripsness/brightness of the colors, but you get the idea.)
Second shot here is the default 'washed out' colors in aquamacs. See how the comments are in Firebrick (correctly displayed), versus the bright red of the comments in the above pic.
Variable names show up as more yellow in the top pic, but as more 'brown' in the bottom. Strings in the above file show up as more 'light brown' whereas in the bottom, it's more a dark brown. You can see they are definitely the same color scheme-- it's just that the terminal doesn't know about some of the colors and so it converts them to their baser, brighter forms.
Anybody know how to force this in Aquamacs? I've spent far too many hours researching this. :-)
Thanks!
Nick

How to add 1 pixel of vert-spacing to an Emacs font?

I don't know if this can easily be done with Emacs (read below for my hack in case there's no easy way to do this) so...
How can I add one pixel of vertical-spacing between each line under Emacs?
I know that screen real estate is precious but I'm using a "custom" font (ProggyFont) and, under IntelliJ IDEA, I can modify the vertical spacing to something that I like.
Under Emacs, however, I find the text hard to read because the pixels from one line are too close from the pixel of another line, so I'd like to add one "one pixel" empty vertical line between every line. Can this be done simply?
If there's no "simple way", how do I take a "x by y" bitmap font and turn it into a "x by (y+1)" bitmap font? I don't mind using a font editor: been there, done that. But I don't know exactly everything that would be involved.
Check out the line-spacing variable, e.g.
(setq line-spacing 0.2)
From the docs:
Additional space to put between lines when displaying a buffer.
The space is measured in pixels, and put below lines on window systems.
If value is a floating point number, it specifies the spacing relative
to the default frame line height. A value of nil means add no extra space.

MATLAB: print pdf in black/white

Matlab prints figures in either black/white or color. A black/white print of a figure is NOT the same as a color print tweaked to black/white: every color including the light ones is translated as black. (Light colors that look good on screen or a color printer look horrible on a black/white printer)
I would like to print a PDF file of a figure. My problem is that there doesn't seem to be a PDF driver for MATLAB that outputs black/white rather than color.
See the print command: -dpdf is the PDF driver but it is color.
Is there any way I can do this?
(edit: http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f3-84337.html#f3-99776 shows the interactive way of doing this, but I need a programmatic method, otherwise it will get tedious rather quickly.)
You can fully automate the print process: http://UndocumentedMatlab.com/blog/customizing-print-setup/
You could convert it to an EPS (-deps or -deps2) and then use eps2pdf (which uses GhostScript) to convert that into a PDF. I generally convert all my figures to this way.