<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18975">
<STYLE></STYLE>
</HEAD>
<BODY 
style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space" 
bgColor=#ffffff>
<DIV><FONT face="Arial Unicode MS">Oh dear - I don't use these packages at all 
so won't be of much help.  Do you have to create a TOC entry in the body of 
your text, with a command such as \toc{<FONT 
face="Times New Roman">L'incertitude</FONT>}?  If so, you might get away 
with \toc{<FONT face="Times New Roman">L\noexpand 'incertitude</FONT>}.  
But this will mess things up if </FONT><FONT 
face="Times New Roman">L'incertitude has also to be typeset in the main text at 
this point - and it may not work anyway.</FONT></DIV>
<DIV><FONT face="Arial Unicode MS"></FONT> </DIV>
<DIV><FONT face="Arial Unicode MS">If you get a UTF file of your table of 
contents, you could simply do a global search-and-replace, altering </FONT><FONT 
face="Times New Roman">"2019 to the apostrophe - but if all that is done in the 
background and the package produces a finalized table of contents (as a PDF) 
then you have no chance to intervene.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Arial Unicode MS">Sorry if my suggestions have got you into 
difficulties.   You could always revert to what you were doing before 
and ask the supporters of the various packages you use to help you out.  
</FONT></DIV>
<DIV><FONT face="Arial Unicode MS"></FONT> </DIV>
<DIV><FONT face="Arial Unicode MS"></FONT> </DIV>
<DIV><FONT face="Arial Unicode MS">John</FONT></DIV>
<DIV><FONT face="Arial Unicode MS"></FONT> </DIV>
<DIV><FONT face="Arial Unicode MS"></FONT> </DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=pier.morel@gmail.com href="mailto:pier.morel@gmail.com">Pierre 
  Morel</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=xetex@tug.org 
  href="mailto:xetex@tug.org">Unicode-based TeX for Mac OS X and other 
  platforms</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> 01 November 2010 09:46</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [XeTeX] Several 
  apostrophe-related problems (kerning, mapping)</DIV>
  <DIV><FONT face="Arial Unicode MS"></FONT><FONT 
  face="Arial Unicode MS"></FONT><FONT 
  face="Arial Unicode MS"></FONT><BR></DIV>Ouch, I thought everything was 
  solved... but now there is a problem in the PDF TOC generated by hyperref.
  <DIV>Basically, instead of having</DIV>
  <DIV><SPAN style="WHITE-SPACE: pre" 
  class=Apple-tab-span></SPAN>L'incertitude</DIV>
  <DIV>I get:</DIV>
  <DIV><SPAN style="WHITE-SPACE: pre" 
  class=Apple-tab-span></SPAN>L"2019incertitude</DIV>
  <DIV><BR></DIV>
  <DIV>...not very nice.</DIV>
  <DIV>Hyperref produces some warnings:</DIV>
  <DIV><BR></DIV>
  <DIV>
  <DIV style="MARGIN: 0px; FONT: 10px Monaco">Package hyperref Warning: Token 
  not allowed in a PDF string (Unicode):</DIV>
  <DIV style="MARGIN: 0px; FONT: 10px Monaco">(hyperref)      
            \kern 0.00003pt</DIV>
  <DIV style="MARGIN: 0px; FONT: 10px Monaco">(hyperref)      
            removed on input line 308.</DIV>
  <DIV style="MARGIN: 0px; MIN-HEIGHT: 14px; FONT: 10px Monaco"><BR></DIV>
  <DIV style="MARGIN: 0px; MIN-HEIGHT: 14px; FONT: 10px Monaco"><BR></DIV>
  <DIV style="MARGIN: 0px; FONT: 10px Monaco">Package hyperref Warning: Token 
  not allowed in a PDF string (Unicode):</DIV>
  <DIV style="MARGIN: 0px; FONT: 10px Monaco">(hyperref)      
            removing `\hbox' on input line 308.</DIV>
  <DIV style="MARGIN: 0px; MIN-HEIGHT: 14px; FONT: 10px Monaco"><BR></DIV>
  <DIV style="MARGIN: 0px; MIN-HEIGHT: 14px; FONT: 10px Monaco"><BR></DIV>
  <DIV style="MARGIN: 0px; FONT: 10px Monaco">Package hyperref Warning: Token 
  not allowed in a PDF string (Unicode):</DIV>
  <DIV style="MARGIN: 0px; FONT: 10px Monaco">(hyperref)      
            removing `\char' on input line 308.</DIV>
  <DIV><BR></DIV>
  <DIV>Now that everything else works, how to prevent this hyperref problem 
  ?</DIV>
  <DIV><BR></DIV>
  <DIV>Thanks</DIV>
  <DIV><BR></DIV>
  <DIV>Pierre</DIV>
  <DIV><BR>
  <DIV>
  <DIV>Le 31 oct. 2010 à 23:19, John Was a écrit :</DIV><BR 
  class=Apple-interchange-newline>
  <BLOCKQUOTE type="cite">
    <DIV>Hello Pierre<BR><BR>I'm sorry to say that I can't help with the 
    marginal kerning - I've never investigated that facility in TeX since the 
    output I get without it has always seemed OK (to my eye) in the work I do. 
     What seems to be happening is that the TeX mapping is being ignored by 
    the package that deals with the marginal kerning, so when in the \active 
    hacks that I sent you the true apostrophe is being replaced by the upright 
    ', the package is giving you the latter instead of switching it to the 
    correct typographical sort as your TeX mapping specifies.  I'm sure 
    those maintaining the package will be able to come up with some proper 
    solution, but in the meantime you could try bypassing the TeX mapping for 
    apostrophes and closing quotation marks by using the correct Unicode 
    characters (as I think you have already done with the single quotation 
    mark/apostrophe).<BR><BR>In spite of my misgivings about using an active 
    character in the definition of that very same character, the following does 
    seem to work without causing processing 
    errors:<BR><BR>\catcode"2019=\active<BR>\def’{\leavevmode \kern 1sp 
    \hbox{\char"2019}}<BR>\catcode"201D=\active<BR>\def”{\leavevmode \kern 1sp 
    \hbox{\char"201D}}<BR><BR>Try that instead of my previous four lines of code 
    and see what happens!<BR><BR><BR><BR>John<BR><BR><BR><BR><BR>----- Original 
    Message ----- From: "Pierre Morel" <<A 
    href="mailto:pier.morel@gmail.com">pier.morel@gmail.com</A>><BR>To: 
    "Unicode-based TeX for Mac OS X and other platforms" <<A 
    href="mailto:xetex@tug.org">xetex@tug.org</A>><BR>Sent: 31 October 2010 
    18:14<BR>Subject: Re: [XeTeX] Several apostrophe-related problems (kerning, 
    mapping)<BR><BR><BR>Thank you John, your hack indeed solves the problem when 
    U+0027 apostrophes are replaced with U+2019 apostrophes (I did not try to 
    make U+0027 active) and when the margin kering is not 
    activated.<BR><BR>However, replacing U+0027 with U+2019 apostrophes showed 
    that the margin-kerning bug is not due to the tex-text mapping : even when 
    the apostrophes are U+2019 in the source file, they are replaced by U+0027 
    apostrophes in the PDF !! And this only for the font for which margin 
    kerning is activated.<BR><BR>Any ideas on this last problem ?<BR><BR><BR>Le 
    31 oct. 2010 à 16:32, John Was a écrit :<BR><BR>
    <BLOCKQUOTE type="cite">Hello<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">I can't help with the marginal kering (which I 
      don't use), but here is what I do in a font that also had overtight 
      kerning associated with apostrophes:<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\catcode"2019=\active<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\def’{\leavevmode \kern 1sp 
    \hbox{'}}<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\catcode"201D=\active<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\def”{\leavevmode \kern 1sp 
    \hbox{''}}<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Note that the characters in the \hboxes are the 
      ordinary straight apostrophe (since I also use TeX mapping in my font 
      calls.)<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">As it stands, this would involve you actually 
      using the correct Unicode characters 2019 and 201D for closing single and 
      double apostrophes in your document, in spite of your tex-mapping - and I 
      guess you could achieve this by global search-and-replace in your file. 
       But you  may be able to do much the same thing by making 0027 
      active instead (I haven't tried that - I can see a potential danger of a 
      loop if you are using 0027 to define itself).<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">I'm sure there are more elegant solutions - and I 
      use plain TeX so there may be LaTeX issues that I don't know 
    about.<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">(Of course, if my request for custom kerning could 
      be met, we would all be able to refine the kerning of any font at will. 
       Unfortunately, someone in another thread explained that that is very 
      difficult in XeTeX because of the way it looks up font information (LuaTeX 
      can do it because it has another method of accessing the font's tables). 
       I was rather hoping that someone would see that as an opportunity to 
      show off hrs computing prowess by performing the miracle - but this hasn't 
      happened yet.)<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">John<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">----- Original Message ----- From: "Pierre Morel" 
      <<A 
    href="mailto:pier.morel@gmail.com">pier.morel@gmail.com</A>><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">To: "Unicode-based TeX for Mac OS X and other 
      platforms" <<A 
    href="mailto:xetex@tug.org">xetex@tug.org</A>><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Sent: 31 October 2010 15:02<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Subject: [XeTeX] Several apostrophe-related 
      problems (kerning, mapping)<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Hello,<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">My thesis is finished soon, but I have an annoying 
      apostrophe problem.<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">In French we have a lot of apostrophes uses like 
      this : L'œil, l'incertitude, etc.<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">In theory, these apostrophes should be the unicode 
      character U+2019 (right single quotation mark) instead of a straight 
      apostrophe (U+0027). This replacement is automatically made by this 
      command : \defaultfontfeatures{Mapping=tex-text}<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">First there is a problem with the kerning of this 
      U+2019 character, it is possibly a bug in the font I'm using (Adobe Caslon 
      Pro), but I'd like to solve it anyway.<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Here is an example (The word L'œil, on the top 
      right) :<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><A 
      href="http://dl.dropbox.com/u/1205127/Images/xetex.jpg">http://dl.dropbox.com/u/1205127/Images/xetex.jpg</A><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">The apostrophe is completely kerned above the "œ" 
      (the same problem is present for any small character), which thus touches 
      the "L".<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">So my first question is: is there a way to 
      override the default kerning of this U+2019 character so that it behaves 
      in a more correct way (with a slight space between the apostrophe and the 
      next letter) ?<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Now there is a second problem (which solved the 
      first one but in a bad way).<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">When activating margin kerning, xetex behaves as 
      if the line \defaultfontfeatures{Mapping=tex-text} was not present : 
      U+0027 apostrophes stay straight (which curiously solves the kerning 
      problem, see the example on the top left of the image), and `` and '' are 
      not converted appropriately (more annoying).<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Here is what I use for the margin kerning (when I 
      comment these line, the mapping problem is corrected) :<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\newcount\countA<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\ifx\XeTeXprotrudechars\undefined<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \pdfprotrudechars=2<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\else<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \let\pdftexversion=\countA<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \pdftexversion = 140<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \XeTeXprotrudechars=2%\fi<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\input protcode-native<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\font\f="Adobe Caslon Pro" at 11pt 
    \f<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\setprotcode\f<BR></BLOCKQUOTE>
    <BLOCKQUOTE 
    type="cite">    \pretolerance=-1<BR></BLOCKQUOTE>
    <BLOCKQUOTE 
    type="cite">     \tolerance=9999<BR></BLOCKQUOTE>
    <BLOCKQUOTE 
      type="cite">     \emergencystretch=2em<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">With the file protcode-native file 
    being<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">\def\setprotcode#1{<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"0021 
       55<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"002C 
       194<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"002D 
       233<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"002E 
       194<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"003B 
       138<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"003A 
       138<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"003F 
       94<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \lpcode#1 U"2018 
       194<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"2019 
       194<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"0027 
       194<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \lpcode#1 U"201C 
       250<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"201D 
       250<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"2013 
       150<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"> \rpcode#1 U"2014 
       200<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">}<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">So, in short, I want to use margin kerning while 
      maintaining the tex-text mapping AND having a correct kerning with the 
      U+2019 apostrophe.<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">PS: (this last problem also appears on my sans 
      serif font (Myriad pro), an example is visible in the linked 
    image.<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Thank you,<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Pierre<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE 
      type="cite">--------------------------------------------------<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Subscriptions, Archive, and List information, 
      etc.:<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><A 
      href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</A><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><BR></BLOCKQUOTE>
    <BLOCKQUOTE 
      type="cite">--------------------------------------------------<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite">Subscriptions, Archive, and List information, 
      etc.:<BR></BLOCKQUOTE>
    <BLOCKQUOTE type="cite"><A 
      href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</A><BR></BLOCKQUOTE><BR><BR><BR><BR>--------------------------------------------------<BR>Subscriptions, 
    Archive, and List information, etc.:<BR><A 
    href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</A> 
    <BR><BR><BR>--------------------------------------------------<BR>Subscriptions, 
    Archive, and List information, etc.:<BR><A 
    href="http://tug.org/mailman/listinfo/xetex">http://tug.org/mailman/listinfo/xetex</A><BR></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV>
  <P>
  <HR>

  <P></P><BR><BR>--------------------------------------------------<BR>Subscriptions, 
  Archive, and List information, etc.:<BR>  
  http://tug.org/mailman/listinfo/xetex<BR></BLOCKQUOTE></BODY></HTML>