Bad encoding of file name in unzip
Just try to unzip some file that is compressed in Windows, but the extracted files suffer the
bad encoding. The file name is originally in Chinese and the Windows is in Chinese. The default
encoding of Chinese Windows os is cp936
.
Do the following to solve the problem:
1
2
env LANG=zh_CN.GBK 7z x <some-file>
convmv -f cp936 -t utf8 -r --notest <extracted-path>
Install new fonts in Arch Linux
For information on different approaches in details, see the arch wiki, following is the method to install new fonts not in the repositories for current user manually:
1
2
3
mv <new-font-file> ~/.local/share/fonts
fc-cache
fc-list # to see the newly installed fonts listed
Convert font to image
A simple way is to use the functionality provided by ImageMagick
, for more information, see usage page.
1
convert -font <font-family> -pointsize 72 label:<words> <result-image>
To see the <font-family>
that is supported by ImageMagick
, use the following command:
1
convert -list font
It also provides C++ API.