[XeTeX] combine 2 glyphs with xelatex

John Was johnoxuk at gmail.com
Mon Mar 11 09:41:04 CET 2024


Hello

The more language-specific elegant solution has I think been provided by
Zdenek Wagner, but if it's ever desired to superimpose glyphs that don't
naturally coalesce, I use the following (in plain XeTeX but it should work
in LaTeX too):

\def\overstrike#1#2{\leavevmode

   \setbox0=\hbox{#1}\setbox1=\hbox{#2}\copy0

   \kern -0.5\wd0 \kern -0.5\wd1 \copy1 \kern -0.5\wd1 \kern 0.5\wd0}

Then just (e.g.):

\overstrike{b}{p}

(which would get a rather ham-fisted pseudo-thorn - exactly what I used to
do in the age of manual typewriters).

The two arguments can be quite elaborate - the glyphs could come from
different fonts, one or both could be raised or lowered, and nesting is
possible, so e.g.:

\overstrike{\overstrike{b}{p}}{\raise 0.25em \hbox{ˆ}}

should yield the pseudo-thorn with a raised circumflex accent above.

If the same combination were needed repeatedly, it could be given a name,
e.g.

\def\oddthorn{\overstrike{\overstrike{b}{p}}{\raise 0.25em \hbox{ˆ}}}

So ' oþer' with a high circumflex (if for some reason you had to use a font
with no thorn) would be:

o{\oddthorn}er

Not exactly beautiful, but it's surprising how often it's come to my rescue
over the years (much less so since Unicode kicked in, of course).

Best

John Waś  *🇪🇺 * Слава Україні!
* 🇺🇦*


On Sun, 10 Mar 2024 at 21:39, François Patte <
francois.patte at mi.parisdescartes.fr> wrote:

> Bonjour,
>
> I would like to combine glyphs using xelatex : the glyphs are: U+0947
> and U+093D if I write \symbol{"0947}\symbol{"093D}, I get the two glyphs
> side by side, the first one with a dotted circle below.
>
> What I want is the first one combined with the second one ie. the first
> one above the second one.
>
> How can I get this result?
>
> Thank you.
>
> --
> François Patte
> UFR de mathématiques et informatique
> Laboratoire CNRS MAP5, UMR 8145
> Université Paris Descartes
> 45, rue des Saints Pères
> F-75270 Paris Cedex 06
> Tél. +33 (0)6 7892 5822
> http://www.math-info.univ-paris5.fr/~patte
> FSF
>
> https://www.fsf.org/blogs/community/presenting-shoetool-happy-holidays-from-the-fsf
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/xetex/attachments/20240311/6d0e52c7/attachment.htm>


More information about the XeTeX mailing list.