Bug #530

ps2raster error when using Chinese characters

Added by Remko about 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:2014-03-27
Priority:NormalDue date:
Assignee:Remko% Done:

0%

Category:-
Target version:Candidate for next bugfix release
Affected version:5.1.x Platform:

Description

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

History

#1 Updated by Remko about 3 years ago

  • Status changed from New to Resolved

You were absolutely right that the option for ghostscript "-sFONTPATH=C:\Windows\Fonts" was not used when determining the BoundingBox first (when the -A option is used). So indeed, this resulted in the failure.

Fixed in r13013

#2 Updated by Paul about 3 years ago

  • Status changed from Resolved to Closed

Close as fixed.

Also available in: Atom PDF