Author Topic: Adding fonts to be used by Ghostscript  (Read 14657 times)

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Adding fonts to be used by Ghostscript
« on: August 03, 2014, 07:41:51 pm »
I have a manual in PDF form that will not display the diagrams because they have a Japanese font as well as an English embedded in them.

Is it possible to add an available Japanese font (MsMincho.TTC) and map it to Shingo-medium?  Alternately, does anyone have Shingo-medium as a true type font and where did you get it?

Alex Taylor

  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +5/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #1 on: August 04, 2014, 03:31:14 am »
This might work but I'm not 100% sure.
In the gs\gs-whatever\lib directory, copy the sample file FAPIcidfmap to cidfmap, then add some lines similar to the following at the end:
Code: [Select]
/MS-Mincho  << /FileType /TrueType /Path (C:/PSFONTS/msmincho.ttc) /SubfontID 0 /CSI [(Japan1) 3] >> ;
/MS-PMincho << /FileType /TrueType /Path (C:/PSFONTS/msmincho.ttc) /SubfontID 1 /CSI [(Japan1) 3] >> ;
Obviously, change the file paths as appropriate.  That should allow GS to map the font names 'MS-Mincho' and 'MS-PMincho' to the TTC file.

Then you might be able to add an alias for 'Shingo-medium' to 'MS-Mincho' in the file fontmap.  I've never tried that, though.
A more brute-force approach in cidfmap might be possible as well:
Code: [Select]
/Shingo-medium  << /FileType /TrueType /Path (C:/PSFONTS/msmincho.ttc) /SubfontID 0 /CSI [(Japan1) 3] >> ;
Again, I have tested none of this.

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #2 on: August 04, 2014, 01:57:17 pm »
Thanks Alex.  I will give it a try when I get home tonight.

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #3 on: September 03, 2014, 10:27:31 pm »
Just a quick update.  It almost works - by that I mean that the majority of the pages now display and show both the English and Japanese.  The odd pages that don't have, I assume, some Japanese glifs that are not in the font I have.

Thanks Alex.

Alex Taylor

  • Sr. Member
  • ****
  • Posts: 387
  • Karma: +5/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #4 on: September 04, 2014, 01:11:26 pm »
Good to hear!

By the way, if you're not set on using Ghostscript, Lucide can also be configured to support Japanese font fallback.  You just have to install the poppler-data addon pack in the Lucide directory: https://drive.google.com/file/d/0B_CmLQmhb3PzT3p2UDFLREJPVTg/edit?usp=sharing

Silvan Scherrer

  • Full Member
  • ***
  • Posts: 200
  • Karma: +1/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #5 on: September 04, 2014, 02:09:04 pm »
and don't forget to test Qpdfview. The poppler-data stuff relies there as well of course.
kind regards
Silvan
CTO bww bitwise works GmbH

Please help us with donations, so we can further work on OS/2 based projects. Our Shop is at https://www.bitwiseworks.com/shop/index.php

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #6 on: September 04, 2014, 09:40:59 pm »
Thanks Alex.  That works for all pages.

Attached a couple of screen grabs - lucide and qpdfview

guzzi

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +0/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #7 on: September 04, 2014, 11:16:17 pm »
Interesting.Not because of the font issue, but the solder thing) I have never used anything but lead solder, and never had to repair a 'modern' circuit with lead free solder. Looks like I'll have to buy a new soldering station with thermostatic temperature control and 3 different kinds of lead free solder for future repairs. Not that  I actually do a lot of repair work these days, all that SMD stuff is just too tiny, and hey, it's mostly cheaper to buy new then buy parts....

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #8 on: September 04, 2014, 11:38:05 pm »
Guzzi, as you can see we do quite a number of repairs on equipment, much of which has SMT parts (who throws away equipment worth several thousand euros if it can be repaired for less than replacement cost).  I do admit to us having several binocular magnifying units (not quite microscopes) out in the repair section and, believe it or not, we still use out Litesold control units from the 80s although it is now almost impossible to get replacement parts for the irons themselves.

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #9 on: September 05, 2014, 09:40:56 pm »
Cool you repair such Yamahas. The are definetely worth to repair. Although i wonder such 'new' devices even fail :) To bad i can't find new volume and input selectors for my DSP-A3080. Do you have any source?

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #10 on: September 05, 2014, 10:20:02 pm »
Hi Andi,

New equipment usually fails because the design engineer didn't take into consideration all situations where it could be used and then the parts procurement department always tend to go for the cheapest components that fit the specification.  Then when standard condition are missed - used at full power in a very hot environment small components tend to stop working.

To start looking for replacement parts for your unit you would need to know who the OEM was of each component and their part number.  Once you know that you go to Radio Spares (RS), Farnell or other major component suppliers depending on where you live and have a business account.  If we have time next week I will ask my parts girl to see if she can find out anything but, please, don't hold your breath. ;)     

Andi B.

  • Hero Member
  • *****
  • Posts: 811
  • Karma: +11/-2
    • View Profile
OT: Yamaha spare Parts (Re: Adding fonts to be used by Ghostscript)
« Reply #11 on: September 06, 2014, 10:03:42 pm »
These are from Alps but could not be delivered from any channel I know :( I even know the part numbers as I do have the service manual. Best offer I got was for the volume control for a horrible price but without a new input selector it's not of much use.

ivan

  • Hero Member
  • *****
  • Posts: 1557
  • Karma: +17/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #12 on: September 06, 2014, 10:20:40 pm »
And there you see the problems.  Most components can be obtained if you are prepared to pay the minimum/quantity price.  In many ways we get round that by ordering a wide range of components from the OEM but in some cases we have to say 'sorry, no can do'.   

guzzi

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +0/-0
    • View Profile
Re: Adding fonts to be used by Ghostscript
« Reply #13 on: September 06, 2014, 10:45:32 pm »
Or go through a distributor. Doesn't work foe specially made parts though. www.mouser.com has a lot of Alps items, but no doubt you have already checked them out.