Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This may be an off-topic fringe case, but I need it for pdftex...

I made an encoding QS7 for ASCII+Greek and now the only thing missing is a CMAP file to enable copying text from acroread.

I made the following file qs7.cmap by trying to mimic the other ones in the cmap package but as this has to be proper PostScript (which I know nothing about), there are probably a million things I can have done wrong without even noticing.

%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-QS7-0)
%%Title: (TeX-QS7-0 TeX QS7 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (QS7)
/Supplement 0
>> def
/CMapName /TeX-QS7-0 def
/CMapType 2 def
1 begincodespacerange
<00> <FF>
endcodespacerange
64 beginbfchar
<00> <0060>
<01> <00B4>
<02> <02C6>
<03> <02DC>
<04> <00A8>
<05> <02DD>
<06> <02DA>
<07> <02C7>
<08> <02D8>
<09> <00AF>
<0A> <02D9>
<0B> <00B8>
<0C> <02DB>
<0D> <201A>
<0E> <2039>
<0F> <203A>
<10> <201C>
<11> <201D>
<12> <201E>
<13> <00AB>
<14> <00BB>
<15> <2013>
<16> <2014>
<17> <200B>
<19> <0131>
<1A> <0237>
<1B> <FB00>
<1C> <FB01>
<1D> <FB02>
<1E> <FB03>
<1F> <FB04>
<20> <2423>
<21> <0021>
<22> <0022>
<23> <0023>
<24> <0024>
<25> <0025>
<26> <0026>
<27> <2019>
<28> <0028>
<29> <0029>
<2A> <002A>
<2B> <002B>
<2C> <002C>
<2D> <002D>
<2E> <002E>
<2F> <002F>
<30> <0030>
<31> <0031>
<32> <0032>
<33> <0033>
<34> <0034>
<35> <0035>
<36> <0036>
<37> <0037>
<38> <0038>
<39> <0039>
<3A> <003A>
<3B> <003B>
<3C> <003C>
<3D> <003D>
<3E> <003E>
<3F> <003F>
<40> <0040>
endbfchar
64 beginbfchar
<41> <0041>
<42> <0042>
<43> <0043>
<44> <0044>
<45> <0045>
<46> <0046>
<47> <0047>
<48> <0048>
<49> <0049>
<4A> <004A>
<4B> <004B>
<4C> <004C>
<4D> <004D>
<4E> <004E>
<4F> <004F>
<50> <0050>
<51> <0051>
<52> <0052>
<53> <0053>
<54> <0054>
<55> <0055>
<56> <0056>
<57> <0057>
<58> <0058>
<59> <0059>
<5A> <005A>
<5B> <005B>
<5C> <005C>
<5D> <005D>
<5E> <005E>
<5F> <005F>
<60> <2018>
<61> <0061>
<62> <0062>
<63> <0063>
<64> <0064>
<65> <0065>
<66> <0066>
<67> <0067>
<68> <0068>
<69> <0069>
<6A> <006A>
<6B> <006B>
<6C> <006C>
<6D> <006D>
<6E> <006E>
<6F> <006F>
<70> <0070>
<71> <0071>
<72> <0072>
<73> <0073>
<74> <0074>
<75> <0075>
<76> <0076>
<77> <0077>
<78> <0078>
<79> <0079>
<7A> <007A>
<7B> <007B>
<7C> <007C>
<7D> <007D>
<7E> <007E>
<7F> <002D>
<80> <00A1>
endbfchar
64 beginbfchar
<81> <00BF>
<82> <20AC>
<83> <20AF>
<84> <00A6>
<85> <00A7>
<86> <037E>
<87> <00A9>
<88> <037A>
<89> <0387>
<8A> <00AC>
<8B> <00AD>
<8C> <2015>
<8D> <00B0>
<8E> <00B1>
<8F> <00B2>
<90> <00B3>
<91> <0384>
<92> <0385>
<93> <0374>
<94> <0375>
<95> <0386>
<96> <00B7>
<97> <0388>
<98> <0389>
<9E> <03AD>
<9F> <038C>
<A0> <03AE>
<A1> <03AF>
<A2> <0390>
<BD> <00BD>
<BE> <038E>
<BF> <038F>
<C0> <038A>
<C1> <0391>
<C2> <0392>
<C3> <0393>
<C4> <0394>
<C5> <0395>
<C6> <0396>
<C7> <0397>
<C8> <0398>
<C9> <0399>
<CA> <039A>
<CB> <039B>
<CC> <039C>
<CD> <039D>
<CE> <039E>
<CF> <039F>
<D0> <03A0>
<D1> <03A1>
<D3> <03A3>
<D4> <03A4>
<D5> <03A5>
<D6> <03A6>
<D7> <03A7>
<D8> <03A8>
<D9> <03A9>
<DA> <03AA>
<DB> <03AB>
<E0> <03B0>
<E1> <03B1>
<E2> <03B2>
<E3> <03B3>
<E4> <03B4>
endbfchar
27 beginbfchar
<E5> <03B5>
<E6> <03B6>
<E7> <03B7>
<E8> <03B8>
<E9> <03B9>
<EA> <03BA>
<EB> <03BB>
<EC> <03BC>
<ED> <03BD>
<EE> <03BE>
<EF> <03BF>
<F0> <03C0>
<F1> <03C1>
<F2> <03C2>
<F3> <03C3>
<F4> <03C4>
<F5> <03C5>
<F6> <03C6>
<F7> <03C7>
<F8> <03C8>
<F9> <03C9>
<FA> <03CA>
<FB> <03CB>
<FC> <03CC>
<FD> <03CD>
<FE> <03CE>
<FF> <03AC>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF

The only indication I have that it didn't work is that when copying greek text it comes out as rubbish.

The file is loaded

[3<<t1.cmap>><<t2a.cmap>><<qs7.cmap>>]

together with T2A, and copying russian text works like a charm. So I suspect the problem lies in the file.

Is there any way of debugging this? Can I get a spelled-out error message?

Is there anything (apart from putting the file in the right place) I need to configure?

Obviously, I'm using the cmap package for this.

If there is any other .SX site where this would be more appropriate, please advise.

share|improve this question
    
@egreg did you infer this from the numbers in front? Some characters are missing, for instance <18> which is "perthousandzero" and doesn't seem to have a unicode point. Same with t1.cmap. I counted again, it's 64. –  Stephan Lehmke Apr 18 '12 at 16:17
1  
@LevBishop Wow, now this is embarassing. I didn't know this at all. That's the solution, obviously. If you turn this comment into an answer, I will accept it. –  Stephan Lehmke Apr 18 '12 at 20:50
add comment

1 Answer

up vote 6 down vote accepted

Rather than using the cmap package, you could use the pdftex built in functionality:

\input glyphtounicode.tex 
\input glyphtounicode-cmr.tex 
\pdfgentounicode=1 

This doesn't rely on the tex encoding so it should work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.