| <<<Back 1 day (to 2018/01/31) | 20180201 |
Thomas___ | Hi | 14:07.21 |
ghostbot | Welcome to #ghostscript. If you have a question, please ask it, don't ask to ask it. Do be prepared to wait for a reply as devs will check the logs and reply when they come on line. If you are looking for help or infomation about MuPDF, try the new #mupdf channel. | 14:07.21 |
Thomas___ | i'm trying to convert an eps file into a svg one (with ghostscript oc and inkscape) | 14:07.52 |
| in my eps file, i've got a '\306' character code, which stand for a U+0306 unicode character. | 14:08.24 |
kens | Let me guess, you are THomas Grockowiak ? | 14:09.06 |
| ASked the same question on Stack Overflow, and I answered it there | 14:09.16 |
Thomas___ | Oh | 14:09.16 |
| yes, that's true | 14:09.27 |
| and you answer was more or less correct | 14:09.34 |
| No probleme with the font here, juste that Ghostscript take it as an ISO-8859-1 and not as an unicode | 14:10.22 |
kens | Nothing to do with Ghostscript | 14:10.47 |
| As I said in my answer, using a TrueType font as a substitute for a missing font is essentially an exercise in guesswork. | 14:11.10 |
| The character code is not 'Unicode', its just a character code | 14:11.23 |
| Grr stupid underlin... | 14:11.31 |
| Anyway, PostScript has no concept of code pages, or Unicode, or anythign else. | 14:11.47 |
| Character codes are mapped to glyph names using internal PostScript machinery, the Encoding array. | 14:12.07 |
| In the absence of a font, we cannot reliably know what glyph name the character code maps to (unless there is an Encoding, even though the font is missing) | 14:12.35 |
| The situation is even worse when the font is a TrueType font, as many TrueType fonts lack a POST table, which is used to map PostScript glyph names to TrueType GIDs | 14:13.19 |
| So in the absence of all this information, Ghostscript tries its best. | 14:13.31 |
| But its essentially guessing, so as I said, Your Mileage My Vary | 14:13.45 |
| The correct way to deal with this situation is to embed the font in the original EPS | 14:14.02 |
| If you want to post the EPS somewhere that we can look at it I'll take a quick look, but I strongly suspect all I'll be able to say is 'yep, that's what happens when you don't embed fonts' | 14:15.35 |
Thomas___ | the font isn't embed as expected | 14:17.07 |
| We use an external soft call Mathtype to write math formula into eps | 14:17.22 |
| We unfortinatly cannot tell MathType to embed font in eps files | 14:17.45 |
kens | Then I suggest you complain to the people behind MathType, because that's just pants | 14:18.04 |
| It practically guarantees the wrong answer in many cases. | 14:18.19 |
| According to a quickj Google search, MathType can embed fonts | 14:18.58 |
| Hmm, but that appears to be for Office documents | 14:19.53 |
Thomas___ | Yes, I've read the mathtype tutorial for that but was unable to achieve font embeding | 14:22.05 |
kens | It seems that MathType doesn't ever embed fonts | 14:22.18 |
| It just expects you to configure the consumer. | 14:22.37 |
| And that, frankly, is just poor | 14:22.43 |
| I'd complain personally | 14:23.06 |
| If you paid for it | 14:23.12 |
| As I mentioned before, if you post the EPS somerwhere I'll take a look but I can't promise anything at all. | 14:24.31 |
| The problem occurs at the point the EPS is created without the fotns, especially if the fonts are TrueType fonts. | 14:24.55 |
chrisl | This is using a *font*? Not a CIDFont? | 14:28.34 |
kens | I believe so, but in the absence of a file to look at, hard to say | 14:28.59 |
chrisl | Hard to see how character code 0x306 is ever going to work.... | 14:29.39 |
kens | That's octal 306 | 14:30.07 |
| 0xC6 | 14:30.26 |
chrisl | Oh, doh | 14:30.37 |
Thomas___ | the niput file is here | 14:33.11 |
| https://pastebin.com/ZFyWnq6Z | 14:33.11 |
| wrong file | 14:33.24 |
kens | That file doesn't seem to use Arial | 14:34.07 |
| Cambria and SymbolMT | 14:34.17 |
Thomas___ | https://pastebin.com/zwDNFs0N | 14:34.33 |
| Yes, Cambria and symbol here | 14:34.40 |
| Isn't embed | 14:34.49 |
kens | It would help keep things sensible if we could always discuss the same problem. | 14:35.08 |
| Even if we can tell you how to make Cambria work, it may well not be applicable to Arial. | 14:35.27 |
| The bottom line is you can't just use TrueType fonts willy nilly and hope they will work in PostScript, because PostScript only supports TrueType when the font is a type 42 font. | 14:36.03 |
| Which is all the data from a TrueType font *PLUS* the extra information needed to make it work in PostScript. | 14:36.24 |
| When you use a TrueType font without that extra information then we need to try and guess, and that's where things go wrong. | 14:36.46 |
Thomas___ | ok | 14:37.14 |
kens | First thing to point out is that in PostScript (\306) isn't a hex number, as I just said a minute ago, its an octal number | 14:37.19 |
Thomas___ | I'm gonna look to translate my ttf to type 42 then | 14:37.25 |
kens | That's not really a viable option | 14:38.00 |
| Type 42 is only really usable in PostScript. | 14:38.14 |
| I don't know what glyph the charactre code (\306) is meant to be. I'm in the same position as Ghostscript here, there is no way to tell | 14:39.37 |
Thomas___ | As I look further, I think I have multiple problems. One with ghostscript(With my font), and one with mathtype | 14:40.53 |
kens | Personally I'd say the font problem is also a MatyType problem | 14:41.28 |
| What is this glyph *expected* to be ? | 14:41.37 |
Thomas___ | I will take one at a time, asking MathType support for their help to embed fnot in the eps | 14:41.41 |
| I think that will also help ghostscript work in a better way | 14:41.55 |
kens | I expect MathType will tell you to use Adobe Acrobat Distiller :-) | 14:42.04 |
Thomas___ | That should be ^ | 14:42.10 |
kens | But yes, if you can get them to embed the font as a type 42, that will work | 14:42.17 |
| caret, hmmm. | 14:42.27 |
| Crazy scale factors in the file | 14:43.46 |
| I can''t immediately see any way for Ghostscript to know that 0xC6 (\306) is supposed to be a caret. In ISOLatin1 its an AE, Cacute in CE and breve in StandardEncoding, which is what it looks like we are using. I think using StandardEncoding is reasonable. | 14:48.18 |
chrisl | IIRC, the base encoding we use when loading a TTF depends on the contents of the TTF.... | 14:49.03 |
kens | I'm just dumping the TTF now | 14:49.14 |
| I need to find it first.... | 14:49.20 |
Thomas___ | yes, that's why I said I think MathType also has a problem | 14:49.29 |
chrisl | That might be only for PDF, though | 14:49.32 |
kens | Oh its a TrueType collection | 14:49.43 |
| Just to confuse the issue further | 14:49.58 |
Thomas___ | But, when Cambria wasn't installed on unix, Ghostscript print U+0306 (aka Breve) | 14:50.01 |
kens | Yes a breve is what I'm seeing, since I don't have the font installed in Ghostscript | 14:50.23 |
| As chrisl just said, what you actually get depends on the content of the font, which I'm wrking on now | 14:50.44 |
| But its actually a TrueType Collection, so it includes *2* fonts | 14:50.59 |
Thomas___ | Cambria and Cambria Math, right | 14:51.15 |
| I've found a standalone Cambria but it didn't change anything | 14:51.28 |
kens | I suspect Ghostscript is only using index 1 for the font, threfore Cambria-Regular | 14:51.50 |
| Format 3 POST tabel, so no PostScript names for any of the glyphs | 14:52.28 |
chrisl | I'd forgotten how convoluted that Ghostscript code is! | 14:53.43 |
kens | Well its trying to do a non-trivial task | 14:54.06 |
| Sigh the output from ttfdump is 30MB | 14:54.19 |
| So 0xC6 maps to GID 40 | 14:55.59 |
| chrisl can you tell which GID Ghostscript is using ? | 14:56.45 |
chrisl | I'd have to debug through FAPI | 14:57.14 |
kens | I was hoping to avoid that | 14:57.27 |
Thomas___ | Don't worry | 14:57.43 |
| I will look with mathtype support, With some luck, they will be able to help me embed the font in the eps, resolving my problems | 14:58.10 |
| don't lost too much time with my problem | 14:58.28 |
kens | I just used Adobe Acrobat Distiller to create a PDF fiel, and it too shows the character as a Breve | 14:58.52 |
| And Distiller has embedded the actual TrueType fotn from disk | 14:59.23 |
chrisl | I guess it doesn't consider it a substitute | 15:00.19 |
kens | Well Distiller knows hte font is on disk | 15:00.53 |
| When we have the font in fotnmap.GS we produce an AE glyph instead of a breve | 15:01.09 |
| So we think its ISOLatin1 not StandardEncoding | 15:01.34 |
chrisl | So, no post table, but a 3.1 cmap table? | 15:02.02 |
kens | At which point I'm going to give up and say 'yep, need to embed teh font really' | 15:02.04 |
| yes thre's a 3,1 CMAP | 15:02.12 |
| I think also a 3,0. There are 3 CMAP tables in all | 15:02.25 |
chrisl | If there's a 3.1 cmap we use (or at least, start with) ISOLatin1Encoding | 15:03.08 |
kens | Well I guess that would probably explain it. Like I said, when we start using TrueType fotns as substitutes for missing fonts, then its all guesswork | 15:03.36 |
chrisl | Thomas___: if you don't get any joy from mathtype, let us know, and if I have time, I'll look at it a bit more | 15:06.08 |
| kens: Trivial commit, but unless I'm missing something...... http://git.ghostscript.com/?p=user/chrisl/ghostpdl.git;a=commitdiff;h=f52a7ccf96f1b9bb90194ba1dd6a50040dd63896 | 15:06.59 |
kens | WEell that does seem a lot more sensible | 15:07.20 |
chrisl | I thought so! | 15:07.44 |
kens | Its probably historical, good to fix it | 15:07.58 |
Thomas___ | Ok, I will keep you in touch | 15:09.12 |
| thanks for your time! | 15:09.16 |
kens | NP good luck with it | 15:09.51 |
| Forward 1 day (to 2018/02/02)>>> | |