我想创造一个后记或pdf图形,增强符号,斜体或粗体拉丁字符,有时(正常)希腊字符。一般怎么做呢?
Let's say I downloaded CMU Sans Serif, a font that has glyphs for all the strange characters I ever want to use. I converted them to pfa with an online tool and copied the files to the path of working directory.
Let's say I'd like to produce the following notation somewhere.
我创建了一个在utf-8文件(没有bom)中编码的具有以下内容的gnuart脚本。
set term postscript eps enhanced "CMUSansSerif" 15 fontfile add 'CMUSansSerif.pfa' fontfile add 'CMUSansSerif-Oblique.pfa' fontfile add 'CMUSansSerif-Bold.pfa'
set encoding utf8
set o "print.eps"
p x t "Label: {/CMUSansSerif-Bold important }{/CMUSansSerif-Oblique note}: ∫⟨α₂ + β²⟩ = äßű"
set o
and executed with the newest gnuplot, version 5.2.6.
I used a vector graphics editor to open the eps file and relevant part looks like this:
According to Ethan's answer I added adobeglyphnames
to the termoptions. It made at least the letters available but other Unicode symbols are still unavailable. The result is:
What went wrong? How could I produce the desired output?
So many possibilities, where things can go wrong: Is the font not suitable for this task? Did I download a wrong version of it? Did the pfa converter do a bad job? Did I include the font files incorrectly? Was there something wrong with the set encoding
? Do I use a bad vector graphics editor? Do I have wrong fonts installed and the vector graphics editor tries to use them?
发布于 2019-05-28 10:47:40
恐怕答案是,总的来说,后记是错误的工具。如果您完全有可能使用PDF输出,我建议您这样做。甚至可以通过标准工具(例如pdf2ps)将生成的PDF文件转换为PostScript文件。如果非ascii字符仅限于希腊语和其他相对常见的符号,那么这很可能有效,但我不知道这些标准工具涵盖了多少完整的Unicode表。
If you really need to produce PostScript with additional unicode characters directly from gnuplot, you can find full instructions and sample character encoding tables in the gnuplot distribution files:
.../term/PostScript/unicode_maps.README
.../term/PostScript/unicode_big.map
.../term/PostScript/unicode_small.map
I am not familiar with the online tool font conversion you used but probably it failed because it did not have, or at any rate did not use, suitable character encoding tables for the desired conversion.
===
One other thought. There are two ways that a *.pfa font can encode unicode characters that are common enough to have a name assigned by Adobe for use in PostScript. (1) It may use generic names like uni0439 for Unicode code points. (2) It may use Adobe-specific names from the list here: agl-aglfn glyph list
When selecting PostScript output from gnuplot you can tell it which of these two conventions is used by the font you provide. The default is "noadobeglyphnames".
set term postscript {no}adobeglyphnames
==
(recipe for using "set term pdfcairo")
Font handling is unfortunately system-specific, so I cannot tell you how to install or configure fonts on all your target machines. I will show you a procedure that works on a linux desktop that uses the fontconfig utilities for system font handling.
set term pdfcairo font "CMU Sans Serif,15" set output 'enhanced_utf8.pdf' load 'enhanced_utf8.dem'
pdf2ps enhanced_utf8.pdf enhanced_utf8.ps
Screenshot of the result is shown below
发布于 2019-05-28 11:13:48
似乎CMU Sans Serif不包含您所要求的UTF-8字符。使用字体编辑器检查字体,如Birdfont。尽管网页显示要使用的符号,但字体本身并不包含这些符号。但是,您的浏览器可能会显示符号,但它们只是其他字体的后备表示。
https://stackoverflow.com/questions/-100009060
复制相似问题