[XeTeX] Change font metric?

John Was john.was at ntlworld.com
Mon Nov 9 14:43:34 CET 2009


Hello

>- the trick
>\catcode"2019=\active
>\def’{\leavevmode \kern 1sp \hbox{'}}
>works, except for the practical problem mentioned above. Is it possible to 
>activate the U+0027 character to do the same? Will this >produce conflicts 
>elsewhere (in math mode for instance)?

You could certainly try using "0027 instead of "2019 in the above, but I 
think there could well be problems with some common macro packages, whereas 
it's rather unlikely that the true apostrophe is used in a macro package. 
You can get the true apostrophe/closing quote on a Windows keyboard by 
holding down ALT and typing 0146 (0148 for the double closing quotation 
mark) on the numeric keypad at the right, which of course is a nuisance with 
such a common character.  Or you could employ the very useful and free 
Hotkey utility (just Google it) to map a convenient key combination to 
produce the apostrophe (something like the Windows key plus 'p' would do it 
and you should soon become accustomed to doing that whenever you need the 
apostrophe).  Or you can put the search-and-replace in a macro (Hotkey can 
also help to automate this) which you would just have to remember to run 
whenever you are closing a file (your text editor might allow you to specify 
a macro that is run every time you close a file, though I guess it's more 
common to have editors and word processors that run a macro every time you 
open one).

None of this is ideal and a custom-kerning option, like the .fea file in 
LuaTeX mentioned by another respondent, would be the best  XeTeX solution, I 
feel, not least because a future release of the font might not exhibit this 
fault, in which case you would just need to remove your customized kern 
instruction.  There would also then be no question mark over the legality of 
interfering with the font itself, and the custom kerning would allow a user 
to fine-tune slight (as well as serious) spacing issues in a font (in Minion 
Pro, for example, the closing parenthesis is sometimes just slightly too far 
from the preceding character).

John





----- Original Message ----- 
From: "Thierry" <rhomunu-list at yahoo.fr>
To: <xetex at tug.org>
Sent: Monday, November 09, 2009 12:51 PM
Subject: Re: [XeTeX] Change font metric?


>
>> This change is done via the Mapping=tex-text option. You
>> can either not use this for your defective fonts or change
>> it according to your defective fonts' needs. Then it'll be
>> best to have an "adobe-text" or such option that the working
>> fonts can continue to work.
>>
>
> I have tried without the Mapping=tex-text option and indeed the apostrophe 
> from the source is used into the pdf, and the metric is better (but the 
> glyph is not so beautiful!). This can be a solution.
> What I don't understand is the following. Using pdflatex, this change 
> takes place automatically. With xetex, this is a kind of option. Is there 
> a way to create a personalization of what is done and not?
> You mention an "adobe-text" option. How could I produce this? I don't know 
> where the rules applied by the Mapping=tex-text option are defined. IS 
> there a way to do the same with pdflatex? (I use it for some projects).
>
> Concerning other propositions which have been made, I have some remarks:
> - one of them is to manually change the input apostrophe into the output 
> one. This doesn't solve the metric problem.
>>From a practical point of view, this find and replace procedure is not 
>>very convenient. I have remember to use it each time I change the text. I 
>>prefer to let (xe)latex do it for me!
>
> - the trick
> \catcode"2019=\active
> \def’{\leavevmode \kern 1sp \hbox{'}}
> works, except for the practical problem mentioned above. Is it possible to 
> activate the U+0027 character to do the same? Will this produce conflicts 
> elsewhere (in math mode for instance)?
>
> - I could change the metric in the font installed on my computer, using 
> for instance "FontForge", but I really don't know how to do that! This 
> software is not easy to understand. I only know how to use it to change 
> the encoding of fonts files and save them in pfb to install them in my tex 
> tree (old procedure before xetex).
>
> Thanks a lot
> Thierry
>
>
>
>
> 



More information about the XeTeX mailing list