Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Hot answers tagged

165

Often times when in a Unix/Linux terminal (Bash) for example you'll use the commands more or less or cat to view a file. When you do this and the file isn't meant to be viewed (such as /bin/ls) you'll get output like this:                  What's going on here is that you just ...


84

I use character maps heavily and decides to make one which you access from anywhere using a web interface and requires no installation. Works best on Chrome. Features Select your own font file Provides font and character information Character copy-able Supports TTF/OTF Supports Icon fonts Simple interface No installation necessary No server upload ...


39

After some research based on the answers of @fpmurphy and @hesse, also based on a comprehensive thread at ubuntuforums and on Fedora Wiki, I found out how to reduce the font size of GRUB2. Choose a font, in this example I chose DejaVuSansMono.ttf Convert the font in a format GRUB understands: sudo grub2-mkfont -s 14 -o /boot/grub2/DejaVuSansMono.pf2 /usr/...


37

If you use the Linux console, the best way I found is: in /etc/default/console-setup put, for example CHARMAP="UTF-8" CODESET="Lat7" FONTFACE="Terminus" FONTSIZE="28x14" Another way is to use setfont from the kbd package: setfont /usr/share/consolefonts/Lat7-Terminus28x14.psf This works for my Debian; it may be different for you. In Debian, you can ...


36

I've had an occasion where none of the usual tricks, reset or stty sane, worked (after accidentally calling print on a python bytearray). I had success with method 2 listed on this helpful blog. I've since created a most helpful alias: alias fix='echo -e "\033c"'


36

So there are a few open source fonts targeting programmers that support ligatures, namely FiraCode Hasklig Monoid Iosevka However, very few opensource terminals that run natively on Linux yet support this. But you can find an current list in the FiraCode docs Kitty I am using Kitty on i3 and I really love it Black Screen (slow in browser terminal emulator ...


28

I think you're looking for otfinfo. There doesn't seem to be an option to get at the Subfamily directly, but you could do: otfinfo --info *.ttf | grep Subfamily Note that a number of the fonts I looked at use "Oblique" instead of "Italic".


28

I've had this issue for ages, maybe it's time to do something about it! It comes done to ClearType, Microsoft and patents from what I read. Most *nix distro's disable any patent protected font rendering by default. Read about Debian and fonts here, you want Subpixel-hinting and Font-smoothing section. There's a config file on that page but I will add here ...


27

help printf defers to printf(1) for the escape sequences interpreted, and the docs for GNU printf says: printf interprets two character syntaxes introduced in ISO C 99: \u for 16-bit Unicode (ISO/IEC 10646) characters, specified as four hexadecimal digits hhhh, and \U for 32-bit Unicode characters, specified as eight hexadecimal digits hhhhhhhh. ...


23

Have you tried ? fc-list | grep -i "media" Also give a try to fc-scan, fc-match


19

This fixed the problem for me. Install the dejavu fonts. sudo pacman -S ttf-dejavu


19

AFAIK there is no existing ports of this font to any outline variant. Here are however some detail, and hacks, that might help you on the way. The t.fnt, Tektite, was created by the (former?) clySmic Software, and likely Ralph B Smith Jr, President/Chief Programmer/Cook/Bottle Washer. It is a bitmap font which was included with the VFONT program for DOS and ...


17

In ~/.Xresources, put, for example, the below config. (There are some other configurations of urxvt that might interest you here (note that this is a plain text file, posted on the web; you may want to use "View Source" to read it).  There you also find another color scheme, that might be better if you ever experience eye problems because of too bright ...


17

This is documented at: http://mscorefonts2.sourceforge.net/ yum install curl cabextract xorg-x11-font-utils fontconfig yum install https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm


16

You could include these color definitions in a script or source file. Could look something like this. #!/bin/bash PATH=/bin:/usr/bin: NONE='\033[00m' RED='\033[01;31m' GREEN='\033[01;32m' YELLOW='\033[01;33m' PURPLE='\033[01;35m' CYAN='\033[01;36m' WHITE='\033[01;37m' BOLD='\033[1m' UNDERLINE='\033[4m' echo -e "This text is ${RED}red${NONE} and ${GREEN}...


16

The appres utility lists the resources used by an application, both user and default. appres XTerm xterm The first argument is the class name (xterm -class Xxx). The second argument, which is optional, is the instance name (xterm -name xxx). The “Large” font is .VT100.font5 or .VT100.utf8Fonts.font5. See the manual for whether .utf8Fonts is used, it's a ...


16

I found it - the "Default font" combo is (mis)placed in the "Widget" tab. I really don't understand why they didn't put it in the "Font" tab.


15

I came across this in 2016. A single TTF/OTF font is never going to cover all utf-8 characters. There is a hard limit of 65535 glyphs in a font, and over 1 million utf-8 glphys. You will need to use a font-family for this to work. A good font-family is the noto font family: https://www.google.com/get/noto/


15

In Linux, if you have .ttf fonts, you most probably also have fontconfig, which comes with the fc.scan utility. You can parse the output for the information you want, or use the badly documented --format option. For example: fc-scan --format "%{foundry} : %{family}\n" /usr/share/fonts/truetype/msttcorefonts/arialbd.ttf The font properties you can print ...


15

On most if not all terminal emulators, you can't set different font sizes or different fonts, only colors and a few attributes (bold, underlined, standout). In bash (or in zsh or any other shell), you can use the terminal escape sequences directly (apart from a few exotic ones, all terminals follow xterm's lead these days). CSI is ESC [, written $'\e[' in ...


15

Urxvt has an option for basic kerning: letterSpace. See man urxvt: -letsp number Compile frills: Amount to adjust the computed character width by to control overall letter spacing. Negative values will tighten up the letter spacing, positive values will space letters out more. Useful to work around odd font metrics; ...


15

The command fc-list can list all available fonts according to their properties. In your case one needs to search for the spacing corresponding to mono, that would be 100, so fc-list :spacing=100. Simpler form fc-list :mono should probably work too. Example: $ fc-list :spacing=100 /usr/share/fonts/urw-fonts/n022003l.pfb: Nimbus Mono L:style=Regular /usr/...


14

You can use fc-match to see which fonts match that pattern: # fc-match "Monospace" DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" To see the whole priority list matching that pattern, use: fc-match --sort "Monospace" Reference: man fc-match fc-match matches pattern (empty pattern by default) using the normal fontconfig matching rules to ...


14

This is not necessarily the best method, and it sure isn't user-friendly, but it's easy to get working: here's a Python script to do it. Install the Python-fontconfig library. Either get it from your distribution (e.g. sudo apt-get install python-fontconfig on Debian and derivatives) or install it in your home directory (pip install --user python-fontconfig)...


13

According to the manual, setting URxvt.boldFont to empty will disable the bold font, and uses regular font instead. This is the preferred way I think. URxvt.boldFont:


13

fc-match is the utility to use. For example, fc-match monospace will tell you the font used for monospace, and fc-match -s monospace will tell you fallback fonts as well, in order. The first font on the list will be what is used in most cases, and all fonts after are fallback fonts for missing glyphs.


12

display OpenSans-CondBold.ttf display is part of imagemagick, so you will need it to be installed. Answer possible thanks to this forum post. This problem has been bugging me for years, because it is only every few months that I want to preview a font and I never remembered which software solved it last time, so I made a video version of this answer to ...


12

You can just define the linum size in your init config so it doesn't depend on default-face: (set-face-attribute 'linum nil :height 100) If you are not using linum-mode as a global default (ie such as a major-mode hook), evaluate the set-face-attribute command on load or else you will get an invalid face: linum error: (eval-after-load "linum" '(set-face-...


12

I spent the better part of tonight solving this same issue, even though it's 2 years later! So to avoid a DenverCoder9 moment for future visitors, here's what solved my issue. From this email thread: As root, edit /usr/lib/systemd/system/systemd-vconsole-setup.service Change the After= and Before= lines to: After=sysinit.target Before=shutdown.target ...


12

You should edit the file /etc/default/console-setup and change the FONTSIZE variable. Once you've made your changes you must reconfigure your terminal by running: $ sudo service console-setup restart


Only top voted, non community-wiki answers of a minimum length are eligible