Re: ps2raster error abot Chinese characters
Dongdong Tian <[email protected]>
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <CABhTVEOirwZyz6yLYaU2u_sP=zXotdo-SfKBj5MRHHsnEy-eXA@mail.gmail.com> |
Hi,
I test it with GMT 5.1.1 under my Windows 7.
Below are my five tests:
1. gmt ps2raster test.ps
FAIL
2. gmt ps2raster *-C-sFONTPATH=C:\Windows\Fonts* test.ps
SUCCEED
3. gmt ps2raster -C-sFONTPATH=C:\Windows\Fonts test.ps -P test.ps
SUCCEED
4. gmt ps2raster -C-sFONTPATH=C:\Windows\Fonts test.ps -P -Tg test.ps
SUCCEED
5. gmt ps2raster -C-sFONTPATH=C:\Windows\Fonts test.ps -P* -A* test.ps
FAIL
In test 1, it fails.
In Test 2,3,4, I use -C option to pass FONTPATH to gs, so that gs can find
the Chinese fonts and correctly
do the conversion from ps to pdf, jpeg or whatever.
But, in test 5, when I use -A option to adjust Bounding Box, I get errors
same as you mentioned in your first email.
In fact, I get one more error message, and it is very important, it is:
"
ps2raster: System Call [@"C:\Program Files\gs\gs9.14\bin\gswin32c.exe" -q
-dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox test.ps > ./ps2raster_3432c.bb]
returned error 1.
"
When the -A option is used, ps2raster will use gs command above to
determine the Bounding Box of PS files.
I tried to run the command out of ps2raster,
"C:\Program Files\gs\gs9.14\bin\gswin32c.exe" -q -dSAFER -dNOPAUSE
-dBATCH -sDEVICE=bbox test.ps
it gives the same error.
Then I tried to add FONTPATH option to this command,
"C:\Program Files\gs\gs9.14\bin\gswin32c.exe" -q -dSAFER -dNOPAUSE
-dBATCH -sDEVICE=bbox *-sFONTPATH=C:\Windows\Fonts* test.ps
it correctly determine the Bounding Box.
So, my conclusions are:
1. Under Windows, the FONTPATH is needed for Chinese support.
2. Maybe there is a bug of ps2raster, it forget to pass -C option to gs
command when deal with bounding box.
Dongdong Tian
2014-03-27 10:20 GMT+08:00 杨磊 <[email protected]>:
> Now I can use GMT to make ps format figure with Chinese
> Character correctly after I learned the example 31 and some blogs about
> this.
> But while using ps2raster to convert ps to PNG format the error comes as
> the last letter mentioned. I guess this is a problem of ps2raster and it
> happens when ps2raster call the ghostscript to find Chinese characters.
> [image: 内嵌图片 1]
>
> 2014-03-27 3:55 GMT+08:00 Eduardo A. Suárez <
> [email protected]>:
>
> here http://hi.baidu.com/flyfish551/item/312e9bd3104224f193a97425
>> is a post on GMT chinese support (in english)
>>
>>
>> Quoting Paul Wessel <[email protected]>:
>>
>> Presumably ghostscript cannot find the file with the metrics of the
>>> Chinese characters? Are these installed? While I don't know how this all
>>> works, we have a GMT example that shows the use of Cyrillic alphabet
>>> (example 31) which provides its own files for those characters. Perhaps
>>> studying that example can give you some hints.
>>>
>>> -p
>>>
>>> On Mar 26, 2014, at 3:58 AM, yangleir <[email protected]> wrote:
>>>
>>> Dear GMT users,
>>>>
>>>> When I convert the PS format figure containing Chinese characters to
>>>> other format like PNG or TIF, there is a error:
>>>>
>>>> Error: /invalidfileaccess in /findfont
>>>> Operand stack:
>>>> 167 STSong-Light--GB-EUC-H
>>>> Execution stack:
>>>> %interp_exit .runexec2 --nostringval-- --nostringval--
>>>> --nostringval-- 2 %stopped_push --nostringval-- --nostringval--
>>>> --nostringval-- false 1 %stopped_push 1932 1 3 %oparray_pop
>>>> 1931 1 3 %oparray_pop 1915 1 3 %oparray_pop 1803 1 3
>>>> %oparray_pop --nostringval-- %errorexec_pop .runexec2
>>>> --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push
>>>> --nostringval-- --nostringval-- 1884 2 4 %oparray_pop
>>>> Dictionary stack:
>>>> --dict:1170/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)--
>>>> --dict:148/250(L)--
>>>> Current allocation mode is local
>>>> Current file position is 17236
>>>> It implys that this error is related to 'STSong-Light--GB-EUC-H' which
>>>> is a kind of Chinese font. But I have no idea how to fix it.
>>>> Would anyone please give some help?
>>>>
>>>> PS: I use Window 7+GMT5.1.0
>>>>
>>>> Lei Yang
>>>> 2014-03-26
>>>>
>>>
>>>
>>> To unsubscribe, send the message "signoff gmt-help" to
>>> [email protected]
>>>
>>>
>>
>>
>> --
>> Eduardo A. Suarez
>> Facultad de Ciencias Astronómicas y Geofísicas - UNLP
>> FCAG: (0221)-4236593 int. 172/Cel: (0221)-15-4557542/Casa: (0221)-4526589
>>
>>
>> ----------------------------------------------------------------
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>> To unsubscribe, send the message "signoff gmt-help" to
>> [email protected]
>>
>
> To unsubscribe, send the message "signoff gmt-help" to
> [email protected]
>
To unsubscribe, send the message "signoff gmt-help" to [email protected]
image.png
(image/png, 7.2 KB) - not displayed