代码之家  ›  专栏  ›  技术社区  ›  Max von Hippel MD. Sahib Bin Mahboob

如何在gmt pstext中使用符号字体?

  •  0
  • Max von Hippel MD. Sahib Bin Mahboob  · 技术社区  · 7 年前

    我正在使用通用映射工具在映射上编写标签,并希望使用 \alpha 符号(_±)。此符号以格林威治标准时间的符号字体提供,并且 corresponds to octal code 141 . 我明确声明要在我的gmt默认值和pstext命令中使用符号字体:

    gmtdefaults -D > .gmtdefaults4;
    gmtset FONT_LABEL 12 FONT_ANNOT_PRIMARY 12 MAP_LABEL_OFFSET 0.2 PS_PAGE_ORIENTATION portrait MAP_GRID_PEN_PRIMARY 0.5p COLOR_NAN 255 FORMAT_GEO_MAP +ddd:mm:ss MAP_GRID_PEN_PRIMARY 0.25p,gray;
    
    # making the map and other vaguely unrelated stuff, including setting
    # variables i and output, which are not related to the behavior here
    
    label="8.9 6 \141 = "$i;
    echo $label | pstext -JX3.4c -R0/3.4/0/3.4 -Gwhite -W0.5p -F+f12 -O -N >> $output
    

    尽管如此,我的输出是信 a ,对应于 \141 以标准字体。如何让gmt使用符号字体?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Max von Hippel MD. Sahib Bin Mahboob    7 年前

    问题是,除非标签使用 @~ 代码,如下面的gmt pstext文档中所述 Description . 没有提供示例,但在我的示例中,解决方案很简单:

    label="8.9 6 @~\141@~ = "$i;
    

    注意前两个数字给出了标签的坐标, @~\141@~ 给出我想要的字符的八进制代码, @ 输入和输出“符号”字体/模式,其他内容不相关。如问题所述,可以找到以八进制表示的完整编码列表。 here .

    推荐文章