Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2017/01/05)20170106 
bencc1 how do I list the fonts in eps file?11:26.03 
chrisl bencc1: read the Postscript11:38.46 
bencc1 chrisl: I see it now in the .eps file. thought there is a command line to get a list of fonts11:42.13 
  chrisl: are the fonts embedded?11:42.20 
chrisl bencc1: we have a utility which, amongst other things, lists fonts in a PDF, but not for Postscript.11:43.17 
  I can't tell if the fonts are embedded, I can't see the file11:43.50 
  bencc1: You could convert it to PDF, and run the utility (pdf_info.ps) on the resulting PDF11:44.50 
bencc1 chrisl: https://drive.google.com/open?id=0B12AhxvnYHrAVUUwVndqVklvYU011:54.02 
  this is the eps file11:54.05 
  let me explain what I'm trying to do:11:54.11 
  I have emf file with non free fonts11:54.26 
  I'm converting to eps with the fonts11:54.37 
  now I would like to replace the non-free fonts with free fonts11:55.48 
  possible?11:55.51 
chrisl Unlikely11:56.07 
bencc1 why not?11:56.53 
  the David font is embedded in the eps I shared above?11:57.09 
  how can I check?11:57.12 
chrisl How much do you know about Postscript and fonts?11:57.18 
  Yes, font is embedded in the EPS11:58.15 
bencc1 I don't know anything :)11:58.27 
  how can I tell that it is embedded?11:58.37 
chrisl Well, without really understanding Postscript, you're going to struggle to be *sure*, in general. But in this case, if you open the EPS in a text editor, and look around line 48 you can see the definition of the font11:59.58 
bencc1 looking12:01.44 
chrisl The problem with replacing the font with another one comes from the "Encoding" definition, which dictates the mapping from a character to an actual glyph outline. In this case, the Encoding appears to be a custom one12:02.21 
bencc1 it says: /FontName /David def12:02.34 
  I wasn't able to replace a font in the original EMF12:03.13 
chrisl Yes, so those lines with /FontName, /Encoding, /PaintType, /FontMatrix etc are all things required to define a valid font12:03.33 
bencc1 EMF probably point to a specific glyph in the font file12:03.34 
chrisl Can you convert the EMF to EPS *without* embedding the font?12:04.00 
bencc1 chrisl: I don't know. I'm using this: https://wiki.lyx.org/Windows/MetafileToEPSConverter12:04.22 
chrisl I know nothing about that, sorry12:05.33 
  bencc1: what is the end result you need?12:05.53 
bencc1 chrisl: EMF with non-free fonts -> EPS/SVG/PDF with free fonts12:06.35 
chrisl Well, there is no sure way to have that work12:07.09 
  If you just need EMF with non-free fonts -> EPS/SVG/PDF without non-free fonts then there could be a solution.12:07.50 
bencc1 how?12:08.14 
chrisl If you have a recent version of Ghostscript you can convert the EPS to PDF with pdfwrite and use the -dNoOutputFonts option, and you'll get a PDF with the text degenerated into normal marking operations12:10.04 
bencc1 interesting12:10.52 
  let me try12:11.03 
chrisl Depending on the content, the result maybe a larger and a bit slower to render (using fonts allows optimisations, hence why they're used), but it works around issues like this12:11.25 
bencc1 with the ps2pdf command?12:11.39 
chrisl It's generally preferable to run Ghostscript explicitly12:12.38 
  bencc1: actually, look at the way your EPS is constructed, there really is *no* chance of replacing the embedded font with another one12:13.42 
  s/look/looking12:13.49 
bencc1 chrisl: why?12:14.47 
  gs -sDEVICE=pdfwrite -dNoOutputFonts -o david.pdf david.eps12:15.43 
  this seems to remove the David font from the pdf12:15.53 
  maybe it just convert the font to paths?12:16.13 
chrisl I *think* it converts to vectors - I wasn't *sure* it didn't render to bitmaps, hence why I hedged a bit12:16.50 
bencc1 so it's not what I'm looking for12:17.40 
chrisl As to why replacing the embedded font will never work: again, unless you know Postscript, it may not make sense to you, but the file uses the "glyphshow" operator to directly render specific glyph names from the font - glyph names are *specific* to this font.12:17.49 
bencc1 no way to translate glyph names between two fonts?12:19.08 
  maybe using a map?12:19.14 
chrisl You could do that, in Postscript12:19.57 
bencc1 I need to generate the map myself?12:20.39 
  or does Postscript has utils to do it?12:20.51 
chrisl You have to do it yourself. You need to know what each glyph name in the current font means, and what the equivalent name is in the alternative font is12:21.36 
bencc1 ok12:22.07 
chrisl BTW, what type of font is the original?12:22.50 
bencc1 David12:24.03 
  I don't mind buying it but the license is weird12:24.19 
  not practical12:24.26 
  there is david libre but the size is not the same12:24.40 
chrisl That's not a font type - truetype, OTF, Type 1, etc?12:24.42 
bencc1 this is the original12:24.55 
  https://www.microsoft.com/typography/fonts/family.aspx?FID=23412:24.56 
  ttf12:24.58 
  truetype12:25.03 
chrisl Well, it's been converted to Type 1 in the EPS, and any license or copyright info dropped - which isn't terribly good12:26.30 
bencc1 there must be a way to replace the font12:30.08 
  must be a way to replace equivalent glyphs in two fonts12:30.32 
chrisl There may be ways, if you know enough, and have enough time.12:31.50 
bencc1 I will invest the needed time12:32.42 
  I just need a starting point12:34.50 
chrisl Well, you need to remove the definition of the font from the EPS, then remove all the inline glyph definitions. Then change the EPS to load your alternate font, then change each original glyph name to the glyph name appropriate for the new font12:35.52 
bencc1 thanks12:36.12 
  the hardest part might be to translate the glyph names12:36.23 
chrisl That is certainly the most labour intensive part. And of course, this only works for this font in this file.12:37.12 
  Here's a thought: AIUI, an EMF doesn't contain a font, just a reference to a font (or font file). It might be easier to address this at the EMF stage, rather than the EPS stage12:38.53 
bencc1 chrisl: I think that EMF point the a glyph by index in the font (not sure)12:41.37 
  in that case replace the font in EMF won't be easy12:41.38 
  if I'm removing David.ttf from Windows and opening the original EMF file, I see random symbols12:42.10 
  instead of a nice font substitution12:42.17 
chrisl What if you replace David.ttf with your intended substitute?12:42.36 
bencc1 how?12:42.50 
chrisl Rename the file12:42.59 
bencc1 just renaming the file name will do nothing12:43.02 
  I tried renaming the font in with ttx. still wrong symbols12:43.25 
  EMF use symbol index. the replacement has different index for the same symbol12:43.55 
chrisl Ah, well, no chance12:44.19 
bencc1 https://fonts.google.com/specimen/David+Libre12:44.25 
  that's what I was trying as a replacement12:44.34 
chrisl Basically, this is case of: "if you want to get there, don't start from here"12:45.54 
bencc1 not sure I understand :)12:47.24 
chrisl The right way to do this is to get the original document, and change the font in that.12:47.55 
bencc1 in EMF?12:48.33 
  for me the original is EMF12:48.47 
  I don't have access to anything else12:48.53 
chrisl No, the EMF is *not* the original document12:49.12 
bencc1 I know but that's the best I have12:50.36 
  I have EMF in PowerPoint12:50.45 
  when embedding fonts in PowerPoint it doesn't embed EMF fonts12:50.59 
  otherwise I could just use the embedded font which is ok in terms of license12:51.15 
  I'm trying to see where is the actual code in http://wiki.lyx.org/uploads/Windows/metafile2eps/metafile2eps-source.zip12:51.29 
  but I don't understand what actually changes emf to eps12:51.48 
  maybe it just "print" the file?12:51.55 
chrisl I think it does just that, yes12:52.06 
bencc1 so I probably can't tell the printer to use a different font12:53.13 
  it will still get confused by the glyph index12:53.27 
chrisl Yes12:53.40 
 Forward 1 day (to 2017/01/07)>>> 
ghostscript.com
Search: