What are the "font settings theme" packages available in emacs - emacs

Is there any emacs package for font settings similar to color-theme for color. I am looking for a package which already has some good font settings and can be selected without restart of emacs

(I agree with #lawlist that superuser.com might be a better site for this question.)
Here are two answers such packages:
Icicles, with command icicle-font.
Do Re Mi, with command doremi-font+ (also commands doremi-font-size+, doremi-frame-font-size+, and doremi-buffer-font-size+, which affect only the font size).
All of these commands let you choose a font interactively, seeing the effect immediately. You can cycle among some or all of the available fonts. With icicle-font you can type parts of the font name, to narrow the font choices, then cycle among that subset etc.
These are the quickest and friendliest ways I know of to choose a font -- either once and for all (e.g. customize Emacs so it uses that font by default) or to change on the fly.

Related

Emacs24 not rendering fonts properly

I would like to know how to get similar font rendering in GNU Emacs as in GVim as shown in the screenshot below. It seems Emacs has an inferior way of rendering fonts by default. I've tried installing the Infinality font patches but I got the same results. I am running GNU Emacs 24.3 on my Arch Linux virtual machine. I have no Desktop Environment and am using OpenBox as my window manager.
A lot of forum posts I dug up seemed to hint at the libxft library that Emacs uses needing patching in the past, but not anymore. According to Emacs it has been compiled --with-xft so that shouldn't be an issue. Below is a screenshot from both applications and a zoomed in view to highlight the difference in rendering.
In my experience, Emacs does not reliably read font settings from font config or from Gnome, so you may need to change Emacs' font rendering settings.
Notably, the colored pixels around the font in GVim indicate that GVim uses subpixel rendering, whereas the absence of these pixels in Emacs shows that it only uses hinting. The absence of subpixel rendering often makes fonts look blurry.
Find out GVims preferences
Find out what font rendering settings GVim uses. I presume it takes the standard ones from Gnome, so install Gnome Tweaktool to inspect the font settings from Gnome.
Tell Emacs about your font preferences
Now create an .Xresources file that tells Emacs about these settings. The following is represents my font settings, adapt it according to what you have found out in Gnome Tweaktool:
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
Xft.rgba: rgb
As far as I know, the lcdfilter setting isn't available in Gnome Tweaktool, so just leave it on lcddefault. After creating the file
Exit Emacs with C-x C-c
Load these settings with:
$ xrdb -merge ~/.Xresources
Verify that the settings were loaded:
$ xrdb -query | grep Xft
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintfull
Xft.lcdfilter: lcddefault
Xft.rgba: rgb
Restart Emacs
Now check whether the fonts look the same now. Note that GVim may use a different font renderer (e.g. Cairo, Harfbuzz or whatever), so expect some slight differences anyway.
Check that the settings are permanent
Log out of your desktop
Log in again
Use above xrdb -query command to verify the presence of your font settings

Choosing a font string for Emacs

I like this specific font for Emacs:
-unknown-DejaVu LGC Sans Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1
I know I like it because I tested it using M-x helm-select-xfont using the Emacs helm extension (previously known as anything). This command shows a list of fonts available on my system, and it allows me to try them temporarily.
How do I make this font my default font in my Emacs init file?
(set-default-font "FONT-NAME")
You replace FONT-NAME with -unknown-DejaVu LGC Sans Mono-normal-normal-normal-*-*-*-*-*-m-0-iso10646-1.
Perhaps an easier solution is to do so using the menu (while I am against using the menu, though if you don't want to get your hands dirty, try the following):
Menu: Options -> Set Default Font..., and then pick that font (you can also set it to be bold and what not).
Next, go back to Options and hit "Save Options". I believe this would save this for future sessions.

Change default font in netbeans?

Is it possible to change the default font in netbeans? The documentation says:
The font Monospaced is maped to different fonts on different systems.
On Windows it is mapped to "Courier ", on Linux it is mapped to
"Lucida Typewriter".
http://ui.netbeans.org/docs/ui/editor_fonts_colors/Editor_fonts_and_colors.htm
I'm on windows and want to map Monospaced font to 'Consolas' instead of 'Courier'.
P.S. I know that fonts can easily be changed from options, but when I change it in this way, I can no longer use unicode characters. Guess I need to do what they call 'mapping' the monospaced font to other font.
Tools > Options > Fonts and Colors
Set the category "Default", and to the right of that, the font you want to use.
If this does not fix it, try adding:
--laf Nimbus -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd
or
-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd --laf Metal
to the file : netbeans.conf. You can find it in $NETBEANS_HOME/etc/ folder. Make your application font smaller from system preferences.
To change the font size outside of the editor you can configure by editing the Net Beans conf file, you can find it here:
C:\Program Files\NetBeans 8.0.2\etc\netbeans.conf
Then edit this line:
netbeans_default_options="..."
by adding this at the end:
--fontsize 18
I hope it helps :-)
Life becomes more easier now. Just from Tools menu choose Options and then follow steps on the following screen shot and take care with step 3 and 4 which they are making the default font for all languages:
I have a NetBeans plugin called 'UI-Editor' which allows you to customize virtually any Swing property, including font sizes, colors, and types. Go to Tools->Plugins and search for 'UI-Editor' or go here: http://plugins.netbeans.org/plugin/55618/?show=true
also don't not forget to change the font to the one that support Arabic like Arial for example i am not sure of some one mention that i just tried it
As far as I can tell there's no way to do this. jEdit (http://jedit.org) also uses Swing and DOES do font substitution for all fonts - there's a "automatic font substitution" checkbox in Global Options > Text Area, along with a list of preferred fonts. But jEdit is otherwise not as capable as Netbeans.

emacs23 buffer menu font (GTK)

I've recently upgraded to emacs23 (Ubuntu 10.04) and I've managed to get my faces (fonts) all sorted out with relevant .emacs options.
However the one font I can't seem to change is the one used to display the Buffer Menu (i.e. when you CTRL+left-click on a buffer, you get a pop-up menu that lists all open buffers).
The problem is that the font used to display this menu is proportional (not fixed-width) and it makes a big mess of the menu - nothing is lined up vertically, and I often use this to see which buffers hold files that are in common directories. The proportional font has the paths all over the place.
I believe Ubuntu's emacs23 was built with GTK rather than Lucid. Some things I've read seem to indicate that there's no way to set this font within Emacs - that is has to be done externally using GTK config - if this is true, how?
Otherwise, if it can't be done, how tricky is it to recompile emacs23 with Lucid rather than GTK support on Ubuntu? Can it be done easily with "apt-get source"?
I believe I have discovered the answer:
http://www.gnu.org/software/emacs/manual/html_node/emacs/GTK-resources.html
The idea is to create ~/.emacs.d/gtkrc and use the GTK config mechanism to set up alternative styles for emacs' GTK widgets.
$ cat ~/.emacs.d/gtkrc
style "menufont"
{
font_name = "monospace 10" # Pango font name
}
widget "*emacs-menuitem*" style "menufont"
Seems to work well.

How do I get my Emacs to *always* use 6x13 on X11

I recently declared .emacs bankrupcy and reorganized my init stuff. In
the process, I ripped out all the hacky font selection stuff I had
accrued over the years, figuring there are probably easier ways to
accomplish what I want in the most modern version of emacs.
GNU Emacs 23.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.14.4)
on a GNU/Linux System (Ubuntu 8.10).
Let's
ignore, for the moment, the fact that I also run emacs under Mac OS X
(GUI+Terminal) and occasionally on Windows and just focus on the X11
case:
(Background: The font 6x13 has been part of X11 for as long as I can remember. (a.k.a
misc-fixed semi-condensed ...). It's a bitmap font.)
I want emacs to always use the X11 bitmap font 6x13. (This gives me two buffers next to eachother on my netbook.)
I don't want to see DejaVu Sans Mono 16pt or whatever the heck comes up by default on my netbook (it's huge!)
I want every new frame and window to use this font.
I want derived faces (like org-mode-column) to use 6x13 font and not mysteriously switch back to DejaVu Sans Mono
I don't care what GNOME and X11 think the logical DPI of my screen is. I want 6x13.
When I remote into my netbook (NX Machine) I don't want to see 6x10. I want 6x13.
In case there's any doubt: I want 6x13.
What's the canonical way to do to make this happen?
And before some smart-aleck tells me about menu: Options>>Set Default
Font: the resulting dialog box doesn't even offer bitmap fonts, so
there's no way to choose 6x13. Furthermore, it doesn't solve the
problem with org-mode: table-views still come up with the wrong font.
I control this stuff from my .Xresources file.
Personally I have
emacs.reverseVideo: true
emacs.font: 7x13bold
(And I quite agree... long live the bitmap fonts! I'll take my xterm with
XTerm*foreground: green
XTerm*background: black
XTerm*font: 7x13bold
...
over the Gnome terminal any day).
If you're playing with .Xresources from within a session, xrdb command is useful to reload them.
You want to set the default frame parameters in your .emacs.
find out the name of the font you want to use
add the needed value to the default-frame-alist.
The easiest way, actually, is to use customize and customize default-frame-alist, but can also use elisp and write
(setq default-frame-alist
'(font . "-*-*-medium-r-normal--16-*-*-*-*-*-fontset-hiramin_w6"))
That's stolen from my emacs, you'll need to find the full font name (xfontsel?) for the font you want.
See also the EmacsWiki on setting fonts and faces.
For anyone reading this with a recent Linux distribution you will have to install 6x13 first (yes, sounds obvious..). There are instructions here for Ubuntu/Debian which should work on other distros too if you skip the apt-getting of random fonts. Install the "FixedSC" .tgz from there (it unpacks to /usr/local/share/fonts) then follow the instructions to add it to the font cache so it will appear in the Gnome Font selection dialog.