[NTG-pdftex] [PATCH v4] Allow .enc files for bitmap PK fonts

Hans Hagen pragma at wxs.nl
Mon Dec 18 15:46:13 CET 2017


On 12/18/2017 1:37 PM, Pali Rohár wrote:
> On Monday 18 December 2017 13:11:20 Hans Hagen wrote:
>>> Anyway, exactly same problem is for Type 1 fonts. If you have two
>>> different shapes for b in Type 1 font, then only one can have glyph name
>>> 'b'.
>>
>> i've never seen a type 1 font with two 'same names' for different shapes ...
>> it would qualify as 'a font to avoid'
> 
> Yes, two 'same names' for different shapes is not something which is
> supported in Type1 (and maybe it is not possible... have not looked at
> specification in details).
> 
> But... I mean this: how to handle situation if you create font in which
> there are two different shapes for character 'b' and you want to store
> this font in Type1 format? You need to choose something like b.variant1
> and b.variant2...

indeed, and given that both are named 'b' you can use that as prefix ... 
it doesn't matter what the suffix(es) are

> I mean in context of pdftex. What should pdftex do if its gets such enc
> file on input?

probably what it does now (ok, it could complain that it has two b's but 
if these two b's refer to the same type 1 font program (glyph sub) then 
it's quite ok and one can remap the second one onto the first ... but 
actually one might wonder if the front end code should be fixed i.e. who 
can guarantee that the matching tfm file is ok? Two variants in a simple 
font (t3 / 8bit type1) are quite confusing anyway.

> Yes, proper way is to fix enc file. I think we have no doubts about it.
> 
> But the whole discussion is... what should pdftex do if user puts such
> buggy enc file for particular font?

complain and quit

>> Makes me wonder how these
>> bad enc files can show up at all, as those type 3 fonts are very old school
>> and therefore the problem of duplicate names for different shaped should
>> also have been seen with dvips and so.
> 
> Personally, I do not know how many enc files contains duplicates and
> even if they are any widely used.

ok, so actually there not a problem

> For pdftex patches, I specially prepared different enc files to test
> that pdftex with my patches does not crash (either print fatal warning
> or produce PDF) and that I always get PDF file rendered in same way as
> enc files must not affect how PDF file is rendered. And I observed
> problem when enc file contain one glyph name more times, therefore I
> added that code which deals with duplicates.

well, if you apply that patch, then at least let pdftex complain very 
loud on the console and in the log that the resulting pdf is probably 
bugged (even with the patch) due to conflicts in the encoding

(i don't mind that much about a patch because i don't use pdftex so i'm 
unlikely to be a victim of such a bad font .. so in the end it's karl 
who has to agree)

Hans


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-pdftex mailing list