Cannot use linux fonts in emacs under Bash for Windows - emacs

I'm running bashforwindows, and have install emacs natively (not emacs for windows) following the awesome instructions given by Luke Lee to install from source here: How to use X Windows with Emacs on Windows 10 Bash?
I can run emacs fine from bash, using MobaXTerm as the xserver. However, I cannot get emacs to see any of my linux fonts (or windows fonts, for that matter).
From my shell, I can run fc-list and get a list that includes things like consola and Inconsolata (which is what I want):
[~]$ fc-list
/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/home/hal/.local/share/fonts/consolaz.ttf: Consolas:style=Bold Italic
/home/hal/.local/share/fonts/Inconsolata-Bold.ttf: Inconsolata:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/home/hal/.local/share/fonts/consolai.ttf: Consolas:style=Italic
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/home/hal/.local/share/fonts/Inconsolata-Regular.ttf: Inconsolata:style=Regular
/home/hal/.local/share/fonts/consolab.ttf: Consolas:style=Bold
/home/hal/.local/share/fonts/consola.ttf: Consolas:style=Regular
/usr/share/fonts/truetype/inconsolata/Inconsolata.otf: Inconsolata:style=Medium
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book
However, emacs cannot see these. If I run emacs from that shell, and then from emacs run (print (font-family-list)), I get:
("courier" "helvetica" "new century schoolbook" "times" "utopia"
"lucida" "lucidabright" "lucidatypewriter" "fixed" "nil" "clearlyu
alternate glyphs" "clearlyu arabic extra" "clearlyu arabic" "clearlyu
devanagari" "clearlyu devangari extra" "clearlyu ligature" "clearlyu
pua" "clean" "fixed" "open look cursor" "open look glyph" "courier"
"helvetica" "new century schoolbook" "times" "utopia" "lucida"
"lucidabright" "lucidatypewriter" "fixed" "nil" "clearlyu alternate
glyphs" "clearlyu arabic extra" "clearlyu arabic" "clearlyu
devanagari" "clearlyu devangari extra" "clearlyu ligature" "clearlyu
pua" "clean" "fixed" "open look cursor" "open look glyph" "fixed")
which does not contain any of fonts I want.
How can I get emacs to see the fonts that are available, or otherwise find some other way of installing them?

Get an emacs version which is compiled with fontconfig support, not one that only uses the (ugly, deprecated limited) X core fonts subsystem

Related

How to force vscode editor to render monospaced charaters (like those in the terminal)?

I use JetBrains Mono + 微软雅黑 fonts in VSCode, both for editor and terminal:
"editor.fontFamily": "'JetBrains Mono', 微软雅黑",
"terminal.integrated.fontFamily": "'JetBrains Mono', 微软雅黑",
But I was suprised to find out that it's rendered differently in the editor and terminal:
editor:
terminal:
As you can see, it's monospaced in terminal, but not in editor. How can this come?
I want to have monospace in editor too! What should I do?

VS Code Integrated Terminal Not Displaying Special Characters

My VS Code integrated terminal doesn't recognize the git branch symbols, or the forward arrow character, shown in the first screenshot, which displays correctly in iTerm windows and IntelliJ's integrated terminal.
These characters are coming from iTerm, using the terminal setup steps I went through here: https://medium.com/#Clovis_app/configuration-of-a-beautiful-efficient-terminal-and-prompt-on-osx-in-7-minutes-827c29391961
What I want to see in VS Code integrated terminal:
What I currently see in VS Code integrated terminal:
I did come across a solution to add this to my VS Code settings.json, but this setting has since been deprecated as it has been integrated as the default setting in newer vs updates.
"terminal.integrated.experimentalTextureCachingStrategy": "dynamic"
It's not a pressing issue, but personalizing the VS Code terminal with more git info and aesthetics would be really nice using special characters.
Install a powerline/nerdfont font to your system if you haven't already, and then specify that font in the terminal.integrated.fontFamily setting in your settings.json file.
Quoting from the VS Code docs:
Powerline fonts are special patched fonts that contain additional characters that can be used in the terminal. VS Code's terminal renders some of the Powerline symbols without needing to configure a font, but if more glyphs are desired, configure a Powerline font with the font family setting. Powerline fonts typically end in " for Powerline", the following setting is an example of how to configure a DejaVu Sans Mono that has been patched:
"editor.fontFamily": "'DejaVu Sans Mono for Powerline'"
Nerd Fonts work the same and typically have a " NF" suffix, the following is an example of how to configure Hack's nerd fonts variant:
"terminal.integrated.fontFamily": "'Hack NF'"

setting character variants ss01, ss02, ... in vscode settings does not work in vscode terminal

I am using fira code font and I am setting "editor.fontLigatures": "'ss01','ss03','ss04','ss07', ..." in vscode. The character variants are working fine inside the editor but It is not working in terminal. So how to make vscode to show character variants in terminal?
OS: Linux (Elementary OS)
Ligatures are not supported in the terminal yet: See (and upvote) Support ligatures in terminal.
Also, the setting editor.fontLigatures will only affect the editors, not the terminal.

Emacs bad font rendering under Windows

After some googling I found, that people recomment font Inconsolata for programming in Emacs. I installed it on Windows and Linux from here:
http://www.levien.com/type/myfonts/inconsolata.html
Here are the screenshots of the same text 1 - Linux, 2 - Windows XP SP3:
Under Windows the font is thin, unclear and is uncomfortable for reading. Is it possible to make it render it as well as on Linux?
Download and install Inconsolata.ttf font and install it instead of otf:
http://googlefontdirectory.googlecode.com/hg-history/fffda675769720a297f4d239e7065f751bbe655f/inconsolata/Inconsolata.ttf
It will be rendered smoothly on Windows.
Just use Consolas, it's hands down the best monospace font to use on Windows (screenshot).
(set-face-attribute 'default nil :height 115 :family "Consolas")
My favorite is Source Code Pro (https://github.com/adobe-fonts/source-code-pro/releases/tag/1.017R) - again make sure to use ttf.
You can run the Cygwin version, using X11. It should give you the exact same output as under GNU/Linux in this respect.

Emacs on Mac: copy text from Word 2008 to Emacs

When I copy a formatted text from Word 2008 into Emacs, it pastes as an image. I found a similar post here. But I'm unable to post a comment to that question. I tried clipboard-yank and that doesn't work.
Using: Mac: 10.6.7; Emacs: GNU Emacs 22.3.1 (i386-apple-darwin9.8.0, Carbon Version 1.6.0)
You could save the text from word as a plaintext document, open it from emacs, and then use emacs' kill-and-yank tools.