【发布时间】:2012-03-21 07:09:17
【问题描述】:
我尝试在我的 Ubuntu 上的 Matlab 图形图中使用希伯来字符,但无济于事。我试过了:
text(0.6,0.5,'ירוק','fontname','times new roman','rotation',180,'fontsize',50,'color','r')
和
title('ירוק','fontname','times new roman','fontsize',50,'color','r')
类似于the answer to this question 中的建议。我收到了乱码(请参阅attached image)。
Matlab 的版本为 R2009b。当然我设置为 UTF-8 编码。
>> slCharacterEncoding
ans =
UTF-8
我还可以通过 ssh 访问远程计算机,版本为 R2011a。那也没有用。 (那里我不得不slCharacterEncoding('UTF-8'))
另一个选项,使用javax.swing.JLabel 组件,对于我拥有的大量图形来说太难使用了。
我可以继续制作带有英文坐标轴和标题的图表,但很遗憾。有什么建议吗?
编辑:按照 Egon 的建议,如果我可以 print -deps 然后替换生成的 EPS 文件中的文本(来自 Matlab 中的代码),那也很酷。但我不知道如何将 Unicode 放在 EPS 中,我认为这是在拉伸它......
又一次修改:我开始认为这是一个 X 服务器问题。虽然不同,但如果这些问题相关,我不会感到惊讶:
- Matlab figure fonts: broken in 11.04 续。 here
- How to fix MATLAB small figures and small fonts in Ubuntu linux
- View Full Version : [ubuntu] huge fonts in matlab
我尝试卸载 Ubuntu 提供的 NVidia 驱动程序(我有一个 9300GS 卡)并重新安装 NVidia 提供的驱动程序 (v295)。我尝试将 xorg.conf 中的 DPI 更改为 "100 x 100"。安装了HebrewLocalizationHowto 中列出的所有软件包,然后安装了一些。没有任何效果。有什么建议吗?
另一个编辑 位于matlab/sys/fonts/ttf 或matlab/sys/fonts/type1 下的字体未正确呈现。当我编辑图形并双击标题时,我看到字符在那里,但是当我完成编辑时,它返回到错误的渲染。此外,JLabel solution for rendering Unicode characters suggested here 在同一图形下正确呈现文本。
另一个编辑 Matlab R2011a 出现同样的问题。这是listfonts的输出
>> listfonts
ans =
'aharoni'
'andale mono'
'anka clm'
'arial'
'arial black'
'avant garde gothic'
'AvantGarde'
'batang'
'bitstream charter'
'biwidth'
'Bookman'
'caladings'
'century schoolbook l'
'charter'
'clean'
'clearlyu'
'clearlyu alternate glyphs'
'clearlyu arabic'
'clearlyu arabic extra'
'clearlyu devanagari'
'clearlyu devangari extra'
'clearlyu ligature'
'clearlyu pua'
'cmex10'
'cmmi10'
'cmr10'
'cmsy10'
'comic sans ms'
'comix no2 clm'
'Courier'
'courier 10 pitch'
'courier new'
'dingbats'
'dorian clm'
'dotum'
'drugulin'
'ellinia'
'fangsong ti'
'fixed'
'frank ruehl'
'gan clm'
'georgia'
'gladia clm'
'gothic'
'Helvetica'
'Helvetica-Narrow'
'impact'
'itc avant garde gothic'
'itc bookman'
'itc zapf chancery'
'itc zapf dingbats'
'ktav yad clm'
'latin modern roman'
'latin modern sans'
'latin modern sansquotation'
'latin modern typewriter'
'latin modern typewriter variable width'
'lucida'
'lucida bright'
'lucidabright'
'lucidasans'
'lucidasans typewriter'
'lucidatypewriter'
'mincho'
'msam10'
'msbm10'
'nachlieli'
'new century schoolbook'
'newcenturyschlbk'
'NewCenturySchoolBook'
'newspaper'
'nil'
'nimbus mono l'
'nimbus roman no9 l'
'nimbus sans l'
'open look cursor'
'open look glyph'
'ozrad clm'
'Palatino'
'song ti'
'standard symbols l'
'Symbol'
'terminal'
'texgyreadventor'
'texgyrebonum'
'texgyrecursor'
'texgyreheros'
'texgyrepagella'
'texgyreschola'
'texgyretermes'
'Times'
'times new roman'
'trebuchet ms'
'urw bookman l'
'urw chancery l'
'urw gothic l'
'urw palladio l'
'verdana'
'wasy10'
'webdings'
'yehuda'
'zapf chancery'
'zapf dingbats'
'ZapfChancery'
'ZapfDingbats'
【问题讨论】:
-
你在开玩笑吗?我在我的引用了那个问题......
-
你试过其他字体吗?您的 Times New Roman 副本可能不包含这些字符或不在正确的代码点处。 (无论如何,除了是一种相对难看的字体,恕我直言。)从您的列表中,我会以
'yehuda'开头,因为这听起来好像应该包含希伯来字母。
标签: matlab unicode plot hebrew figure