ON Fedora 31. All fonts properly installed. It works perfectly on gnome-shell but broken in i3-sensible-terminal ie urxvt
All symbols are broken
Since I am using i3 I want to stick to urxvt
The .Xdefaults is
URxvt.allow_bold: true
URxvt*font: xft:Monospace:pixelsize=14
URxvt*boldFont: xft:Monospace:bold:pixelsize=14
! Fix font space
URxvt*letterSpace: -1
Had the same problem on URxvt. Installing fonts from the below link fixed the problem for me.
https://github.com/powerline/fonts
Installed the fonts and tested with the below command
urxvt -fn 'xft:DejaVu Sans Mono for Powerline-10'
My .Xresources:
URxvt.font: xft:DejaVu Sans Mono for Powerline-9
URxvt.boldFont: xft:DejaVu Sans Mono for Powerline-9
URxvt.italicFont: xft:DejaVu Sans Mono for Powerline-9
URxvt.boldItalicfont: xft:DejaVu Sans Mono for Powerline-9
URxvt.letterSpace: 0
Monospace doesn't support Powerline font, you can add a second font that can handle the characters the first can't handle:
URxvt.font: xft:Monospace:pixelsize=14,xft:Inconsolata\ for\ Powerline:pixelsize=14
You can replace Inconsolata\ for\ Powerline by any powerline fonts you don't have that issue in gnome-shell you should have some installed
Related
I'm attempting to use Ghostscript 9.27 on Windows 10 Pro to compress a PDF with CID fonts, using a modified 'cidfmap' file ($GS_HOME/Resource/Init/cidfmap). However, Ghostscript doesn't seem to recognize my changes to 'cidfmap', and instead wants to load the DroidSansFallback TrueType font to emulate the missing CID font.
I have tried using the "-I" command line parameter to tell Ghostscript to use the modified file in the $GS_HOME/Resource/Init directory, as specified in the documentation.
I've also tried building the source code within Developer Command Prompt for VS 2017, using the following command (and no errors):
nmake /A psi/msvc.mak MSVC_VERSION=15 WIN64=
Below is the full Ghostscript command I am running in the command prompt:
gswin64c.exe -I"C:/Program Files/gs/ghostscript-9.27/Resource/Init" -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dPDFSTOPONERROR -dBATCH -dNOPAUSE -sOutputFile=output.pdf m0001-062-1.pdf
the record added to the 'cidfmap' file (it's the only one):
/MSPGothic << /FileType /TrueType /Path ("C:/Windows/Fonts/msgothic.ttc") /SubfontID 0 /CSI [(Japan1) 2] >> ;
and the output from Ghostscript I've been receiving in both cases:
GPL Ghostscript 9.27 (2019-04-04)
Copyright (C) 2018 Artifex Software, Inc. All rights reserved.
This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY:
see the file COPYING for details.
Processing pages 1 through 4.
Page 1
Loading NimbusRoman-Bold font from C:/Program Files/gs/ghostscript-9.27/Resource/Font/NimbusRoman-Bold... 4570288 3226611 4074256 2336262 4 done.
Page 2
Page 3
Querying operating system for font files...
Substituting font Helvetica for ArialMT.
Loading NimbusSans-Regular font from C:/Program Files/gs/ghostscript-9.27/Resource/Font/NimbusSans-Regular... 5086792 3742157 2284000 967988 4 done.
Substituting font Helvetica-Narrow for ArialNarrow.
Loading NimbusSansNarrow-Regular font from C:/Program Files/gs/ghostscript-9.27/Resource/Font/NimbusSansNarrow-Regular... 5273304 3930300 2397536 1064531 4 done.
Substituting font Helvetica-Bold for Arial-BoldMT.
Loading NimbusSans-Bold font from C:/Program Files/gs/ghostscript-9.27/Resource/Font/NimbusSans-Bold... 5500440 4150230 3021540 1680111 4 done.
Can't find CID font "MSPGothic".
Attempting to substitute CID font /Adobe-Japan1 for /MSPGothic, see doc/Use.htm#CIDFontSubstitution.
The substitute CID font "Adobe-Japan1" is not provided either. attempting to use fallback CIDFont.See doc/Use.htm#CIDFontSubstitution.
Loading a TT font from C:/Program Files/gs/ghostscript-9.27/Resource/CIDFSubst/DroidSansFallback.ttf to emulate a CID font Adobe-Japan1 ... Done.
Page 4
Can't find CID font "MSPGothic".
Attempting to substitute CID font /Adobe-Japan1 for /MSPGothic, see doc/Use.htm#CIDFontSubstitution.
Loading a TT font from C:/Program Files/gs/ghostscript-9.27/Resource/CIDFSubst/DroidSansFallback.ttf to emulate a CID font Adobe-Japan1 ... Done.
It seems as if I've missed something simple here, as others with similar questions got it working with just the "-I" command line parameter.
What am I doing wrong?
The problem is (once I looked carefully enough!) clear. You've put quotes "" around the filename.
The '(' and ')' characters are string delimiters in PostScript, not " (and the cidfmap file is read as a PostScript program) so by doing that you've made the " characters part of the path. Unsurprisingly Ghostscript can't find a path beginning with "
So if you change your cidfmap entry to:
/MSPGothic << /FileType /TrueType /Path (C:/Windows/Fonts/msgothic.ttc) /SubfontID 0 /CSI [(Japan1) 2] >> ;
you should find it works, it does for me.
How can I get Ghostscript to substitute Arial/Arial-Bold for Arial+000040/Arial,Bold+000041 when reading
jhtest.pdf?
Ghostscript insists on substituting Helvetica-Bold for both fonts.
Changing the font name in the pdf using vim in binary mode helps - jhtest-patched.pdf
Log for jhtest.pdf
GS_FONTPATH=C:\Windows\Fonts
gs -dNOPAUSE -dBATCH -dCCFONTDEBUG -sDEVICE=nullpage jhtest.pdf
GPL Ghostscript 9.18 (2015-10-05)
Copyright (C) 2015 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Scanning C:\windows\Fonts for fonts... 666 files, 473 scanned, 447 new fonts.
Querying operating system for font files...
Substituting font Helvetica-Bold for Arial+000040.
Loading NimbusSanL-Bol font from %rom%Resource/Font/NimbusSanL-Bol... 8611036 7144230 2673392 1348904 3 done.
Substituting font Helvetica-Bold for Arial,Bold+000041.
Substituting font Times-Bold for TimesNewRoman,Bold+000013.
Loading NimbusRomNo9L-Med font from %rom%Resource/Font/NimbusRomNo9L-Med... 8870100 7399404 3366000 1964135 3 done.
Log for jhtest-patched.pdf - Arial and Arial-Bold are substituted as expected.
GS_FONTPATH=C:\Windows\Fonts
gs -dNOPAUSE -dBATCH -dCCFONTDEBUG -sDEVICE=nullpage jhtest-patched.pdf
GPL Ghostscript 9.18 (2015-10-05)
Copyright (C) 2015 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Can't find (or can't open) font file %rom%Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Can't find (or can't open) font file %rom%Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Scanning C:\windows\Fonts for fonts... 666 files, 473 scanned, 447 new fonts.
Can't find (or can't open) font file %rom%Resource/Font/ArialMT.
Can't find (or can't open) font file ArialMT.
Loading ArialMT font from C:\windows\Fonts/arial.ttf... 8312100 3435413 4127492 2703302 3 done.
Can't find (or can't open) font file %rom%Resource/Font/Arial-BoldMT.
Can't find (or can't open) font file Arial-BoldMT.
Loading Arial-BoldMT font from C:\windows\Fonts/arialbd.ttf... 8369364 3483445 6172560 4696464 3 done.
Querying operating system for font files...
Substituting font Times-Bold for TimesNewRoman,Bold+000013.
Loading NimbusRomNo9L-Med font from %rom%Resource/Font/NimbusRomNo9L-Med... 8413932 3678215 7135440 5602384 3 done.
This looks like an attempt by the creating software to include a subset font (subset fonts are normally named with a 6 letter 'tag' a plus sign and then the original font name). However this isn't (obviously) a font corresponding to that scheme.
The fonts are not embedded, whihc is frankly a bad idea, and the names are non-standard. This means that the PDF consumer must use a substitute font. The default substitute font for Ghostscript is Helvetica, which is why you get that.
If you change the fontnames to match the 'real' font name, then Ghostscript (and other PDF consumers) are able to find Arial as a substitute.
In order to get Ghostscript to find the 'mangled' names in your file, you would have to specifically define a substitute for those exact font names.
Since you are using Windows your build is using a ROM file system. However, to complicate matters, you seem o be using a Linux version of Ghostscript (gs instead of gswin32 or gswin64).
This makes me unsure what exactly you are doing. However, if I get the Ghostscript source, modify the file /ghostpdl/Resource/Init/fontmap.GS:
/Arial+000040 /ArialMT ;
and then run Ghostscript:
gswin32c -I/ghostpdl/Resource/Init jhtest.pdf
the result is that Arial is used for Arial+000040. You will need to modify this to suit your environment, and you will need to locate the resource files appropriate to the version of Ghostscript which you are using (because they are versioned).
You can then add as many substitutes as you like.
Or you can get 'Visual Software' to produce more sensible PDF file which have the font embedded. Or faling that at least don't mangle the font names.
When we want to render text an vips image, you do something like this with vips_text:
import "C"
var textImage *C.VipsImage
cText := C.CString("Some text")
cFont := C.CString("Arial 12px")
C.cgo_vips_text(&textImage, cText, cFont)
But here, Arial 12px is a fontconfig string name and assumes that the system has this font installed.
How do I let the program use a custom truetype font file, e.g., Roboto.ttf?
Trying
cFont := C.CString("Roboto.ttf")
probably won't work.
We could put the Roboto.ttf file in the system directory, for example, in Ubuntu you put the file in /usr/share/fonts/truetype, but the code makes the assumption that this font exists, which is not a solution to write machine-independent program. So I wonder if there is a better way to do this so that we can ship the executables with the font file together.
vips uses standard fontconfig font names, so you need to set up fontconfig to add your custom font to its search path.
From the manual it looks like you can set the environment variable XDG_CONFIG_HOME to point to your new font, then from go refer to that font as Roboto 48pt (for example).
It's easy to test from the command-line. Try:
$ fc-match "Roboto"
Roboto-Regular.ttf: "Roboto" "Regular"
$ vips text x2.png "hello" --font "Roboto 48px"
$ vips text x.png "hello" --font "Arial 48px"
$ eog x.png x2.png
And make sure you see two different images.
I am using gvim 7.3 on Windows 7. I want to set the "Courier_New" font in bold style.
How to do that? I tried the following but it failed.
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=Menlo\ Regular:h14
elseif has("gui_win32")
set guifont=Courier_New\ Bold:h12:cANSI
endif
endif
An almost exactly identical example is available at the bottom of :help 'guifont':
:set guifont=courier_new:h12:w5:b:cRUSSIAN
so the following should do what you want:
:set guifont=courier_new:h12:b:cANSI
Always start with :help.
Additionaly, you can use :set guifont=* to open the font choosing dialog, select your font, and then use :set guifont? to see how the option was set.
I have recently started using a Mac OS X Lion system and tried to use Vim in terminal. I previously had a .vimrc file in my Ubuntu system and had F2 and F5 keys mapped to pastetoggle and run python interpreter. Here are the two lines I have for it:
set pastetoggle=<F2>
map <buffer> <F5> :wa<CR>:!/usr/bin/env python % <CR>
It's working just fine in Ubuntu but no longer works in Mac. (The above two lines are in .vimrc under my home dir.) I have turned off the Mac specific functions in my preference so the function keys are not been used for things like volume. Right now pressing F5 seems to capitalize all letters until next word, and F2 seems to delete next line and insert O.....
Is there something else I need to do to have it working as expected?
In addition, I had been using solarized as my color scheme and tried to have the same color scheme now in Mac. It seems that the scheme command is being read from .vimrc, but the colors are stil the default colors. Even though the .vim/colors files are just the same as before. Is this a related error that I need to fix? Perhaps another setting file being read after my own? (I looked for _vimrc and .gvimrc, none exists.)
Thanks!
I finally got my function mappings working by resorting to adding mappings like this:
if has('mac') && ($TERM == 'xterm-256color' || $TERM == 'screen-256color')
map <Esc>OP <F1>
map <Esc>OQ <F2>
map <Esc>OR <F3>
map <Esc>OS <F4>
map <Esc>[16~ <F5>
map <Esc>[17~ <F6>
map <Esc>[18~ <F7>
map <Esc>[19~ <F8>
map <Esc>[20~ <F9>
map <Esc>[21~ <F10>
map <Esc>[23~ <F11>
map <Esc>[24~ <F12>
endif
Answers to these questions were helpful, if you need to verify that these escape sequences match your terminal's or set your own:
mapping function keys in vim
Binding special keys as vim shortcuts
It probably depends on terminal emulators behaving consistently (guffaw), but #Mark Carey's suggestion wasn't enough for me (I wish it was so simple). With iTerm2 on OS X, I'd already configured it for xterm-256color and tmux for screen-256color, and function mappings still wouldn't work. So the has('mac') might be unnecessary if these sequences from iTerm2 are xterm-compliant, I haven't checked yet so left it in my own config for now.
You might want some imap versions too. Note that you shouldn't use noremap variants since you do want these mappings to cascade (to trigger whatever you've mapped <Fx> to).
Regarding your colorscheme/solarized question - make sure you set up Terminal (or iTerm2, which I prefer) with the solarized profiles available in the full solarized distribution that you can download here: http://ethanschoonover.com/solarized/files/solarized.zip.
Then the only other issue you may run into is making sure you set your $TERM xterm-256color or screen-256color if you use screen or tmux.
You can take a look at my dotfiles for a working setup, but don't forget to setup your Terminal/iTerm color profiles as a first step.
see this answer: https://stackoverflow.com/a/10524999/210923
essentially changing my TERM type to xterm-256color allowed me to map the function keys properly.
I used the following in my vimrc to copy and paste
if &term =~ "xterm.*"
let &t_ti = &t_ti . "\e[?2004h"
let &t_te = "\e[?2004l" . &t_te
function XTermPasteBegin(ret)
set pastetoggle=<Esc>[201~
set paste
return a:ret
endfunction
map <expr> <Esc>[200~ XTermPasteBegin("i")
imap <expr> <Esc>[200~ XTermPasteBegin("")
cmap <Esc>[200~ <nop>
cmap <Esc>[201~ <nop>
endif
I got it from here https://stackoverflow.com/a/7053522